Skip to content

Commit 31d7fd3

Browse files
committed
Migrate container deployment to GHCR and remove obsolete workflows
- Remove obsolete Quarto publish workflow (docs now use Sphinx/MyST) - Fix docker-image.yml: point to container/Containerfile, use GHCR with built-in GITHUB_TOKEN (no external secrets needed) - Remove uw3-release-candidate from binder-image.yml triggers - Update all documentation and scripts to reference GHCR instead of DockerHub for both container types - Update container/README.md with pull/run instructions for GHCR Underworld development team with AI support from Claude Code
1 parent 1fbc8d4 commit 31d7fd3

File tree

8 files changed

+95
-94
lines changed

8 files changed

+95
-94
lines changed

.github/workflows/binder-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ name: "GHCR: Binder Base Image"
44
# The image is used by mybinder.org via the uw3-binder-launcher repository
55
#
66
# This is separate from docker-image.yml which builds command-line Docker
7-
# images for DockerHub.
7+
# images (also on GHCR, different image name).
88

99
on:
1010
push:
11-
branches: [main, uw3-release-candidate, development]
11+
branches: [main, development]
1212
paths:
1313
# Only rebuild when these files change (Cython/dependencies require rebuild)
1414
- 'container/Dockerfile.base.optimized'
Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,61 @@
1-
name: "DockerHub: Command-Line Container"
1+
name: "GHCR: Command-Line Container"
2+
3+
# Builds the Underworld3 command-line Docker image and pushes to GHCR.
4+
# Uses container/Containerfile (micromamba-based image for local use).
5+
#
6+
# This is separate from binder-image.yml which builds Binder-ready images
7+
# optimized for mybinder.org.
28

39
on:
410
push:
5-
branches:
6-
- development
11+
branches: [main, development]
12+
paths:
13+
# Only rebuild when these files change
14+
- 'container/Containerfile'
15+
- 'environment.yaml'
16+
- 'src/**/*.pyx'
17+
- 'src/**/*.c'
18+
- 'setup.py'
19+
- 'pyproject.toml'
20+
workflow_dispatch:
21+
inputs:
22+
force_rebuild:
23+
description: 'Force full rebuild (no cache)'
24+
type: boolean
25+
default: false
726

827
jobs:
9-
push-to-dockerhub:
28+
build-and-push:
1029
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
32+
packages: write
1133

1234
steps:
1335
- name: Checkout repository
1436
uses: actions/checkout@v4
1537

16-
- name: Exact branch name
38+
- name: Set up Docker Buildx
39+
uses: docker/setup-buildx-action@v3
40+
41+
- name: Extract branch name
1742
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
1843

19-
- name: Login to DockerHub
44+
- name: Login to GHCR
2045
uses: docker/login-action@v3
2146
with:
22-
username: ${{ secrets.XXX_USERNAME }}
23-
password: ${{ secrets.XXX_PWORD }}
47+
registry: ghcr.io
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
2450

2551
- name: Build and push Docker image
2652
uses: docker/build-push-action@v6
2753
with:
2854
context: .
2955
push: true
30-
file: ./Dockerfile
56+
file: container/Containerfile
3157
platforms: linux/amd64
32-
# see https://github.com/docker/build-push-action/issues/276 for syntax help
33-
tags: underworldcode/underworld3:${{ env.BRANCH }} #-$(date +%s)
58+
no-cache: ${{ inputs.force_rebuild || false }}
59+
tags: |
60+
ghcr.io/underworldcode/underworld3:${{ env.BRANCH }}
61+
ghcr.io/underworldcode/underworld3:latest

.github/workflows/publish.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

container/README.md

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ This directory contains all Dockerfiles for Underworld3, supporting two use case
55
1. **Command-line containers** - For users who want to run UW3 locally without installation
66
2. **Binder containers** - For mybinder.org web-based launches
77

8+
Both containers are hosted on **GitHub Container Registry (GHCR)** using the
9+
repository's built-in `GITHUB_TOKEN` for authentication (no external secrets required).
10+
11+
---
12+
813
## Command-Line Container (Containerfile)
914

1015
Lightweight container for local command-line use with Docker or Podman.
@@ -14,34 +19,54 @@ Lightweight container for local command-line use with Docker or Podman.
1419
| `Containerfile` | Micromamba-based image for local use |
1520
| `launch-container.sh` | Podman launch script with rootless support |
1621

17-
### Building
22+
### Pulling Pre-Built Images
1823

