diff options
author | 2023-08-29 21:50:49 +0100 | |
---|---|---|
committer | 2023-08-29 21:50:49 +0100 | |
commit | afda301bc07efeb2a1f33db9ec3b316393badfe0 (patch) | |
tree | 7049dea35ef387f4e6f87620e322077fe626dce1 | |
parent | Merge pull request #184 from python-discord/jb3/3.12-ignores (diff) | |
parent | Switch from using post start hooks to init containers (diff) |
Merge pull request #185 from python-discord/jb3/refactor-eval-deps
Refactor how we process eval dependencies
-rw-r--r-- | deployment.yaml | 51 | ||||
-rw-r--r-- | requirements/eval-deps.pip | 24 |
2 files changed, 40 insertions, 35 deletions
diff --git a/deployment.yaml b/deployment.yaml index ac2e2fe..3ce8d00 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -12,6 +12,22 @@ spec: labels: app: snekbox spec: + initContainers: + - 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 \; containers: - name: snekbox image: ghcr.io/python-discord/snekbox:latest @@ -23,41 +39,6 @@ spec: volumeMounts: - name: snekbox-user-base-volume mountPath: /snekbox/user_base - lifecycle: - postStart: - exec: - command: - - "/bin/sh" - - "-c" - - >- - find /lang/python -mindepth 1 -maxdepth 1 -type d -exec - sh -c 'PYTHONUSERBASE=/snekbox/user_base && - {}/bin/python -m pip install --user -U - anyio[trio]~=3.6 - arrow~=1.2 - attrs~=22.2 - beautifulsoup4~=4.11 - einspect~=0.5 - fishhook~=0.2 - forbiddenfruit~=0.1 - fuzzywuzzy~=0.18 - lark~=1.1 - "matplotlib~=3.6 ; python_version == \'3.11\'" - more-itertools~=9.0 - networkx~=3.0 - "numpy~=1.24 ; python_version == \'3.11\'" - "numpy==1.26.0b1 ; python_version == \'3.12\'" - "pandas~=1.5 ; python_version == \'3.11\'" - "pendulum~=2.1 ; python_version == \'3.11\'" - python-dateutil~=2.8 - pyyaml~=6.0 - scipy~=1.10 - sympy~=1.11 - toml~=0.10 - typing-extensions~=4.4 - tzdata~=2022.7 - "yarl~=1.8 ; python_version == \'3.11\'" - ' \; volumes: - name: snekbox-user-base-volume hostPath: diff --git a/requirements/eval-deps.pip b/requirements/eval-deps.pip new file mode 100644 index 0000000..79f8218 --- /dev/null +++ b/requirements/eval-deps.pip @@ -0,0 +1,24 @@ +anyio[trio]~=3.6 +arrow~=1.2 +attrs~=22.2 +beautifulsoup4~=4.11 +einspect~=0.5 +fishhook~=0.2 +forbiddenfruit~=0.1 +fuzzywuzzy~=0.18 +lark~=1.1 +matplotlib~=3.6 ; python_version == '3.11' +more-itertools~=9.0 +networkx~=3.0 +numpy~=1.24 ; python_version == '3.11' +numpy==1.26.0b1 ; python_version == '3.12' +pandas~=1.5 ; python_version == '3.11' +pendulum~=2.1 ; python_version == '3.11' +python-dateutil~=2.8 +pyyaml~=6.0 +scipy~=1.10 +sympy~=1.11 +toml~=0.10 +typing-extensions~=4.4 +tzdata~=2022.7 +yarl~=1.8 ; python_version == '3.11' |