diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e1b900f --- /dev/null +++ b/.dockerignore @@ -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 \ No newline at end of file diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml new file mode 100644 index 0000000..5a3b72c --- /dev/null +++ b/.github/workflows/packages.yml @@ -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}} + + - 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 }}" + echo " docker pull ${{ env.IMAGE }}:latest" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2733d54 --- /dev/null +++ b/Dockerfile @@ -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 +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"] \ No newline at end of file diff --git a/README.md b/README.md index 6b742c0..1865cbe 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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-`). The image runs +the local algorithm synthesizer by default; override with any `python -m` command. + ## Documentation Full docs: **https://dsk-dev-ai.github.io/algorithm-discovery-engine/**