Skip to content

Commit 99c2acf

Browse files
fix(ci): bootstrap the reusable MinIO image in GHCR (block#7869)
Upstream MinIO image pulls are blocking CI (block#7867). Add a separate publisher for `ghcr.io/block/buzz-minio:latest`, so the reusable image can be bootstrapped before CI adopts it in block#7870. - Build the checksummed official MinIO/mc release binaries from block#7868 on a digest-pinned Alpine base. - Build only when image/workflow/Compose inputs change or on manual dispatch. PRs build and smoke-test; only `block/buzz` main can publish. - Run the real Compose healthcheck and initializer, object upload/read/delete, and anonymous-access denial before publishing `latest` plus a unique `sha-<commit>-run-<id>-<attempt>` tag. - Manual dispatch disables Docker's layer cache to refresh Alpine packages. Normal image builds retain caching; each maintenance rebuild keeps its own tag. ### Rollout This PR contains only the publisher and opt-in Compose override. **It does not switch ordinary CI consumers**, so its checks do not require the unpublished image. This is a separate PR from adoption, as required by Buzz's squash-only merge rules. 1. Merge this PR; its main-branch workflow builds, tests, and publishes the image. 2. Make the `buzz-minio` GHCR package public and verify an anonymous pull of `ghcr.io/block/buzz-minio:latest`. New GHCR packages default to private. 3. Rebase draft block#7870 onto current main, retarget it to main, run its integration checks, and merge it to switch all MinIO-backed CI jobs to the published image. ### Validation - Updated hosted [MinIO image build and smoke test](https://github.com/block/buzz/actions/runs/36018177877) passed at `700ab6d5346b37a64c9defde0016dc65c98aa790`; publication correctly skipped on the PR. - Hosted [ordinary CI](https://github.com/block/buzz/actions/runs/36018178123) passed at the same head. Its actual Git comparison detected only the five publisher files, all application path filters were false, and the MinIO-dependent integration checks were correctly skipped. Synced current main before this run to eliminate an earlier stale-base comparison that included unrelated ACP changes. - Actual five changed paths were passed through the repo's pinned `dorny/paths-filter`: all application domains were false. All 12 existing path-selection cases and the required-context isolation contract also passed. - Publisher actionlint, smoke-script shellcheck, and commit/push hooks passed. - Fresh local rebuild of `700ab6d5346b37a64c9defde0016dc65c98aa790` passed with `docker buildx build --no-cache --platform linux/amd64 --load`. Logs confirm new Alpine index fetches and package installation rather than a cached install layer. The committed smoke script passed under local AMD64 emulation using the current merged Compose services with isolated resource names and no published ports: healthcheck, initializer/private bucket, object upload/read/delete, and anonymous HTTP 403. Temporary containers, network, and volume were removed. Both pinned binary checksums match the official release SHA-256 files. - Full `just ci` was previously attempted: workspace formatting/Clippy, desktop checks, and Tauri formatting passed; the run was stopped during Tauri Clippy. No full local application-suite pass is claimed; hosted application suites correctly skip this publisher-only change. --------- Signed-off-by: Tyler Longwell <[email protected]>
1 parent dd1c2af commit 99c2acf

5 files changed

Lines changed: 186 additions & 0 deletions

File tree

‎.github/ci/minio/Dockerfile‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# CI-only AMD64 image. Versions match the development Compose services.
2+
# Upstream registries deny pulls; official release binaries remain available.
3+
FROM alpine:3.22.6@sha256:5291449c3df73caf6ed85e649dec1b9e818b39a5d8c871e97afc13e9cd5e8fa8
4+
5+
LABEL org.opencontainers.image.source="https://github.com/block/buzz" \
6+
org.opencontainers.image.title="Buzz CI MinIO" \
7+
org.opencontainers.image.licenses="AGPL-3.0-only"
8+
9+
RUN apk add --no-cache ca-certificates curl
10+
11+
ADD --checksum=sha256:7c5bd8512c6e966455b1d198209358b2d191c77a83ab377c4073281065fb855f --chmod=755 \
12+
https://github.com/minio/minio/releases/download/RELEASE.2025-09-07T16-13-09Z/minio.linux-amd64.RELEASE.2025-09-07T16-13-09Z /usr/local/bin/minio
13+
ADD --checksum=sha256:01f866e9c5f9b87c2b09116fa5d7c06695b106242d829a8bb32990c00312e891 --chmod=755 \
14+
https://github.com/minio/mc/releases/download/RELEASE.2025-08-13T08-35-41Z/mc.linux-amd64.RELEASE.2025-08-13T08-35-41Z /usr/local/bin/mc
15+
16+
ENTRYPOINT ["minio"]

‎.github/ci/minio/README.md‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Buzz CI MinIO
2+
3+
`ghcr.io/block/buzz-minio:latest` contains MinIO and `mc` for the disposable
4+
Linux AMD64 CI runners. `docker-compose.ci.yml` selects it for both services;
5+
development and deployment defaults stay in `docker-compose.yml`.
6+
7+
The **MinIO image** workflow builds only when its inputs change, or on a manual
8+
dispatch. Pull requests build and smoke-test without publishing. On `main`, a
9+
successful smoke test publishes the same image as
10+
`sha-<full commit>-run-<run id>-<attempt>` and `latest`. The run-specific tag
11+
preserves each build, including package refreshes from the same source commit.
12+
Once consumers adopt the override, ordinary CI only pulls it; there is no build
13+
fallback or dependency on the publisher. `latest` deliberately floats, and
14+
Compose always pulls it. Docker's pull output records the resolved digest.
15+
16+
The Dockerfile uses the same upstream releases as the development services,
17+
with checksummed official GitHub release binaries and a digest-pinned Alpine
18+
base. MinIO and `mc` are AGPL-3.0; their corresponding source is available at
19+
the [MinIO release](https://github.com/minio/minio/tree/RELEASE.2025-09-07T16-13-09Z)
20+
and [mc release](https://github.com/minio/mc/tree/RELEASE.2025-08-13T08-35-41Z).
21+
22+
## First publication
23+
24+
The image must exist and be publicly pullable before the CI switch can pass.
25+
Use two separate PRs: Buzz only permits squash merges, so two commits in one
26+
PR cannot stage this rollout.
27+
28+
1. Merge the publisher-only PR containing `.github/ci/minio/`,
29+
`.github/workflows/minio-image.yml`, and the opt-in `docker-compose.ci.yml`.
30+
Ordinary CI does not select the override yet, so it does not need this image
31+
to validate the publisher PR. The merge triggers the first publication.
32+
2. After publication succeeds, an org/package admin must make **buzz-minio**
33+
public in its GitHub package settings (new GHCR packages default to private,
34+
even for public repositories). Verify an anonymous pull of
35+
`ghcr.io/block/buzz-minio:latest`.
36+
3. Rebase the separate consumer PR onto `main`, run its integration checks, and
37+
merge it. That PR selects the override in relay and mesh lifecycle CI.
38+
39+
Subsequent publications preserve package visibility.
40+
41+
## Updating or rebuilding
42+
43+
Update the release URLs/checksums or base digest in the Dockerfile and open a
44+
PR. Merging triggers publication. To rebuild the existing recipe (for example,
45+
to pick up Alpine package updates), dispatch **MinIO image** from `main`.
46+
Manual dispatch disables Docker's layer cache so the package installation
47+
runs again. Other refs can build and test but cannot publish `latest`.
48+
49+
To reproduce a CI run with a recorded version, set `MINIO_CI_IMAGE` to
50+
the published run-specific tag or digest while using
51+
`COMPOSE_FILE=docker-compose.yml:docker-compose.ci.yml`.

‎.github/ci/minio/smoke-test.sh‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Run on a disposable Docker host with the CI Compose files and a built image.
3+
set -euo pipefail
4+
: "${MINIO_CI_IMAGE:?Set MINIO_CI_IMAGE to the locally built image}"
5+
: "${COMPOSE_FILE:?Select docker-compose.yml and docker-compose.ci.yml}"
6+
7+
# Exercise the real healthcheck and initializer without pulling over the image
8+
# under test. No application services or tests need a MinIO build step.
9+
docker compose up -d --wait --wait-timeout 90 --pull never minio
10+
docker compose run --rm --no-deps --pull never minio-init
11+
docker compose exec -T minio sh -eu -c '
12+
minio --version
13+
mc --version
14+
mc alias set local http://localhost:9000 buzz_dev buzz_dev_secret
15+
printf "buzz-minio-smoke\n" > /tmp/expected
16+
mc cp /tmp/expected local/buzz-media/smoke-test
17+
mc cat local/buzz-media/smoke-test > /tmp/actual
18+
cmp /tmp/expected /tmp/actual
19+
status=$(curl --silent --show-error --output /dev/null --write-out "%{http_code}" \
20+
http://localhost:9000/buzz-media/smoke-test)
21+
test "$status" = 403
22+
mc rm local/buzz-media/smoke-test
23+
if mc stat local/buzz-media/smoke-test; then
24+
echo "Deleted object is still present" >&2
25+
exit 1
26+
fi
27+
'

‎.github/workflows/minio-image.yml‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: MinIO image
2+
3+
# A separate publisher, never a dependency of ordinary CI. Image changes get
4+
# a build/smoke test on PRs; only reviewed main commits can move :latest.
5+
on:
6+
push:
7+
branches: [main]
8+
paths:
9+
- '.github/ci/minio/**'
10+
- '.github/workflows/minio-image.yml'
11+
- 'docker-compose.yml'
12+
- 'docker-compose.ci.yml'
13+
pull_request:
14+
paths:
15+
- '.github/ci/minio/**'
16+
- '.github/workflows/minio-image.yml'
17+
- 'docker-compose.yml'
18+
- 'docker-compose.ci.yml'
19+
workflow_dispatch:
20+
21+
concurrency:
22+
group: minio-image-${{ github.ref }}
23+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24+
25+
permissions:
26+
contents: read
27+
28+
env:
29+
IMAGE_NAME: ghcr.io/block/buzz-minio
30+
COMPOSE_FILE: docker-compose.yml:docker-compose.ci.yml
31+
MINIO_CI_IMAGE: ghcr.io/block/buzz-minio:sha-${{ github.sha }}-run-${{ github.run_id }}-${{ github.run_attempt }}
32+
33+
jobs:
34+
image:
35+
name: Build and smoke-test MinIO
36+
runs-on: ubuntu-24.04
37+
timeout-minutes: 15
38+
permissions:
39+
contents: read
40+
packages: write
41+
steps:
42+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
43+
with:
44+
persist-credentials: false
45+
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
46+
- name: Build image
47+
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
48+
with:
49+
context: .github/ci/minio
50+
platforms: linux/amd64
51+
load: true
52+
tags: ${{ env.MINIO_CI_IMAGE }}
53+
labels: org.opencontainers.image.revision=${{ github.sha }}
54+
# A maintenance dispatch must refresh apk packages even with a warm
55+
# layer cache. Normal image changes can still reuse cached layers.
56+
no-cache: ${{ github.event_name == 'workflow_dispatch' }}
57+
cache-from: type=gha,scope=minio
58+
cache-to: type=gha,scope=minio,mode=max
59+
- name: Smoke-test CI services
60+
run: bash .github/ci/minio/smoke-test.sh
61+
- name: Clean up smoke test
62+
if: always()
63+
run: docker compose down --volumes
64+
- name: Log in to GHCR
65+
if: github.repository == 'block/buzz' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
66+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
67+
with:
68+
registry: ghcr.io
69+
username: ${{ github.actor }}
70+
password: ${{ secrets.GITHUB_TOKEN }}
71+
- name: Publish tested image
72+
if: github.repository == 'block/buzz' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
73+
run: |
74+
docker push "$MINIO_CI_IMAGE"
75+
docker tag "$MINIO_CI_IMAGE" "$IMAGE_NAME:latest"
76+
docker push "$IMAGE_NAME:latest"
77+
{
78+
echo "Published $MINIO_CI_IMAGE and $IMAGE_NAME:latest"
79+
echo 'First publication: make the buzz-minio package public before enabling CI consumers.'
80+
} >> "$GITHUB_STEP_SUMMARY"

‎docker-compose.ci.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# CI pulls the published image; only minio-image.yml builds it.
2+
# MINIO_CI_IMAGE lets the publisher smoke-test an unpublished image or an
3+
# operator reproduce a run with its recorded run-specific tag/digest.
4+
services:
5+
minio:
6+
image: ${MINIO_CI_IMAGE:-ghcr.io/block/buzz-minio:latest}
7+
platform: linux/amd64
8+
pull_policy: always
9+
minio-init:
10+
image: ${MINIO_CI_IMAGE:-ghcr.io/block/buzz-minio:latest}
11+
platform: linux/amd64
12+
pull_policy: always

0 commit comments

Comments
 (0)