Skip to content

Commit

Permalink
Support multiple versions of python in parallel (#102)
Browse files Browse the repository at this point in the history
* Install python3.12 and 3.10 in parallel

This should let us run multiple versions of the randomizer with
incompatible python versions in the same bot container

* Update wwrando-random-settings

* Update wwrando-mixed-pools

---------

Co-authored-by: wooferzfg <[email protected]>
  • Loading branch information
Aelire and wooferzfg committed Mar 25, 2024
1 parent 599ec68 commit c91e276
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[submodule "wwrando-random-settings"]
path = wwrando-random-settings
url = https://github.com/Aelire/wwrando.git
branch = randobot-support
branch = randobot-support-keep-gclib
[submodule "wwrando-mixed-pools"]
path = wwrando-mixed-pools
url = https://github.com/wooferzfg/wwrando.git
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
FROM python:3.10-buster
# This is the default version under which randobot will run
FROM python:3.12-bookworm

# Copy python from the source image for any additional version we need to support
COPY --from=python:3.10-bookworm /usr/local/bin/python3 /usr/local/bin/python3.10
COPY --from=python:3.10-bookworm /usr/local/lib/libpython3.10.so.1.0 /usr/local/lib/libpython3.10.so.1.0
COPY --from=python:3.10-bookworm /usr/local/lib/python3.10/ /usr/local/lib/python3.10

WORKDIR /tww-rando-bot

Expand Down
9 changes: 7 additions & 2 deletions setup-wwrando.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash -ex

for rando in wwrando wwrando-dev-tanjo3 wwrando-random-settings wwrando-mixed-pools; do
for rando in wwrando wwrando-dev-tanjo3; do
(cd $rando &&
python -m venv /venv/$rando --upgrade-deps &&
python3.10 -m venv /venv/$rando --upgrade-deps &&
/venv/$rando/bin/pip install --no-cache-dir -r requirements.txt)
done
for rando in wwrando-mixed-pools wwrando-random-settings; do
(cd $rando &&
python3.12 -m venv /venv/$rando --upgrade-deps &&
/venv/$rando/bin/pip install --no-cache-dir -r requirements.txt)
done

0 comments on commit c91e276

Please sign in to comment.