Skip to content

RFC: Add docker compose file for running non-native test environments #8331

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

toofar
Copy link
Member

@toofar toofar commented Oct 13, 2024

Would anyone else find it useful to be able to spin up the same containers that are used in CI? Is docker-compose a goood interface for doing so?

Opinions welcome!


I find it difficult to reproduce issues on old python versions, or when archlinux brings in a newer build of Qt than I have and I can't be bothered rebuilding.

I've been using docker for a while to help test in these environments locally, but the docker command is a bit long and unwieldy. Docker compose is a method I've used before to provide canned docker invocation. We could probably get away with writing our own script for it, but using standard components is good. This should work with podman-compose too.

This commit encodes the docker command I've been using so that I, and other people, can use it with a less arcane command line. Hopefully it helps other people. There are still a few rough edges like for any runs of the "other" service you will pretty much have to drop into a bash shell and install tox and some X11 stuff. But the images we publish work in one-liners (although they would be a little faster with a tox/pip cache directory mounted from the host so they don't setup the venv every time).

See also: the docker related hints in the contributor guidlines.

I find it difficult to reproduce issues on old python versions, or when
archlinux brings in a newer build of Qt than I have and I can't be
bothered rebuilding.

I've been using docker for a while to help test in these environments
locally, but the docker command is a bit long and unwieldy. Docker
compose is a method I've used before to provide canned docker
invocation. We could probably get away with writing our own script for
it, but using standard components is good. This should work with
podman-compose too.

This commit encodes the docker command I've been using so that I, and
other people, can use it with a less arcane command line. Hopefully it
helps other people. There are still a few rough edges like for any
runs of the "other" service you will pretty much have to drop into a
bash shell and install tox and some X11 stuff. But the images we publish
work in one-liners (although they would be a little faster with a
tox/pip cache directory mounted from the host so they don't setup the
venv every time).

See also: the docker related hints in the contributor guidlines.
@The-Compiler
Copy link
Member

The file should probably live somewhere in misc/ or so? Also to make it clear that this is not something intended for users of qutebrowser.

Docker compose seems like a fitting tool if your goal is to basically persist Docker commandlines. I use it too for various things like that. However, see below.

I wonder if act wouldn't be a better fit for this? It looks like e.g. act -j tests-docker --matrix image:archlinux-webengine-unstable-qt6 can run the tests in that environment without any additional effort (and duplication!). But I suppose your goal here is also local debugging (having a shell, X11 passthrough, etc.), so I suppose that approach is a tad too simple in the end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants