Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push]

jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ['3.13']
Expand Down Expand Up @@ -38,6 +38,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
Expand Down Expand Up @@ -77,7 +79,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
Expand Down
39 changes: 30 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
FROM python:3.13-slim-bookworm AS builder
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
Loading