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
72 changes: 72 additions & 0 deletions .github/workflows/server-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish Server Image

on:
pull_request:
paths:
- .github/workflows/server-image.yml
- python/**
push:
tags:
- v*.*.*
workflow_dispatch:

env:
REGISTRY_IMAGE: ghcr.io/chenglabresearch/ouroboros-server

jobs:
server-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '2.1.3'

- name: Install Python Dependencies
working-directory: ./python
run: poetry install

- name: Build Wheel
working-directory: ./python
run: poetry build

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

- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: |
type=ref,event=tag
type=sha,prefix=sha-

- name: Build Server Image
uses: docker/build-push-action@v6
with:
context: ./python
file: ./python/Dockerfile-prod
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
28 changes: 28 additions & 0 deletions documentation/docs/development/registry-server-images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Registry Server Images

Ouroboros can publish the Python server Docker image to GHCR during release-tag workflows. This avoids turning every production startup into a local image build once release packaging is ready to reference immutable image tags.

## Published Image

The `Publish Server Image` workflow builds the Python wheel, builds `python/Dockerfile-prod`, and publishes:

- `ghcr.io/chenglabresearch/ouroboros-server:<release-tag>` for release tags such as `v1.4.0`
- `ghcr.io/chenglabresearch/ouroboros-server:sha-<commit>` for the exact source revision

Both tags are produced from the same wheel artifact that the Dockerfile installs.

## Release Compose Usage

Release packaging should prefer an immutable image tag when the corresponding image exists:

```yaml
services:
ouroboros-server:
image: ghcr.io/chenglabresearch/ouroboros-server:v1.4.0
```

Keep the bundled wheel and `Dockerfile-prod` path available as a fallback until installers consistently ship a release-specific compose file. Development compose files should keep building locally from source so local edits do not depend on registry state.

## Manual Runs

The workflow also supports `workflow_dispatch` for validating or re-publishing the image from the current branch. Release consumers should still use tag or SHA image references rather than mutable names.
1 change: 1 addition & 0 deletions documentation/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ nav:
- Python: https://github.com/ChengLabResearch/ouroboros/blob/main/python/README.md
- Plugins: https://github.com/ChengLabResearch/ouroboros/blob/main/plugins/plugin-template/README.md
- Docker Builds: 'development/docker-builds.md'
- Registry Server Images: 'development/registry-server-images.md'
- Releases: 'https://github.com/ChengLabResearch/ouroboros/releases'
- Repository: https://github.com/ChengLabResearch/ouroboros

Expand Down
Loading