Skip to content

feat(ci): publish the five Trinity images to GHCR on release (#2452) - #2453

Closed
obasilakis wants to merge 1 commit into
devfrom
feature/2452-publish-images-ghcr
Closed

obasilakis wants to merge 1 commit into
devfrom
feature/2452-publish-images-ghcr

Conversation

@obasilakis

Copy link
Copy Markdown
Contributor

Closes #2452.

What

Adds .github/workflows/publish-images.yml — builds and publishes the five Trinity images to GHCR on a v* release tag. This is #2280's AC1, the one unchecked item on an issue labelled status-in-dev, and the blocker under every marketplace channel (#2281 DigitalOcean, #2282 Vultr, #2283 Hostinger/Dokploy, #835 GCP/Hetzner).

Before this there was no publish workflow in the repo at all:

$ grep -rln "ghcr.io" .github/workflows/     → (nothing)
$ curl -s -o /dev/null -w "%{http_code}\n" \
    https://ghcr.io/v2/abilityai/trinity-{backend,frontend,mcp-server,scheduler,agent-base}/tags/list
  401  401  401  401  401

So start.sh --hosted failed at line 524 and packer build failed at its first docker pull.

Shape

Two phases. Phase 1 pushes only the immutable version tag for all five images; phase 2 moves latest, and only once every image has landed, by re-tagging the pushed digests (buildx imagetools create, no rebuild). A single-phase matrix that tagged latest per image would, on a partial failure, leave latest pointing at four new images and one old one — the set every hosted install pulls by default, and one no error message would explain.

The registry contract was not a design choice here; three consumers had already fixed it:

requirement set by
the five repository names docker-compose.hosted.yml's image: lines
both a version tag and latest compose defaults ${TRINITY_IMAGE_TAG:-latest}; trinity.pkr.hcl requires an explicit tag and rejects latest
anonymous pull start.sh:524 and 01-provision.sh:50 — neither runs docker login
image tag is also a git ref 01-provision.sh clones --branch "${TRINITY_IMAGE_TAG}"

Load-bearing choices

linux/amd64 only: #2280 lists arm64 as desirable, not required, and there is no arm64 marketplace target today.

Verification

Run locally against this branch:

  • All five images build with the exact contexts the matrix declares. Three of the five are not the repo root, and the backend's COPY ../../src/backend/... paths resolve because BuildKit clamps them to the context root — confirmed by a real build, not inspection.
  • Provenance assertion against a built backend image: VERSION=0.9.0 GIT_COMMIT=deadbeef …, no unknown.
  • Plugin assertion both directions — passes on a normal build (trinity@abilityai 2.8.2 at /home/developer/.claude/plugins/cache/abilityai/trinity/2.8.2), and fails on one built with TRINITY_PREINSTALL_PLUGINS=0 (no installed_plugins.json — the pre-install was withheld entirely). A check that cannot fail is worse than no check.
  • actionlint clean.

Not verified: an actual push to GHCR, which needs a real release tag on main.

One manual step after merge

The workflow cannot flip package visibility. On the first publish, set each of the five packages to Public once at https://github.com/orgs/abilityai/packages. The verify-anonymous-pull job fails with that instruction until it is done.

Follow-ups, deliberately not here

🤖 Generated with Claude Code

https://claude.ai/code/session_01218nVkqK7vU2jy9R73s4jT

`docker-compose.hosted.yml`, `scripts/deploy/start.sh --hosted` and the
#2281 DigitalOcean Packer bundle all shipped against a registry contract
that nothing satisfied. There was no publish workflow in the repo at all
and every GHCR repository answered 401, so the documented pull-only
install path died at `start.sh:524` and `packer build` died at its first
`docker pull`. This is #2280's AC1 — the unshipped half of the one-click
hosted gate that #2332 calls "the P1 gate; everything else depends on it".

The contract was not a design choice; three consumers had already fixed
it. Repository names come from the five `image:` lines in the hosted
compose. Every image needs BOTH tags, because compose defaults to
`${TRINITY_IMAGE_TAG:-latest}` while `trinity.pkr.hcl` requires an
explicit tag and rejects `latest`. Pulls are anonymous — neither
`start.sh` nor `01-provision.sh` runs `docker login`. And the image tag
doubles as a git ref, since `01-provision.sh` clones `--branch
"${TRINITY_IMAGE_TAG}"`, so a tag that is not also a git ref yields a
snapshot whose checkout and images disagree.

Two phases, deliberately. Phase 1 pushes only the immutable version tag
for all five images; phase 2 moves `latest`, and only once every image
has landed, by re-tagging the pushed digests with `buildx imagetools
create` rather than rebuilding. A single-phase matrix that tagged
`latest` per image would, on a partial failure, leave `latest` pointing
at four new images and one old one — a mixed set that every hosted
install pulls by default and that no error anywhere would explain.

Four properties are load-bearing:

- **`submodules: false` is explicit, not inherited.** These images are
  world-pullable. A runner with access to the private enterprise
  submodule that checked out recursively would bake private code into a
  public artifact. `build-without-submodule.yml` proves the backend
  builds without it; this workflow has to choose it.
- **Release tags must be ancestors of `main`.** `/release` merges dev
  into main and tags there; without the guard a tag pushed from a feature
  branch would publish `latest` from unreleased code, which #2280's AC
  forbids outright. The tag's implied version is also checked against the
  `VERSION` file, so a release that forgot a bump fails here instead of
  shipping an image that misreports itself to every hosted install.
- **The backend's six provenance args are asserted, not assumed** (#926).
  The check reads the baked ENV directly rather than booting the backend,
  which would need Redis, a database and a dozen secrets to prove a claim
  that is only about whether the build args survived into the image.
- **A withheld platform plugin fails the build.** ent#411's pre-install
  step is deliberately non-fatal so a local build survives an unreachable
  marketplace; that tolerance is right for one developer and wrong for a
  published artifact, where a network flake bakes the #2305/#2308 symptom
  into every agent every install creates. The assertion reads
  `installed_plugins.json` and confirms the recorded `installPath` exists,
  rather than testing that `~/.claude/plugins` is non-empty — a
  `marketplace add` that succeeds followed by an `install` that fails
  leaves that directory full of marketplace metadata and no plugin, which
  an emptiness test waves through.

A final job pulls all five with no credentials. GHCR packages are private
by default and publishing does not change that, so without it a green
publish still leaves every marketplace install failing on a 401 — exactly
the state this issue was filed for. Its failure message names the one-time
manual step, since the workflow cannot flip package visibility itself.

linux/amd64 only. #2280 lists arm64 as desirable, not required, and there
is no arm64 marketplace target today; it roughly doubles the agent-base
build for nothing anyone can currently deploy on.

Verified locally: all five images build with the exact contexts the matrix
declares (three of the five are not the repo root, and the backend's
`COPY ../../src/backend/...` paths resolve because BuildKit clamps them to
the context root); the provenance assertion reports real values off a
built image; and the plugin assertion passes on a normal build and fails
on one built with `TRINITY_PREINSTALL_PLUGINS=0`. actionlint clean.

Refs #2452, #2280, #2281, #2332
@obasilakis

Copy link
Copy Markdown
Contributor Author

Closing — I built this on a false premise and it would have been a regression.

.github/workflows/publish-images.yml already exists on dev, added by #2390 (#2280) on 2026-08-27, and tests/unit/test_2280_publish_workflow_and_stop.py is its reviewed spec. My local checkout of ~/trinity was 40-odd commits behind origin/dev, so ls .github/workflows/ and grep -rl ghcr.io both came back empty and I read that as 'no publish workflow exists'. This branch then overwrote the real one, and the five regression diff failures on this PR are that reviewed spec correctly rejecting the replacement.

The real workflow is better specified than mine on every point the review round caught — flavor: latest=false, per-tag github.event_name == 'push' gating, the deliberate rejection of type=sha because github.sha resolves to the dispatching branch head, and the lowercased reference in Verify anonymous pull (this org is Abilityai; docker rejects a mixed-case reference locally, before any network call).

What is actually true, and all that remains: the workflow has never run — gh run list --workflow publish-images.yml returns zero runs, because the newest tag is v0.9.0 and the workflow merged after it. So GHCR still answers 401 on all five repositories, and #2280's AC1 stays unticked, but the missing thing is a release cut, not a workflow.

#2452 was filed on the same false premise and is being closed with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant