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
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.git
.github
site
dist
build
languages/java/out
languages/cpp/build
languages/rust/target
catalog/discoveries
**/__pycache__
**/__pycache__/
*.py[cod]
*.egg-info
.mypy_cache
.ruff_cache
.pytest_cache
uv.lock
Dockerfile
.dockerignore
58 changes: 58 additions & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Packages

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
packages: write

env:
IMAGE: ghcr.io/${{ github.repository }}

jobs:
publish:
name: Build & publish container image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE }}
tags: |
type=semver,pattern={{version}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): A published release tagged v1.0.0 produces the image tag 1.0.0, because the {{version}} pattern strips the v prefix. The documented and reported v1.0.0 tag is therefore not published, so the README's release pull command fails.

Triggers: When the workflow is triggered by a release whose tag uses the documented vX.Y.Z format.

Suggested fix: Use a semver pattern that preserves the prefix, such as pattern=v{{version}}, or document and report the unprefixed tag.

type=sha
type=raw,value=latest,enable={{is_default_branch}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The latest tag is disabled for release events because is_default_branch is false when the workflow runs on a release tag. Consequently, the normal release publication does not produce the latest tag promised by the README.

Triggers: When the workflow is triggered by release.published, as opposed to a manual dispatch on the default branch.

Suggested fix: Enable the raw latest tag for release events as well, or use an explicit condition that recognizes the release trigger.


- name: Build and push
uses: docker/buildx-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Report image
run: |
echo "Published:"
echo " docker pull ${{ env.IMAGE }}:${{ github.ref_name }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The report prints a pull command using github.ref_name even when the workflow is manually dispatched. On manual dispatch this is the selected branch name, but metadata-action does not create a corresponding branch tag, so the printed image reference does not exist.

Triggers: When the workflow is manually dispatched from a branch, including the default branch where only latest and sha-* are generated.

Suggested fix: Report only tags that are guaranteed to be generated, or select the release/version tag and generated metadata dynamically.

echo " docker pull ${{ env.IMAGE }}:latest"
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.12-slim

ARG VERSION=1.0.0

LABEL org.opencontainers.image.source=https://github.com/dsk-dev-ai/algorithm-discovery-engine
LABEL org.opencontainers.image.version=$VERSION
LABEL org.opencontainers.image.revision=$VERSION
Comment on lines +3 to +7

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: The OCI revision label is populated with the static package version via $VERSION, so every build reports 1.0.0 as its source revision instead of the commit that produced the image. Builds from later releases or different commits therefore carry incorrect provenance metadata.

Triggers: When the image is built from any commit whose revision is not the package version.

Suggested fix: Pass the commit SHA as a build argument and set org.opencontainers.image.revision from that argument, while keeping the package version in the version label.

Suggested change
ARG VERSION=1.0.0
LABEL org.opencontainers.image.source=https://github.com/dsk-dev-ai/algorithm-discovery-engine
LABEL org.opencontainers.image.version=$VERSION
LABEL org.opencontainers.image.revision=$VERSION
ARG VERSION=1.0.0
ARG COMMIT_SHA
LABEL org.opencontainers.image.source=https://github.com/dsk-dev-ai/algorithm-discovery-engine
LABEL org.opencontainers.image.version=$VERSION
LABEL org.opencontainers.image.revision=$COMMIT_SHA

LABEL org.opencontainers.image.description="Multi-language algorithms & data structures engine with a local algorithm synthesizer (Python tier)."
LABEL org.opencontainers.image.licenses=MIT

WORKDIR /app

COPY . /app

RUN pip install --no-cache-dir . && \
python -m compileall -q src && \
rm -rf .git

ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app/src

ENTRYPOINT ["python", "-m", "synth", "discover"]
CMD ["--smoke"]
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![Last commit](https://img.shields.io/github/last-commit/dsk-dev-ai/algorithm-discovery-engine?style=flat-square&logo=git&logoColor=white)]()
[![Docs](https://img.shields.io/badge/docs-live-blue?style=flat-square&logo=materialformkdocs&logoColor=white)](https://dsk-dev-ai.github.io/algorithm-discovery-engine/)
[![GHCR](https://img.shields.io/badge/container-ghcr.io-lightgrey?style=flat-square&logo=docker&logoColor=white)](https://github.com/dsk-dev-ai/algorithm-discovery-engine/pkgs/container/algorithm-discovery-engine)
[![GUI](https://img.shields.io/badge/available-gui_tkinter-blueviolet?style=flat-square)](#desktop-gui)
[![Sponsor](https://img.shields.io/badge/%E2%9D%A4%EF%B8%8F-Sponsor-red?style=flat-square&logo=githubsponsors&logoColor=white)](https://github.com/sponsors/dsk-dev-ai)

Expand Down Expand Up @@ -179,6 +180,18 @@ ade-gui # if installed with pip/uv
Core logic lives in `gui/core.py` and is tested headlessly in CI (`-p gui` mypy
+ `pytest -q tests/test_gui.py`).

## Container image

Prebuilt on **GitHub Packages** (amd64 + arm64) — no install needed:

```sh
docker pull ghcr.io/dsk-dev-ai/algorithm-discovery-engine:v1.0.0
docker run --rm ghcr.io/dsk-dev-ai/algorithm-discovery-engine:v1.0.0 --smoke
```

Tags: `latest`, per-version (`v1.0.0`), and per-commit (`sha-<hash>`). The image runs
the local algorithm synthesizer by default; override with any `python -m` command.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The image has a fixed ENTRYPOINT of python -m synth discover, so arguments in docker run IMAGE python -m ... are appended to that command rather than replacing it. The documented claim that any python -m command can override the default is false, and such a command is parsed as invalid discovery arguments.

Triggers: When a user follows the README's instruction to override the image with another python -m command.

Suggested fix: Document docker run --entrypoint python IMAGE -m ..., or change the image interface to use a wrapper that supports command replacement.

Suggested change
the local algorithm synthesizer by default; override with any `python -m` command.
the local algorithm synthesizer by default; to run pattern discovery instead, use `docker run --rm --entrypoint python ghcr.io/dsk-dev-ai/algorithm-discovery-engine:v1.0.0 -m algo_discovery 1 4 9 16`.


## Documentation

Full docs: **https://dsk-dev-ai.github.io/algorithm-discovery-engine/**
Expand Down
Loading