diff options
-rw-r--r-- | .github/workflows/test.yaml | 6 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | deployment.yaml | 11 | ||||
-rw-r--r-- | scripts/install_eval_deps.sh | 5 |
4 files changed, 12 insertions, 14 deletions
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 473b8a7..6f89d87 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/bash snekbox scripts/install_eval_deps.sh @@ -41,3 +41,7 @@ build: .PHONY: devsh devsh: docker compose run --entrypoint /bin/bash --rm snekbox + +.PHONY: eval-deps +eval-deps: + docker compose run --rm -T --entrypoint /bin/bash snekbox scripts/install_eval_deps.sh diff --git a/deployment.yaml b/deployment.yaml index 6f188c9..cad8037 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 \; + - /bin/bash + - scripts/install_eval_deps.sh containers: - name: snekbox image: ghcr.io/python-discord/snekbox:latest diff --git a/scripts/install_eval_deps.sh b/scripts/install_eval_deps.sh new file mode 100644 index 0000000..716d513 --- /dev/null +++ b/scripts/install_eval_deps.sh @@ -0,0 +1,5 @@ +set -euo pipefail + +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 \; |