diff options
| author | 2023-09-01 18:24:59 +0100 | |
|---|---|---|
| committer | 2023-09-01 18:24:59 +0100 | |
| commit | 5d9d3b8a0e252d11440384f7140fc544338caca0 (patch) | |
| tree | cb0df87cd1f9db9fdaca344666ba279c8e2ac06d | |
| parent | Add references to when eval packages will be updated for 3.12 (diff) | |
| parent | Include install eval deps in final image (#191) (diff) | |
Merge branch 'main' into update-eval-deps
Diffstat (limited to '')
| -rw-r--r-- | .github/workflows/test.yaml | 6 | ||||
| -rw-r--r-- | Dockerfile | 1 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | deployment.yaml | 11 | ||||
| -rw-r--r-- | scripts/install_eval_deps.sh | 5 | 
5 files changed, 13 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 @@ -66,6 +66,7 @@ RUN chmod +x /usr/sbin/nsjail \  FROM base as venv  COPY --link requirements/ /snekbox/requirements/ +COPY --link scripts/install_eval_deps.sh /snekbox/scripts/install_eval_deps.sh  WORKDIR /snekbox  RUN pip install -U -r requirements/requirements.pip @@ -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 \; | 
