From 308e1d1167d38cbcc0cb3156799e14aeaff9a126 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 17 May 2025 09:31:58 +0100 Subject: Consistent capitalisation in dockerfile --- Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 86823a4..904357b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1.4 -FROM buildpack-deps:bookworm as builder-nsjail +FROM buildpack-deps:bookworm AS builder-nsjail WORKDIR /nsjail @@ -17,7 +17,7 @@ RUN git clone -b master --single-branch https://github.com/google/nsjail.git . \ RUN make # ------------------------------------------------------------------------------ -FROM buildpack-deps:bookworm as builder-py-base +FROM buildpack-deps:bookworm AS builder-py-base ENV PYENV_ROOT=/pyenv \ PYTHON_CONFIGURE_OPTS='--disable-test-modules --enable-optimizations \ @@ -34,16 +34,16 @@ RUN git clone -b v2.4.23 --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROO COPY --link scripts/build_python.sh / # ------------------------------------------------------------------------------ -FROM builder-py-base as builder-py-3_12 +FROM builder-py-base AS builder-py-3_12 RUN /build_python.sh 3.12.8 # ------------------------------------------------------------------------------ -FROM builder-py-base as builder-py-3_13 +FROM builder-py-base AS builder-py-3_13 RUN /build_python.sh 3.13.1 # ------------------------------------------------------------------------------ -FROM builder-py-base as builder-py-3_13t +FROM builder-py-base AS builder-py-3_13t RUN /build_python.sh 3.13.1t # ------------------------------------------------------------------------------ -FROM python:3.13-slim-bookworm as base +FROM python:3.13-slim-bookworm AS base ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_NO_CACHE_DIR=false @@ -65,7 +65,7 @@ RUN chmod +x /usr/sbin/nsjail \ && ln -s /snekbin/python/3.12/ /snekbin/python/default # ------------------------------------------------------------------------------ -FROM base as venv +FROM base AS venv COPY --link requirements/ /snekbox/requirements/ COPY --link scripts/install_eval_deps.sh /snekbox/scripts/install_eval_deps.sh -- cgit v1.2.3 From 6a2812c68dcdae394aaddf026d9a9ce18ee066f3 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 17 May 2025 09:33:31 +0100 Subject: Bump 3.13 to 3.13.2 and make the default 3.13.3 has a bug with tests. This is fixed on the 3.13 dev branch, so will likely be part of 3.13.4 See this commit for more info https://github.com/python/cpython/commit/cc39b19f0fca8db0f881ecaf02f88d72d9f93776 --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 904357b..c83161d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ RUN apt-get -y update \ tk-dev \ && rm -rf /var/lib/apt/lists/* -RUN git clone -b v2.4.23 --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT +RUN git clone -b v2.5.7 --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT COPY --link scripts/build_python.sh / @@ -38,10 +38,10 @@ FROM builder-py-base AS builder-py-3_12 RUN /build_python.sh 3.12.8 # ------------------------------------------------------------------------------ FROM builder-py-base AS builder-py-3_13 -RUN /build_python.sh 3.13.1 +RUN /build_python.sh 3.13.2 # ------------------------------------------------------------------------------ FROM builder-py-base AS builder-py-3_13t -RUN /build_python.sh 3.13.1t +RUN /build_python.sh 3.13.2t # ------------------------------------------------------------------------------ FROM python:3.13-slim-bookworm AS base @@ -62,7 +62,7 @@ COPY --link --from=builder-py-3_13 /snekbin/ /snekbin/ COPY --link --from=builder-py-3_13t /snekbin/ /snekbin/ RUN chmod +x /usr/sbin/nsjail \ - && ln -s /snekbin/python/3.12/ /snekbin/python/default + && ln -s /snekbin/python/3.13/ /snekbin/python/default # ------------------------------------------------------------------------------ FROM base AS venv -- cgit v1.2.3 From 0f351e191f65b1abed501ef0e5f55ebeacfa2090 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 17 May 2025 09:34:07 +0100 Subject: Remove 3.12 in favour of 3.14-dev --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c83161d..56bab5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,6 @@ RUN git clone -b v2.5.7 --depth 1 https://github.com/pyenv/pyenv.git $PYENV_ROOT COPY --link scripts/build_python.sh / -# ------------------------------------------------------------------------------ -FROM builder-py-base AS builder-py-3_12 -RUN /build_python.sh 3.12.8 # ------------------------------------------------------------------------------ FROM builder-py-base AS builder-py-3_13 RUN /build_python.sh 3.13.2 @@ -43,6 +40,9 @@ RUN /build_python.sh 3.13.2 FROM builder-py-base AS builder-py-3_13t RUN /build_python.sh 3.13.2t # ------------------------------------------------------------------------------ +FROM builder-py-base AS builder-py-3_14 +RUN /build_python.sh 3.14-dev +# ------------------------------------------------------------------------------ FROM python:3.13-slim-bookworm AS base ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \ @@ -57,9 +57,9 @@ RUN apt-get -y update \ && rm -rf /var/lib/apt/lists/* COPY --link --from=builder-nsjail /nsjail/nsjail /usr/sbin/ -COPY --link --from=builder-py-3_12 /snekbin/ /snekbin/ COPY --link --from=builder-py-3_13 /snekbin/ /snekbin/ COPY --link --from=builder-py-3_13t /snekbin/ /snekbin/ +COPY --link --from=builder-py-3_14 /snekbin/ /snekbin/ RUN chmod +x /usr/sbin/nsjail \ && ln -s /snekbin/python/3.13/ /snekbin/python/default -- cgit v1.2.3 From b240456b206187eb8d294f71261db7dd028d6071 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 17 May 2025 09:34:31 +0100 Subject: Bump numpy version installed in dev to one that works for 3.13 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 56bab5d..0421d78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -83,7 +83,7 @@ RUN if [ -n "${DEV}" ]; \ then \ pip install -U -r requirements/coverage.pip \ && export PYTHONUSERBASE=/snekbox/user_base \ - && /snekbin/python/default/bin/python -m pip install --user numpy~=1.19; \ + && /snekbin/python/default/bin/python -m pip install --user numpy~=2.2.5; \ fi # At the end to avoid re-installing dependencies when only a config changes. -- cgit v1.2.3 From 4c7da9aa0b0d1dc3bf395fdb13140c2e305934a4 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 17 May 2025 09:35:14 +0100 Subject: Bump eval deps to latest versions This commit also updates which dependencies are installed in each verison of Python, according to what works where. --- requirements/eval-deps.pip | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/requirements/eval-deps.pip b/requirements/eval-deps.pip index 78bd20c..faaafec 100644 --- a/requirements/eval-deps.pip +++ b/requirements/eval-deps.pip @@ -1,24 +1,27 @@ -anyio[trio]~=4.7 +anyio[trio]~=4.9 arrow~=1.3 -attrs~=24.3 -beautifulsoup4~=4.12 -einspect~=0.5; python_version == '3.12' -fishhook~=0.3; python_version == '3.12' +attrs~=25.3 +beautifulsoup4~=4.13 + +# These packages don't support 3.13, 3.13t, nor 3.14-dev, so are commented out for now. +# einspect~=0.5 +# fishhook~=0.3 + forbiddenfruit~=0.1 fuzzywuzzy~=0.18 kaleido~=0.2 lark~=1.2 -matplotlib~=3.10; python_version == '3.12' -more-itertools~=10.5 +matplotlib~=3.10; python_version == "3.13" +more-itertools~=10.7 networkx~=3.4 -numpy~=2.2 -pandas~=2.2 -pendulum~=3.0; python_version == '3.12' -pyarrow~=18.1 +numpy~=2.2; python_version == "3.13" +pandas~=2.2; python_version == "3.13" +pendulum~=3.1 +pyarrow~=20.0; python_version == "3.13" python-dateutil~=2.9 pyyaml~=6.0 -scipy~=1.15 -sympy~=1.13 -typing-extensions~=4.12 -tzdata~=2024.2 -yarl~=1.18 +scipy~=1.15; python_version == "3.13" +sympy~=1.14 +typing-extensions~=4.13 +tzdata~=2025.2 +yarl~=1.20 -- cgit v1.2.3 From 2696bd67825c832a78d83daec9e34acba5a2dd99 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 17 May 2025 10:06:50 +0100 Subject: update tests to use new default python version --- tests/test_integration.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index ed44d86..d601a64 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -61,13 +61,13 @@ class IntegrationTests(unittest.TestCase): cases = [ ( get_python_version_body, - "3.12\n", + "3.13\n", "test default executable is used when executable_path not specified", ), ( get_python_version_body - | {"executable_path": "/snekbin/python/3.12/bin/python"}, - "3.12\n", + | {"executable_path": "/snekbin/python/3.13/bin/python"}, + "3.13\n", "test default executable is used when explicitly set", ), ( -- cgit v1.2.3 From c93326b3868ea4d4ca4e2f65f9d49c8eca528b58 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 17 May 2025 10:26:05 +0100 Subject: Replace deprecated ubuntu 20.04 CI runner with 24.04 --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b711276..591ed51 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] steps: - name: Download image artifact -- cgit v1.2.3 From 3027f4b9cecab1f3f4e05eeefdcbd33593e54745 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Mon, 19 May 2025 21:16:33 +0100 Subject: Only test on ubuntu-latest We previously used a matrixc to test cgroups v1 & v2. Now that ubuntu 20.04 is no longer supported by GitHub, we not longer have access to a runner with v1 cgroups. --- .github/workflows/test.yaml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 591ed51..270ab2b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,11 +11,7 @@ on: jobs: test: name: Test with coverage - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-22.04, ubuntu-24.04] - + runs-on: ubuntu-latest steps: - name: Download image artifact uses: actions/download-artifact@v4 @@ -40,7 +36,7 @@ jobs: run: | export IMAGE_SUFFIX='-venv:${{ inputs.version }}' docker compose run \ - --rm -T -e COVERAGE_DATAFILE=.coverage.${{ matrix.os }} \ + --rm -T -e COVERAGE_DATAFILE=.coverage \ --entrypoint coverage \ snekbox \ run -m unittest @@ -49,8 +45,8 @@ jobs: - name: Upload coverage data uses: actions/upload-artifact@v4 with: - name: coverage-${{ matrix.os }} - path: .coverage.* + name: coverage + path: .coverage retention-days: 1 include-hidden-files: true @@ -76,12 +72,9 @@ jobs: - name: Download coverage data uses: actions/download-artifact@v4 with: - pattern: coverage-* + pattern: coverage merge-multiple: true - - name: Combine coverage data - run: coverage combine .coverage.* - - name: Display coverage report run: coverage report -m -- cgit v1.2.3