#4815 Upgrade the Docker-based dev environment
Closed by sudoman. Opened by sudoman.
sudoman/pagure docker-improvements-0  into  master

Download 4815.patch

The containers now all inherit from a common Fedora 30 image, with only Python 3 packages installed. This saves disk space, and creates a consistent testing environment.

When possible, the base Dockerfile installs Python packages from the distro repository instead of PyPi. This is creates a stable installation that isn't dependent on the latest version of any package, so it should continue to work with less adjustment in the future.

Both the old and new Docker images produce a lot of failures when running the test suite from within. In the latter case, it's because redis-server is not installed on the dev_web_1 container (it's currently shipped in the redis container). Until the runtests.py script is fixed to handle a network socket, a workaround is possible by installing the redis package on dev_web_1 before running the tests. After doing that, most of the tests pass.

I've also updated the documentation about how to build / use the Docker images.

I plan to continue improving the Docker setup for Pagure with more commits.

Can we please use fedora:32? It should be available from registry.fedoraproject.org...

This is present in Fedora 31+ as python3-nose-xcover.

This will not be necessary in Fedora 31+, just install python-unversioned-command, which adds /usr/bin/python pointing to Python 3.

@sudoman Thank you for this work, it looks great! I just had some specific feedback which I've left above. :smile:

Thanks for the great feedback. : )

I created a branch with the suggested changes, with Fedora 32 as the source image:

https://pagure.io/fork/sudoman/pagure/tree/docker-improvements-1

It turns out that Fedora 30 also supports those two packages, so I created another branch with your changes, but for fc30:

https://pagure.io/fork/sudoman/pagure/tree/docker-improvements-2

While using new software is great, I think there's an advantage to using older software for testing. If these Docker images are used for testing code by developers, then by using the latest release of Fedora means that incompatibility with older packages could go unnoticed for a while, and required dependencies would need to be at higher versions than are available on some distros.

I like to think that this is similar to the idea of testing code on old and slow systems that also have spotty, low bandwidth networking, and little memory. This ensures that the code will run on just about anywhere.

That being said, it's true that Fedora 30 won't be supported much longer, so there are pros and cons. The nice thing about it is that updating the Docker image only requires changing one digit. : )

@sudoman python-unversioned-command is python2 in Fedora 30, so a good compromise would be to use Fedora 31, then. :)

I think I like the f31 middle ground.

Our CI tests on CentOS7 with py2 so it should prevent us from merging broken code for older system.

Should we go with F31?

I also like the idea of going with Fedora 31 for now. I'm fine with upgrading to Fedora 32 at any point given that the CI is also testing with Python2. If someone needs a newer dependency that isn't in their distro, they can still use pip.

I opened a new pull request here:

https://pagure.io/pagure/pull-request/4818

Pull-Request has been closed by sudoman

Metadata