Skip to content
Merged
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
23 changes: 23 additions & 0 deletions compresstozip/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ARG BASEIMAGE

FROM ${BASEIMAGE}

RUN addgroup --system nonroot && \
adduser --system \
--ingroup nonroot \
--home /home/nonroot \
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 urgap["all"]

WORKDIR $HOME

ENTRYPOINT ["uctl", "run", "upi-server", "-n", "CompressToZip:1.0.0", "-n", "CompressToZip:latest"]
63 changes: 63 additions & 0 deletions compresstozip/tests/test_compresstozip.py
Original file line number Diff line number Diff line change
@@ -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()
7 changes: 7 additions & 0 deletions package-information.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
Loading