1924
```bash
20-
# From repository root (requires Docker or Podman)
21-
podman build . --rm \
22-
--format docker \
23-
-f ./container/Containerfile \
24-
-t underworldcode/underworld3:local
25+
# Pull the latest development image
26+
docker pull ghcr.io/underworldcode/underworld3:development
2527

26-
# Or with Docker
27-
docker build -f container/Containerfile -t underworldcode/underworld3:local .
28+
# Or a specific branch
29+
docker pull ghcr.io/underworldcode/underworld3:main
2830
```
2931

3032
### Running
3133

3234
```bash
33-
# Using the launch script (Podman, recommended)
34-
./container/launch-container.sh
35+
# Run the pre-built image
36+
docker run -it --rm -p 8888:8888 ghcr.io/underworldcode/underworld3:development
3537

36-
# Or manually with Docker
37-
docker run -it --rm -p 8888:8888 underworldcode/underworld3:local
38+
# Using the launch script (Podman, recommended for local builds)
39+
./container/launch-container.sh
3840
```
3941

4042
The launch script:
4143
- Maps `$HOME/uw_space` into the container for file transfer
4244
- Runs Jupyter on port 10000 (http://localhost:10000)
4345
- Handles rootless Podman UID/GID mapping
4446

47+
### Building Locally
48+
49+
```bash
50+
# From repository root (requires Docker or Podman)
51+
podman build . --rm \
52+
--format docker \
53+
-f ./container/Containerfile \
54+
-t underworld3:local
55+
56+
# Or with Docker
57+
docker build -f container/Containerfile -t underworld3:local .
58+
```
59+
60+
### GitHub Actions
61+
62+
The `docker-image.yml` workflow automatically builds and pushes to GHCR when:
63+
- `container/Containerfile` changes
64+
- `environment.yaml` changes
65+
- Cython files (`.pyx`) or C files change
66+
- `setup.py` or `pyproject.toml` changes
67+
68+
Can also be triggered manually via workflow_dispatch.
69+
4570
### Architecture
4671

4772
At present only amd64 architecture is built, because vtk-osmesa isn't available for arm by default.
@@ -109,7 +134,7 @@ docker run --rm -p 8888:8888 ghcr.io/underworldcode/uw3-base:test-slim
109134

110135
### Layer Size Constraints
111136

112-
mybinder.org has an ~1GB layer size limit. The optimized Dockerfile splits the `lib` directory into multiple layers to stay under this limit. See `docs/developer/BINDER_CONTAINER_SETUP.md` for details.
137+
mybinder.org has an ~1GB layer size limit. The optimized Dockerfile splits the `lib` directory into multiple layers to stay under this limit. See `docs/developer/guides/BINDER_CONTAINER_SETUP.md` for details.
113138

114139
### GitHub Actions
115140

@@ -130,12 +155,13 @@ It also triggers the launcher repo to update its image reference.
130155
| **File** | `Containerfile` | `Dockerfile.base.optimized` |
131156
| **Base** | micromamba | Ubuntu + Pixi |
132157
| **Size** | ~2GB | ~3.4GB (slim) |
133-
| **Registry** | DockerHub | GHCR |
158+
| **Registry** | GHCR | GHCR |
159+
| **Image** | `ghcr.io/underworldcode/underworld3:<branch>` | `ghcr.io/underworldcode/uw3-base:<branch>-slim` |
134160
| **Use case** | Local `docker run` | mybinder.org |
135161
| **Workflow** | `docker-image.yml` | `binder-image.yml` |
136162

137163
## Related
138164

139-
- **Binder setup docs**: `docs/developer/BINDER_CONTAINER_SETUP.md`
165+
- **Binder setup docs**: `docs/developer/guides/BINDER_CONTAINER_SETUP.md`
140166
- **Launcher repo**: https://github.com/underworldcode/uw3-binder-launcher
141167
- **Badge generator**: `scripts/binder_wizard.py`

container/launch-container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ podman run -it --rm \
4040
--gidmap 0:1:$gid \
4141
--gidmap $(($gid+1)):$(($gid+1)):$((subgidSize-$gid)) \
4242
-v "${HOME}/uw_space":/home/mambauser/host \
43-
docker.io/underworldcode/underworld3:development
43+
ghcr.io/underworldcode/underworld3:development
4444

4545
## Description of rootless podman and uidmap/gidmap.
4646
# Rootless podman allows a non-root user to run a container without elevated permissions.

docs/developer/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This log tracks significant development work at a conceptual level, suitable for
1515
- Pushes to `ghcr.io/underworldcode/uw3-base:<branch>-slim`
1616
- Cross-repo dispatch updates launcher repository automatically
1717

18-
- **Command-line images** (`docker-image.yml`): Separate workflow for DockerHub (micromamba-based)
18+
- **Command-line images** (`docker-image.yml`): Separate workflow for GHCR (micromamba-based)
1919

2020
- **Launcher auto-update**: `uw3-binder-launcher` receives `repository_dispatch` events and updates its Dockerfile reference automatically
2121

docs/developer/container/launch-container.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ podman run -it --rm \
4040
--gidmap 0:1:$gid \
4141
--gidmap $(($gid+1)):$(($gid+1)):$((subgidSize-$gid)) \
4242
-v "${HOME}/uw_space":/home/mambauser/host \
43-
docker.io/underworldcode/underworld3:development
43+
ghcr.io/underworldcode/underworld3:development
4444

4545
## Description of rootless podman and uidmap/gidmap.
4646
# Rootless podman allows a non-root user to run a container without elevated permissions.

docs/developer/subsystems/containers.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Underworld3 provides two container deployment strategies for different use cases
1818
│ │ │binder-image │
1919
│ │ │ .yml │
2020
▼ ▼ └──────┬──────┘
21-
GHCR (binder) DockerHub
21+
GHCR (binder) GHCR (CLI)
2222
~3.4GB slim ~2GB ▼
2323
│ uw3-binder-launcher
2424
│ (auto-updated)
@@ -54,7 +54,7 @@ ghcr.io/underworldcode/uw3-base:<branch>-slim
5454
ghcr.io/underworldcode/uw3-base:latest-slim
5555
```
5656

57-
Branch-specific tags (`main-slim`, `uw3-release-candidate-slim`, `development-slim`) enable testing different versions.
57+
Branch-specific tags (`main-slim`, `development-slim`) enable testing different versions.
5858

5959
### Build Triggers
6060

@@ -93,7 +93,6 @@ uw3-binder-launcher/
9393
| Launcher Branch | UW3 Branch | Binder URL |
9494
|-----------------|------------|------------|
9595
| `main` | `main` | `mybinder.org/v2/gh/underworldcode/uw3-binder-launcher/main` |
96-
| `uw3-release-candidate` | `uw3-release-candidate` | `mybinder.org/v2/gh/underworldcode/uw3-binder-launcher/uw3-release-candidate` |
9796
| `development` | `development` | `mybinder.org/v2/gh/underworldcode/uw3-binder-launcher/development` |
9897

9998
### Automation Pipeline
@@ -135,7 +134,7 @@ Command-line containers provide a lightweight option for users who want to run U
135134
|------|----------|---------|
136135
| `Containerfile` | `container/` | Micromamba-based image (~2GB) |
137136
| `launch-container.sh` | `container/` | Podman launch script |
138-
| `docker-image.yml` | `.github/workflows/` | DockerHub build workflow |
137+
| `docker-image.yml` | `.github/workflows/` | GHCR build workflow |
139138

140139
### Building Locally
141140

@@ -167,7 +166,7 @@ This script:
167166
**Manual Docker run**:
168167

169168
```bash
170-
docker run -it --rm -p 8888:8888 underworldcode/underworld3:development
169+
docker run -it --rm -p 8888:8888 ghcr.io/underworldcode/underworld3:development
171170
```
172171

173172
### Rootless Podman
@@ -181,7 +180,7 @@ podman run -it --rm \
181180
--uidmap 0:1:$uid \
182181
# ... additional mappings
183182
-v "${HOME}/uw_space":/home/mambauser/host \
184-
docker.io/underworldcode/underworld3:development
183+
ghcr.io/underworldcode/underworld3:development
185184
```
186185

187186
```{warning}
@@ -190,13 +189,14 @@ Do NOT run the launch script with `sudo`. Rootless Podman requires the executing
190189

191190
### Image Registry
192191

193-
Command-line images are pushed to DockerHub:
192+
Command-line images are pushed to GHCR (same registry as binder images):
194193

195194
```
196-
underworldcode/underworld3:<branch>
195+
ghcr.io/underworldcode/underworld3:<branch>
196+
ghcr.io/underworldcode/underworld3:latest
197197
```
198198

199-
Currently only the `development` branch triggers automated builds.
199+
Builds trigger on pushes to `main` and `development` branches when container-related files change. Can also be triggered manually via workflow_dispatch.
200200

201201
## Comparison
202202

@@ -205,7 +205,7 @@ Currently only the `development` branch triggers automated builds.
205205
| **Dockerfile** | `Dockerfile.base.optimized` | `Containerfile` |
206206
| **Base** | Ubuntu + Pixi | Micromamba |
207207
| **Size** | ~3.4GB (slim) | ~2GB |
208-
| **Registry** | GHCR | DockerHub |
208+
| **Registry** | GHCR | GHCR |
209209
| **Use case** | mybinder.org | Local `docker run` |
210210
| **Workflow** | `binder-image.yml` | `docker-image.yml` |
211211
| **Automation** | Full (build + launcher update) | Build only |

0 commit comments

Comments
 (0)