Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.
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
24 changes: 12 additions & 12 deletions .github/workflows/python-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry
poetry install --with test --no-root
python-version-file: ".python-version"
- name: Install test dependencies
run: uv sync --group test
- name: Test with pytest - ${{ matrix.python-version }}
run: |
poetry run pytest -s --cov=. --cov-branch --cov-report=xml -v
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
run: uv run pytest -s --cov=. --cov-branch --cov-report=xml -v
# Please uncomment this if your organization uses Codecov test coverage!
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v5
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
27 changes: 13 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selectio

# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
software-properties-common \
python3-pip \
python3-poetry \
Expand All @@ -26,12 +27,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
plaso-tools \
&& rm -rf /var/lib/apt/lists/*

# Configure poetry
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

# Configure debugging
ARG OPENRELIK_PYDEBUG
ENV OPENRELIK_PYDEBUG=${OPENRELIK_PYDEBUG:-0}
Expand All @@ -41,19 +36,23 @@ ENV OPENRELIK_PYDEBUG_PORT=${OPENRELIK_PYDEBUG_PORT:-5678}
# Set working directory
WORKDIR /openrelik

# Enable system-site-packages
RUN poetry config virtualenvs.options.system-site-packages true
# Install the latest uv binaries
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Copy poetry toml and uv.lock
COPY uv.lock pyproject.toml .

# Copy poetry toml and install dependencies
COPY ./pyproject.toml ./poetry.lock ./
RUN poetry install --no-interaction --no-ansi
# Install the project's dependencies using the lockfile and settings
RUN uv sync --locked --no-install-project --no-dev

# Copy all worker files
COPY . ./

# Install the worker and set environment to use the correct python interpreter.
RUN poetry install && rm -rf $POETRY_CACHE_DIR
ENV VIRTUAL_ENV=/app/.venv PATH="/openrelik/.venv/bin:$PATH"
# Installing separately from its dependencies allows optimal layer caching
RUN uv sync --locked --no-dev

# Set PATH to use the virtual environment
ENV PATH="/openrelik/.venv/bin:$PATH"

# Default command if not run from docker-compose (and command being overidden)
CMD ["celery", "--app=src.tasks", "worker", "--task-events", "--concurrency=1", "--loglevel=INFO"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@ openrelik-worker-extraction:
- ./data:/usr/share/openrelik/data
command: "celery --app=src.app worker --task-events --concurrency=4 --loglevel=INFO -Q openrelik-worker-extraction"
```

## Test
```
uv sync --group test
uv run pytest -s --cov=.
```
1,511 changes: 0 additions & 1,511 deletions poetry.lock

This file was deleted.

37 changes: 19 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
[tool.poetry]
name = "openrelik-worker-artifact-extraction"
[project]
authors = [
{name = "Ramses de Beer", email = "ramsesdebeer@gmail.com"},
]
requires-python = ">=3.11,<4.0"
dependencies = [
"celery[redis]<6.0.0,>=5.4.0",
"openrelik-worker-common<1.0.0,>=0.16.0",
"openrelik-common>=0.7.0,<1.0.0",
"debugpy>=1.8.7,<2.0.0",
]
name = "openrelik-worker-extraction"
version = "0.4.0"
description = "Extract forensic artifacts with image_export"
authors = ["Ramses de Beer <ramsesdebeer@gmail.com>"]
license = "Apache 2.0"
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = ">=3.11,<4.0"
celery = { extras = ["redis"], version = "^5.4.0" }
openrelik-common = "^0.7.0"
openrelik-worker-common = "^0.17.1"
debugpy = "^1.8.7"
[dependency-groups]
test = [
"pytest",
"pytest-cov<6.0.0,>=5.0.0",
]

[tool.poetry.group.test.dependencies]
pytest = "*"
pytest-cov = "^5.0.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.uv]
default-groups = []
Loading