diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 473b8a7a..3b20aa47 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -116,8 +116,4 @@ jobs: - name: Install eval deps run: | export IMAGE_SUFFIX='-venv:${{ inputs.version }}' - export PYTHONUSERBASE=/snekbox/user_base - docker compose run \ - --rm -T --entrypoint /bin/sh snekbox -c \ - find /lang/python -mindepth 1 -maxdepth 1 -type d -exec \ - {}/bin/python -m pip install --user -U -r requirements/eval-deps.pip \; + docker compose run --rm -T --entrypoint /bin/sh snekbox scripts/install_eval_deps.sh diff --git a/deployment.yaml b/deployment.yaml index 6f188c9f..51afb46e 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -13,22 +13,15 @@ spec: app: snekbox spec: initContainers: - # Ensure "dry-run-deploy" job of test.yaml is updated with any changes to this init container - name: deps-install image: ghcr.io/python-discord/snekbox:latest imagePullPolicy: Always volumeMounts: - name: snekbox-user-base-volume mountPath: /snekbox/user_base - env: - - name: PYTHONUSERBASE - value: /snekbox/user_base command: - "/bin/sh" - - "-c" - - >- - find /lang/python -mindepth 1 -maxdepth 1 -type d -exec - {}/bin/python -m pip install --user -U -r requirements/eval-deps.pip \; + - "scripts/install_eval_deps.sh" containers: - name: snekbox image: ghcr.io/python-discord/snekbox:latest diff --git a/scripts/installed_eval_deps.sh b/scripts/installed_eval_deps.sh new file mode 100644 index 00000000..b5b5fdc9 --- /dev/null +++ b/scripts/installed_eval_deps.sh @@ -0,0 +1,3 @@ +export PYTHONUSERBASE=/snekbox/user_base +find /lang/python -mindepth 1 -maxdepth 1 -type d -exec \ + {}/bin/python -m pip install --user -U -r requirements/eval-deps.pip \;