Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CI and deployment.yaml share the same dependency install script #190

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 2 additions & 9 deletions deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions scripts/install_eval_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set -euo pipefail

export PYTHONUSERBASE=/snekbox/user_base
ChrisLovering marked this conversation as resolved.
Show resolved Hide resolved
find /lang/python -mindepth 1 -maxdepth 1 -type d -exec \
{}/bin/python -m pip install --user -U -r requirements/eval-deps.pip \;
Loading