-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch packages used to test the configuration #167
Conversation
The pytest-dockerc plug is unmaintained and there is now a dependency issues with PyYAML because of the release of Cython v3 (which is itself a build dependency for PyYAML). After some research this seemed like the most similar package in terms of functionality to the package we are replacing. Although it is not a pytest plugin it still provides similar access and uses the Docker composition defined in the repository.
Can you comment briefly as to why this is a better choice than avast/pytest-docker? |
About 8-months ago I tackled the issue of replacing Benefits:
That said, I would like to suggest we use the official docker library as our mechanism for controlling containers under test. Thoughts? See: |
@jsf9k The pytest-docker plugin provides almost no information about the started containers. It seems well suited for using a Docker composition to test a Python package as opposed to testing a Docker image. The only helpful information it seems to provide is the IP of the running Docker container and port mappings.
@felddy I specifically chose not to use docker-py because it is focused around low-level access to the Docker Engine HTTP API. I believe that our existing system of using a |
@mcdonnnj do you have any examples of projects where we have to (or would prefer to) test using a Docker composition, as opposed to testing the container on its own without a composition? In theory, it sounds cleaner and more in line with our best practices to be able to test each container in isolation, but practically, I'm not so sure if that is always possible or preferable. This one is a bit of a toss-up for me so far. The fact that @felddy has already been using docker-py in a real project for a while earns it some points in my book. On the other hand, there are some potentially useful Python-on-whales features in the Docker blog post that @mcdonnnj pointed out:
I guess it comes down to Docker CLI vs engine and I don't have a super strong preference either way:
|
I could envision the |
Anything that is designed around using secrets with Docker Compose would benefit from this library choice. All of our current testing is designed around the use of a Docker composition. Most, if not all, of our Docker image configurations are also designed around usage with a Docker composition. I feel that using the Docker API directly is over-complicated for the purposes of testing our images. Using Compose files as we have been doing provides a static and separately testable format. When I say separately testable I mean that I can run a |
It seems that we have the following:
How about a deadline of 9AM Wednesday morning, and then we call it? If it is still a tie at that point then how about we force @dav3r to vote? |
I think docker-on-whales is tempting but from what I've gathered the support for using it boils down to simply being convenient which I understand. However, we don't need more abstractions. I am also thinking about the future here. docker-py is the official library from Docker themselves which has proven to be reliable and current with the latest Docker API changes. I know there's no support for compose which sucks, but... it's not the end of the world. |
Looks like we need @dav3r to cast the tie-breaking vote. |
While not an official vote, I also like the fact that |
@felddy - Is the abiosoft/colima jazz you have been recommending supported by docker/docker-py? In other words, does |
It supports Docker so yes, it should. |
I thought the point of @felddy's move to |
Colima can still use the Docker engine (if you want), without the need for running the Docker Desktop client (at least on Mac). This post has the graphic below that I found to be helpful in understanding where Colima fits: |
How does it obviate the need for Docker Desktop or similar? Docker containers must run under a Linux kernel, so there would have to be a Linux VM running on OSX. Does Colima launch its own Linux VM in which to run Docker containers? |
Yes, Colima has its own VM - the Colima README has some info about that. |
In today's dev team mullet meeting it was decided to move ahead with @mcdonnnj's python-on-whales solution. @dav3r said that he was leaning slightly toward that, and @felddy said this is not a hill he is prepared to die on, so that resolved the dilemma. We just need a few more reviews on this PR from @cisagov/team-ois and then we can merge it and wrap up the current Kraken. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💀 🐳 👍
🗣 Description
This pull request updates the test configuration to use the python-on-whales package instead of pytest-dockerc.
💭 Motivation and context
With the release of Cython v3 we now have a dependency issue with our testing configuration. This new version of Cython is incompatible with PyYAML
5.4.1
, which is the last version of PyYAML that the docker-compose package will pull. Since the docker-compose Python package has been deprecated in favor of the v2 Golang application it is very unlikely (only maintenance for security fixes) that support for PyYAML v6 will be introduced. Due to build difficulties the odds of a PyYAML 5.4.2 which pins under the new Cython release is also very unlikely to happen.This dependency problem coupled with the fact that the last release for the pytest-dockerc package was on 2020-10-09 and the latest commit on the default branch of the repository was the same day pushes us to migrate our testing configuration. After some research I settled on the python-on-whales package as being most similar in functionality to the pytest-dockerc package.
🧪 Testing
✅ Pre-approval checklist