From 390871e683656234cc7135ba71e65c266a449145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20K=C3=B6sters?= <17874544+MKoesters@users.noreply.github.com> Date: Sun, 15 Mar 2026 19:59:37 +0100 Subject: [PATCH 1/2] Add CompressToZip Docker and tests --- compresstozip/Dockerfile | 27 ++++++++++ compresstozip/tests/test_compresstozip.py | 63 +++++++++++++++++++++++ package-information.json | 7 +++ 3 files changed, 97 insertions(+) create mode 100644 compresstozip/Dockerfile create mode 100644 compresstozip/tests/test_compresstozip.py diff --git a/compresstozip/Dockerfile b/compresstozip/Dockerfile new file mode 100644 index 0000000..cddb91f --- /dev/null +++ b/compresstozip/Dockerfile @@ -0,0 +1,27 @@ +ARG BASEIMAGE + +FROM ${BASEIMAGE} + +ARG URGAP + +RUN addgroup --system nonroot && \ + adduser --system \ + --ingroup nonroot \ + --home /home/nonroot \ + nonroot + +COPY ${URGAP} /home/nonroot + +ENV HOME=/home/nonroot +ENV VENV_PATH=$HOME/venv +ENV PATH=$VENV_PATH/bin:$PATH +USER nonroot + +RUN python -m venv "$VENV_PATH" --system-site-packages + +RUN pip install uv +RUN uv pip install /home/nonroot/${URGAP}["all"] + +WORKDIR $HOME + +ENTRYPOINT ["uctl", "run", "upi-server", "-n", "CompressToZip:1.0.0", "-n", "CompressToZip:latest"] diff --git a/compresstozip/tests/test_compresstozip.py b/compresstozip/tests/test_compresstozip.py new file mode 100644 index 0000000..516bc5d --- /dev/null +++ b/compresstozip/tests/test_compresstozip.py @@ -0,0 +1,63 @@ +"""Basic tests for compresstozip container.""" + + +import subprocess + + +def test_python_available(): + """Test that Python is available and runs.""" + result = subprocess.run( + ["python", "--version"], + capture_output=True, + text=True, + ) + assert result.returncode == 0 + assert "Python" in result.stdout + + +def test_urgap_installed(): + """Test that urgap package is installed.""" + result = subprocess.run( + ["pip3", "show", "urgap"], + capture_output=True, + text=True, + ) + assert result.returncode == 0 + assert "Name: urgap" in result.stdout + + +def test_compresstozip_nodes_registered(): + """Test that CompressToZip nodes are discovered by urgap.""" + result = subprocess.run( + ["python", "-c", + "import urgap; " + "lookup = urgap.instances.unode_manager.wrapper_lookup; " + "print(all(node in lookup for node in [" + "'CompressToZip:1.0.0', 'CompressToZip:latest']))"], + capture_output=True, + text=True, + ) + assert result.returncode == 0 + assert "True" in result.stdout + + +def test_uctl_available(): + """Test that uctl command is available.""" + result = subprocess.run( + ["uctl", "--help"], + capture_output=True, + text=True, + ) + assert result.returncode == 0 + assert "uctl" in result.stdout.lower() or "urgap" in result.stdout.lower() + + +def test_uv_available(): + """Test that uv tool is available.""" + result = subprocess.run( + ["uv", "--version"], + capture_output=True, + text=True, + ) + assert result.returncode == 0 + assert "uv" in result.stdout.lower() diff --git a/package-information.json b/package-information.json index 84784c6..b9b488a 100644 --- a/package-information.json +++ b/package-information.json @@ -14,6 +14,13 @@ "base_image": "python:3.13-slim-trixie", "gh_url": "urgap/urgap.git", "separate_venv": false + }, + { + "name": "compresstozip", + "versions": ["1.0.0"], + "base_image": "python:3.10", + "gh_url": "urgap/urgap.git", + "separate_venv": false } ] } From 4beab8bd0468b00f3dbecd3c9bced976f51d4232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20K=C3=B6sters?= <17874544+MKoesters@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:07:01 +0100 Subject: [PATCH 2/2] fix Dockerfile to install wheel via pip --- compresstozip/Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compresstozip/Dockerfile b/compresstozip/Dockerfile index cddb91f..d54600f 100644 --- a/compresstozip/Dockerfile +++ b/compresstozip/Dockerfile @@ -2,16 +2,12 @@ ARG BASEIMAGE FROM ${BASEIMAGE} -ARG URGAP - RUN addgroup --system nonroot && \ adduser --system \ --ingroup nonroot \ --home /home/nonroot \ nonroot -COPY ${URGAP} /home/nonroot - ENV HOME=/home/nonroot ENV VENV_PATH=$HOME/venv ENV PATH=$VENV_PATH/bin:$PATH @@ -20,7 +16,7 @@ USER nonroot RUN python -m venv "$VENV_PATH" --system-site-packages RUN pip install uv -RUN uv pip install /home/nonroot/${URGAP}["all"] +RUN uv pip install urgap["all"] WORKDIR $HOME