Repository navigation
feat(ci): publish the five Trinity images to GHCR on release (#2452) - #2453
obasilakis wants to merge 1 commit into
Conversation
`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
|
Closing — I built this on a false premise and it would have been a regression.
The real workflow is better specified than mine on every point the review round caught — What is actually true, and all that remains: the workflow has never run — #2452 was filed on the same false premise and is being closed with it. |
Closes #2452.
What
Adds
.github/workflows/publish-images.yml— builds and publishes the five Trinity images to GHCR on av*release tag. This is #2280's AC1, the one unchecked item on an issue labelledstatus-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:
So
start.sh --hostedfailed at line 524 andpacker buildfailed at its firstdocker 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 taggedlatestper image would, on a partial failure, leavelatestpointing 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:
docker-compose.hosted.yml'simage:lineslatest${TRINITY_IMAGE_TAG:-latest};trinity.pkr.hclrequires an explicit tag and rejectslateststart.sh:524and01-provision.sh:50— neither runsdocker login01-provision.shclones--branch "${TRINITY_IMAGE_TAG}"Load-bearing choices
submodules: falseis explicit, not inherited. These images are world-pullable; a runner with enterprise access checking out recursively would bake private code into a public artifact.build-without-submodule.ymlproves the backend builds without it — this workflow has to choose it.main, and the tag's implied version must match theVERSIONfile. Without the first, a tag pushed from a feature branch publisheslatestfrom unreleased code, which feat: prebuilt images + pull-only hosted compose + unattended cloud-init first boot — the gate for every one-click / marketplace channel #2280's AC forbids. Without the second, a release that forgot a bump ships an image that misreports itself to every hosted install./api/versionreads.claude plugin install --yesuses a flag the CLI doesn't have (#1704/ent#411 delivery broken) #2305/bug: trinity-system cannot create ~/.claude/plugins — marketplace add fails EACCES, platform plugin withheld #2308 symptom into every agent, fleet-wide. The assertion readsinstalled_plugins.jsonand confirms the recordedinstallPathexists — not that~/.claude/pluginsis non-empty, because amarketplace addthat succeeds followed by aninstallthat fails leaves that directory full of marketplace metadata and no plugin.linux/amd64 only: #2280 lists arm64 as desirable, not required, and there is no arm64 marketplace target today.
Verification
Run locally against this branch:
COPY ../../src/backend/...paths resolve because BuildKit clamps them to the context root — confirmed by a real build, not inspection.VERSION=0.9.0 GIT_COMMIT=deadbeef …, nounknown.trinity@abilityai 2.8.2 at /home/developer/.claude/plugins/cache/abilityai/trinity/2.8.2), and fails on one built withTRINITY_PREINSTALL_PLUGINS=0(no installed_plugins.json — the pre-install was withheld entirely). A check that cannot fail is worse than no check.actionlintclean.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. Theverify-anonymous-pulljob fails with that instruction until it is done.Follow-ups, deliberately not here
POST /api/setup/admin-passwordoverwrites the admin password) reaches a marketplace droplet through Caddy athttps://<ip>/api/setup/admin-password, sincenginx.conf:39proxies/api/to the backend. The firewall rules in feat: DigitalOcean Marketplace 1-Click Droplet listing for Trinity (vendor application + Packer snapshot, AI Agents category) #2281 do not close it because 443 is the product. That is the other hard blocker on the DigitalOcean listing, and it is its own issue.docker-compose.hosted.ymlpublishes 8000/8080/8686 and the OTel ports on0.0.0.0, and Docker's iptables run ahead of ufw. feat: DigitalOcean Marketplace 1-Click Droplet listing for Trinity (vendor application + Packer snapshot, AI Agents category) #2281'sDOCKER-USERrule covers new droplets; already-deployed hosted installs on public IPs are unprotected. Worth its own issue.🤖 Generated with Claude Code
https://claude.ai/code/session_01218nVkqK7vU2jy9R73s4jT