aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2023-09-01 18:24:59 +0100
committerGravatar GitHub <[email protected]>2023-09-01 18:24:59 +0100
commit5d9d3b8a0e252d11440384f7140fc544338caca0 (patch)
treecb0df87cd1f9db9fdaca344666ba279c8e2ac06d
parentAdd references to when eval packages will be updated for 3.12 (diff)
parentInclude install eval deps in final image (#191) (diff)
Merge branch 'main' into update-eval-deps
-rw-r--r--.github/workflows/test.yaml6
-rw-r--r--Dockerfile1
-rw-r--r--Makefile4
-rw-r--r--deployment.yaml11
-rw-r--r--scripts/install_eval_deps.sh5
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
diff --git a/Dockerfile b/Dockerfile
index 6b5e2f6..4fe056d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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
diff --git a/Makefile b/Makefile
index a385a8e..9ea46cb 100644
--- a/Makefile
+++ b/Makefile
@@ -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 \;