From aab02f874feab6e78b0957dfc81b61aa4558b37f Mon Sep 17 00:00:00 2001 From: badrogger Date: Wed, 19 Aug 2026 19:33:53 +0100 Subject: [PATCH 1/5] 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/5] 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 From e74e863d6bc2ab68c01effe260cc157325f8a4d6 Mon Sep 17 00:00:00 2001 From: badrogger Date: Mon, 28 Sep 2026 16:00:25 +0100 Subject: [PATCH 3/5] Bump version to 3.3.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b2c09ef8..1cfb0af8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "node-cli" -version = "3.2.0" +version = "3.3.2" description = "Node CLI tools" readme = "README.md" requires-python = ">=3.13" From e27dfcfd66692bcd8a9d0c0d333f5e5541e3a651 Mon Sep 17 00:00:00 2001 From: badrogger Date: Thu, 8 Oct 2026 19:00:11 +0100 Subject: [PATCH 4/5] Small improvements --- node_cli/cli/passive_node.py | 2 +- node_cli/core/checks.py | 8 +++++--- tests/cli/health_test.py | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/node_cli/cli/passive_node.py b/node_cli/cli/passive_node.py index f86ba99b..b1ccf086 100644 --- a/node_cli/cli/passive_node.py +++ b/node_cli/cli/passive_node.py @@ -83,4 +83,4 @@ def _update_passive(env_file): @click.option('--prune', is_flag=True, help='Prune docker system.') @streamed_cmd def cleanup_node(prune): - cleanup_skale(node_mode=NodeMode.PASSIVE, prune=prune) \ No newline at end of file + cleanup_skale(node_mode=NodeMode.PASSIVE, prune=prune) diff --git a/node_cli/core/checks.py b/node_cli/core/checks.py index 0424577f..ecc613fb 100644 --- a/node_cli/core/checks.py +++ b/node_cli/core/checks.py @@ -166,9 +166,11 @@ def get_checks(self, check_type: CheckType = CheckType.ALL) -> FuncList: methods = inspect.getmembers( type(self), - predicate=lambda m: inspect.isfunction(m) - and getattr(m, '_check_type', None) in allowed_types - and self.requirements.get(m.__name__, None) != 'disabled', + predicate=lambda m: ( + inspect.isfunction(m) + and getattr(m, '_check_type', None) in allowed_types + and self.requirements.get(m.__name__, None) != 'disabled' + ), ) return [functools.partial(m[1], self) for m in methods] diff --git a/tests/cli/health_test.py b/tests/cli/health_test.py index 1d7b58db..7b75c02c 100644 --- a/tests/cli/health_test.py +++ b/tests/cli/health_test.py @@ -81,7 +81,9 @@ def test_checks(): == 'sChain Name Config directory DKG Config file Volume Container IMA Firewall RPC Blocks\n-------------------------------------------------------------------------------------------------------------\ntest_schain True False False False False False False False False \n' # noqa ) - result = run_command_mock('node_cli.utils.helper.api_session.get', resp_mock, schains, ['--json']) + result = run_command_mock( + 'node_cli.utils.helper.api_session.get', resp_mock, schains, ['--json'] + ) assert result.exit_code == 0 assert ( From 7d4551293fe7e415b4a0c022a69f1373f239f8a0 Mon Sep 17 00:00:00 2001 From: badrogger Date: Thu, 8 Oct 2026 19:07:55 +0100 Subject: [PATCH 5/5] Update actions to use python3.14 --- .github/workflows/publish.yml | 4 ++-- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e306568f..6239d0bd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,10 +22,10 @@ jobs: with: submodules: true - - name: Set up Python 3.13 + - name: Set up Python 3.14 uses: actions/setup-python@v5 with: - python-version: 3.13 + python-version: '3.14' - name: Calculate version id: versioning diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 236245a6..6c9935f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - python-version: ['3.13'] + python-version: ['3.14'] steps: - uses: actions/checkout@v4 with: