Support multiple versions of python in parallel #102
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The idea is to use Docker multi-stage builds to bring python from multiple images into a single image
The base image (the first
FROM
at the top of the Dockerfile) will bring in the/usr/local/bin/python3
symlink, so for things running outside a venv like the rando bot itself, that will be the version usedThe other versions only have a
/usr/local/bin/python<version>
executable and need to be called with a full version name. Here that's only 3.10 but we could include any other version for which there is an official docker image with the same construct in the future. The process is somewhat manual/copy-pasty but shouldn't be too difficult to maintain, since python installations are fairly self-contained with a binary, a shared library and everything else in the/usr/lib/python<version>
directory (this has been true since at least python2 as far as I can tell)I've tested this under python 3.12 for randobot and wwrando-random-settings with the gclib/python3.12 patches removed in this test race: https://racetime.gg/twwr/hyper-molgera-4964