-
Notifications
You must be signed in to change notification settings - Fork 0
Container package: publish engine image to GitHub Packages (GHCR) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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}} | ||
| type=sha | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): The Triggers: When the workflow is triggered by Suggested fix: Enable the raw |
||
|
|
||
| - 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 }}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: The report prints a pull command using Triggers: When the workflow is manually dispatched from a branch, including the default branch where only 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" | ||
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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
Suggested change
|
||||||||||||||||||||||||
| 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"] | ||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |||||
| [](https://opensource.org/licenses/MIT) | ||||||
| []() | ||||||
| [](https://dsk-dev-ai.github.io/algorithm-discovery-engine/) | ||||||
| [](https://github.com/dsk-dev-ai/algorithm-discovery-engine/pkgs/container/algorithm-discovery-engine) | ||||||
| [](#desktop-gui) | ||||||
| [](https://github.com/sponsors/dsk-dev-ai) | ||||||
|
|
||||||
|
|
@@ -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. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: The image has a fixed Triggers: When a user follows the README's instruction to override the image with another Suggested fix: Document
Suggested change
|
||||||
|
|
||||||
| ## Documentation | ||||||
|
|
||||||
| Full docs: **https://dsk-dev-ai.github.io/algorithm-discovery-engine/** | ||||||
|
|
||||||
There was a problem hiding this comment.
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.0produces the image tag1.0.0, because the{{version}}pattern strips thevprefix. The documented and reportedv1.0.0tag 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.Zformat.Suggested fix: Use a semver pattern that preserves the prefix, such as
pattern=v{{version}}, or document and report the unprefixed tag.