From aab02f874feab6e78b0957dfc81b61aa4558b37f Mon Sep 17 00:00:00 2001 From: badrogger Date: Wed, 19 Aug 2026 19:33:53 +0100 Subject: [PATCH 1/2] Switch to ubuntu 24.04 --- .github/workflows/publish.yml | 4 +++- .github/workflows/test.yml | 7 ++++-- Dockerfile | 41 +++++++++++++++++++++++++++-------- 3 files changed, 40 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index dd86ba23..5c85547e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,5 @@ +# ABOUTME: Builds node-cli binaries and publishes merged release pull requests. +# ABOUTME: Produces release artifacts in an Ubuntu 24.04 build environment. name: Build and publish on: @@ -13,7 +15,7 @@ jobs: build_and_release: if: github.event.pull_request.merged name: Build and create release - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 permissions: contents: write steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f589d47..fb6ed4d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,11 @@ +# ABOUTME: Runs linting, binary builds, and tests for node-cli. +# ABOUTME: Verifies the project with Python 3.13 on Ubuntu 24.04. name: Test on: [push] jobs: test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: python-version: ['3.13'] @@ -38,6 +40,8 @@ jobs: run: | uv venv uv pip install -e ".[dev]" + site_packages=$(uv run python -c 'import site; print(site.getsitepackages()[0])') + echo /usr/lib/python3/dist-packages > "$site_packages/ubuntu-system-packages.pth" - name: Generate info run: bash ./scripts/generate_info.sh 1.0.0 my-branch skale @@ -77,7 +81,6 @@ jobs: - name: Run tests run: | - export PYTHONPATH=${PYTHONPATH}:/usr/lib/python3/dist-packages/ uv run bash ./scripts/run_tests.sh - name: Run nftables tests diff --git a/Dockerfile b/Dockerfile index 7fc37545..690b064c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,55 @@ -FROM python:3.13-slim-bookworm AS builder +# ABOUTME: Defines the Ubuntu 24.04 environment used to build node-cli binaries. +# ABOUTME: Installs Python 3.13 dependencies and required Ubuntu system packages. +FROM ubuntu:24.04 AS builder + +ARG PYTHON_VERSION=3.13 + +ENV DEBIAN_FRONTEND=noninteractive +ENV UV_PYTHON_INSTALL_DIR=/opt/python COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv +RUN apt-get update && \ + apt-get install -y --no-install-recommends ca-certificates && \ + rm -rf /var/lib/apt/lists/* + WORKDIR /app COPY pyproject.toml ./ -RUN uv pip install --system --no-cache ".[dev]" +RUN uv python install "$PYTHON_VERSION" && \ + uv venv --python "$PYTHON_VERSION" /opt/venv && \ + uv pip install --python /opt/venv --no-cache ".[dev]" -FROM python:3.13-slim-bookworm +FROM ubuntu:24.04 + +ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y --no-install-recommends \ + binutils \ + ca-certificates \ git \ iptables \ + kmod \ nftables \ + patchelf \ python3-nftables \ - kmod \ - wget \ - binutils && \ + wget && \ rm -rf /var/lib/apt/lists/* WORKDIR /app -COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages -COPY --from=builder /usr/local/bin /usr/local/bin +COPY --from=builder /opt/python /opt/python +COPY --from=builder /opt/venv /opt/venv + +RUN printf '%s\n' '/usr/lib/python3/dist-packages' \ + > /opt/venv/lib/python3.13/site-packages/ubuntu-system-packages.pth COPY . . -ENV PYTHONPATH="/app:/usr/lib/python3/dist-packages" +RUN patchelf --remove-needed libSegFault.so datafiles/skaled-ssl-test + +ENV PATH="/opt/venv/bin:$PATH" +ENV PYTHONPATH="/app" ENV COLUMNS=80 From b57900017fbd608aa787e320e43fee1a087bd9c1 Mon Sep 17 00:00:00 2001 From: badrogger Date: Wed, 19 Aug 2026 19:41:19 +0100 Subject: [PATCH 2/2] Small improvements --- .github/workflows/publish.yml | 2 -- .github/workflows/test.yml | 2 -- Dockerfile | 2 -- 3 files changed, 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5c85547e..ea6312e4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,3 @@ -# ABOUTME: Builds node-cli binaries and publishes merged release pull requests. -# ABOUTME: Produces release artifacts in an Ubuntu 24.04 build environment. name: Build and publish on: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb6ed4d4..236245a6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,3 @@ -# ABOUTME: Runs linting, binary builds, and tests for node-cli. -# ABOUTME: Verifies the project with Python 3.13 on Ubuntu 24.04. name: Test on: [push] diff --git a/Dockerfile b/Dockerfile index 690b064c..835de85b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,3 @@ -# ABOUTME: Defines the Ubuntu 24.04 environment used to build node-cli binaries. -# ABOUTME: Installs Python 3.13 dependencies and required Ubuntu system packages. FROM ubuntu:24.04 AS builder ARG PYTHON_VERSION=3.13