From b08bc3b8aeff2911ad4304ecfe20fd96ecc0e004 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Wed, 28 Oct 2026 23:16:43 +0000 Subject: [PATCH] Publish docker --- .forgejo/workflows/docker.yml | 23 +++++++++++++++------ Dockerfile | 2 +- README.md | 25 ++++++++++++++--------- docs/examples/scibert/additional-files.md | 5 ++++- docs/how-to-guides/use-service.md | 4 ++-- docs/index.md | 12 +++++------ mkdocs.yaml | 4 ++-- pyproject.toml | 2 +- 8 files changed, 47 insertions(+), 30 deletions(-) diff --git a/.forgejo/workflows/docker.yml b/.forgejo/workflows/docker.yml index 2ff9932..9870dbd 100644 --- a/.forgejo/workflows/docker.yml +++ b/.forgejo/workflows/docker.yml @@ -1,10 +1,13 @@ -name: Publish on DockerHub +name: Publish container image on Forgejo on: push: - tags: ['*'] + tags: ["*"] workflow_dispatch: +env: + REGISTRY: git.schmelczer.dev + jobs: publish: runs-on: docker @@ -35,17 +38,25 @@ jobs: - name: Set up Docker Buildx uses: https://github.com/docker/setup-buildx-action@v3 - - name: Log in to Docker Hub + - name: Log in to the Forgejo container registry uses: https://github.com/docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + registry: ${{ env.REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.DOCKER_PACKAGE_TOKEN }} - name: Extract metadata for the Docker image id: meta uses: https://github.com/docker/metadata-action@v5 with: - images: schmelczera/great-ai + images: ${{ env.REGISTRY }}/${{ github.repository }} + tags: | + type=ref,event=branch + type=ref,event=tag + type=semver,pattern={{version}} + type=raw,value=latest,enable={{is_default_branch}} + labels: | + org.opencontainers.image.source=https://git.schmelczer.dev/${{ github.repository }} - name: Build and push uses: https://github.com/docker/build-push-action@v6 diff --git a/Dockerfile b/Dockerfile index 61335a2..4b4845e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv LABEL org.opencontainers.image.title="GreatAI package wrapper image" LABEL org.opencontainers.image.vendor="ScoutinScience B.V." LABEL org.opencontainers.image.authors="andras@schmelczer.dev" -LABEL org.opencontainers.image.source="https://github.com/schmelczer/great-ai" +LABEL org.opencontainers.image.source="https://git.schmelczer.dev/andras/great-ai" SHELL ["/bin/bash", "-c"] diff --git a/README.md b/README.md index 9991559..c29da19 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,10 @@ > Prepare your prototype AI code for production deployment. -[![PyPI version](https://badge.fury.io/py/great-ai.svg)](https://badge.fury.io/py/great-ai) -[![Downloads](https://pepy.tech/badge/great-ai/month)](https://pepy.tech/project/great-ai) -[![Docker Pulls](https://img.shields.io/docker/pulls/schmelczera/great-ai)](https://hub.docker.com/repository/docker/schmelczera/great-ai) -[![Check](https://git.schmelczer.dev/andras/great-ai/badges/workflows/test.yml/badge.svg?branch=main)](https://git.schmelczer.dev/andras/great-ai/actions?workflow=test.yml) -[![Sonar line coverage](https://sonar.scoutinscience.com/api/project_badges/measure?project=great-ai&metric=coverage)](https://sonar.scoutinscience.com/dashboard?id=great-ai) -[![Sonar LoC](https://sonar.scoutinscience.com/api/project_badges/measure?project=great-ai&metric=ncloc)](https://sonar.scoutinscience.com/dashboard?id=great-ai) +[![PyPI version](https://img.shields.io/pypi/v/great-ai)](https://pypi.org/project/great-ai/) +[![Downloads](https://static.pepy.tech/badge/great-ai/month)](https://pepy.tech/projects/great-ai) +[![Container image](https://img.shields.io/badge/container-Forgejo-orange)](https://git.schmelczer.dev/andras/great-ai/packages) +[![Check](https://git.schmelczer.dev/andras/great-ai/badges/workflows/test.yml/badge.svg?branch=main&label=Check)](https://git.schmelczer.dev/andras/great-ai/actions?workflow=test.yml) Applying AI is becoming increasingly more accessible, but many case studies have shown that these applications are often deployed poorly. This may lead to suboptimal performance and to introducing unintended biases. GreatAI helps prepare prototype AI code for deployment with tracing, model versioning, and API scaffolding. These engineering features support oversight; they do not establish a model's accuracy, fairness, or trustworthiness, which require evaluation for the intended use case. @@ -72,10 +70,10 @@ With uv installed and your virtual environment active: uv pip install great-ai ``` -## Find `great-ai` on [DockerHub](https://hub.docker.com/repository/docker/schmelczera/great-ai) +## Find `great-ai` on [Forgejo](https://git.schmelczer.dev/andras/great-ai/packages) ```sh -docker run -p6060:6060 schmelczera/great-ai +docker run -p6060:6060 git.schmelczer.dev/andras/great-ai:latest ``` ## Contribute @@ -119,5 +117,12 @@ scripts/release.sh 0.2.0 ``` This bumps the version, builds, commits, tags, and pushes `main` and the tag -atomically. The tag triggers the PyPI and DockerHub workflows, which require -`PYPI_TOKEN`, `DOCKER_USERNAME`, and `DOCKER_PASSWORD` in Forgejo repository secrets. +atomically. The tag triggers the PyPI and Forgejo container publishing workflows, +which require `PYPI_TOKEN` and `DOCKER_PACKAGE_TOKEN` in Forgejo Actions secrets. +`DOCKER_PACKAGE_TOKEN` must belong to the repository owner and have +`write:package` permission. + +Container images are published only to `git.schmelczer.dev/andras/great-ai` for +Linux AMD64 and ARM64. Stable release tags publish both `vX.Y.Z` and `X.Y.Z`, +and update `latest`. Running the container workflow manually on `main` also +updates `latest`. diff --git a/docs/examples/scibert/additional-files.md b/docs/examples/scibert/additional-files.md index 852cd2d..720204e 100644 --- a/docs/examples/scibert/additional-files.md +++ b/docs/examples/scibert/additional-files.md @@ -38,7 +38,7 @@ numpy==1.23.0 ```Dockerfile title="Dockerfile" # syntax=docker/dockerfile:1 -FROM schmelczera/great-ai:v0.1.6 +FROM git.schmelczer.dev/andras/great-ai:latest COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv @@ -55,6 +55,9 @@ CMD ["deploy.ipynb"] > This is used by the CD pipeline to create the production deployment of the service. +For reproducible deployments, replace `latest` with a release tag from the +[Forgejo container registry](https://git.schmelczer.dev/andras/great-ai/packages). + ## .dockerignore ```dockerignore title=".dockerignore" diff --git a/docs/how-to-guides/use-service.md b/docs/how-to-guides/use-service.md index 60592e9..8277302 100644 --- a/docs/how-to-guides/use-service.md +++ b/docs/how-to-guides/use-service.md @@ -107,7 +107,7 @@ Run the notebook directly in a container or create a service for it using your f ```sh docker run -p 6060:6060 --volume `pwd`:/app --rm \ - schmelczera/great-ai deploy.ipynb + git.schmelczer.dev/andras/great-ai:latest deploy.ipynb ``` > You can replace ``pwd`` with the path to your code's folder. @@ -119,7 +119,7 @@ To this end, you can also create a custom Docker image. It is especially useful ```Dockerfile # syntax=docker/dockerfile:1 -FROM schmelczera/great-ai:latest +FROM git.schmelczer.dev/andras/great-ai:latest COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv diff --git a/docs/index.md b/docs/index.md index 7bb6433..6eddb31 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,12 +3,10 @@ -[![PyPI version](https://badge.fury.io/py/great-ai.svg)](https://badge.fury.io/py/great-ai) -[![Downloads](https://pepy.tech/badge/great-ai/month)](https://pepy.tech/project/great-ai) -[![Docker Pulls](https://img.shields.io/docker/pulls/schmelczera/great-ai)](https://hub.docker.com/repository/docker/schmelczera/great-ai) -[![Check](https://git.schmelczer.dev/andras/great-ai/badges/workflows/test.yml/badge.svg?branch=main)](https://git.schmelczer.dev/andras/great-ai/actions?workflow=test.yml) -[![Sonar line coverage](https://sonar.scoutinscience.com/api/project_badges/measure?project=great-ai&metric=coverage)](https://sonar.scoutinscience.com/dashboard?id=great-ai) -[![Sonar LoC](https://sonar.scoutinscience.com/api/project_badges/measure?project=great-ai&metric=ncloc)](https://sonar.scoutinscience.com/dashboard?id=great-ai) +[![PyPI version](https://img.shields.io/pypi/v/great-ai)](https://pypi.org/project/great-ai/) +[![Downloads](https://static.pepy.tech/badge/great-ai/month)](https://pepy.tech/projects/great-ai) +[![Container image](https://img.shields.io/badge/container-Forgejo-orange)](https://git.schmelczer.dev/andras/great-ai/packages) +[![Check](https://git.schmelczer.dev/andras/great-ai/badges/workflows/test.yml/badge.svg?branch=main&label=Check)](https://git.schmelczer.dev/andras/great-ai/actions?workflow=test.yml) Applying AI is becoming increasingly easier, but many case studies have shown that these applications are often deployed poorly. This may lead to suboptimal performance and to introducing [unintended biases](https://en.wikipedia.org/wiki/Weapons_of_Math_Destruction){ target=_blank }. GreatAI helps ==prepare prototype AI code for deployment with tracing, model versioning, and API scaffolding==. These engineering features support oversight; they do not establish a model's accuracy, fairness, or trustworthiness, which require evaluation for the intended use case. @@ -112,7 +110,7 @@ However, research indicates that professionals rarely use them. This may be due
[:fontawesome-brands-python: Find it on PyPI](https://pypi.org/project/great-ai){ .md-button .md-button--primary } -[:fontawesome-brands-docker: Find it on DockerHub](https://hub.docker.com/repository/docker/schmelczera/great-ai){ .md-button .md-button--primary } +[:fontawesome-brands-docker: Find the container image on Forgejo](https://git.schmelczer.dev/andras/great-ai/packages){ .md-button .md-button--primary } [:fontawesome-solid-laptop-code: Check out the tutorial](https://great-ai.schmelczer.dev/tutorial){ .md-button .md-button--primary }
diff --git a/mkdocs.yaml b/mkdocs.yaml index f0fc58b..f19982a 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -19,8 +19,8 @@ extra: link: https://github.com/schmelczer/great-ai name: great-ai on Github - icon: fontawesome/brands/docker - link: https://hub.docker.com/repository/docker/schmelczera/great-ai - name: great-ai on DockerHub + link: https://git.schmelczer.dev/andras/great-ai/packages + name: great-ai container image on Forgejo - icon: fontawesome/brands/python link: https://pypi.org/project/great-ai name: great-ai on PyPI diff --git a/pyproject.toml b/pyproject.toml index 9f6a2fd..b15bb95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,7 @@ doctest_optionflags = ["ELLIPSIS"] [project.urls] Documentation = "https://great-ai.schmelczer.dev" GitHub = "https://github.com/schmelczer/great-ai" -DockerHub = "https://hub.docker.com/repository/docker/schmelczera/great-ai" +"Container image" = "https://git.schmelczer.dev/andras/great-ai/packages" [project.scripts] great_ai = "great_ai.__main__:main"