Skip to content

ci(chip-router): publish Docker image on module tag - #2887

Draft
pkcll wants to merge 1 commit into
mainfrom
ci/chip-router-image-publish
Draft

pkcll wants to merge 1 commit into
mainfrom
ci/chip-router-image-publish

Conversation

@pkcll

@pkcll pkcll commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Problem

The chip-router fix (#2877) is on main, but nothing in this repo publishes the router Docker image:

  • Consumers pin local-cre-chip-router:vX.Y.Z; chainlink CRE setups get it either by cloning this repo at a pinned commit and building locally (build_config in their setup.toml), or by pulling from {{.SDLC_ECR}}/local-cre-chip-router:vX.Y.Z (pull_config).
  • chainlink's cre-local-env-tests.yaml resolves SDLC_AWS_ECR to the QA account ECR registry — the same registry this repo's parrot-release.yml already publishes to via AWS OIDC.
  • CI also never builds this module's image: framework/components/chiprouter is in no test/lint matrix with a Docker build, so image breakage only surfaces when someone tags or builds locally (noted in the final review of fix(chip-router): per-event results and write-service parity for Publish/PublishBatch #2877).

What this adds

.github/workflows/chiprouter-release.yml — the parrot-release.yml pattern applied to the chiprouter module:

Trigger Job Effect
tag push framework/components/chiprouter/v* publish build + push <QA_ECR>/local-cre-chip-router:vX.Y.Z and :latest
workflow_dispatch (version input) publish check out that module tag and publish it — backfill path for already-tagged versions (e.g. v1.0.5)
PR touching framework/components/chiprouter/** build-check build both platforms, no secrets, no push
  • Reuses the existing secrets — AWS_OIDC_PUBLISH_ECR_ROLE_ARN, AWS_REGION, QA_AWS_ACCOUNT_NUMBER from the integration environment — no new credentials.
  • The tag trigger rides the same module-tag flow as release-go-module.yml (which independently creates the GitHub release + binaries), so "tag the module" becomes the single release action: Go module, GitHub release, and Docker image together.
  • Image name/tag match chainlink's existing pull contract exactly: local-cre-chip-router:vX.Y.Z.

framework/components/chiprouter/Dockerfile — one line: FROM --platform=$BUILDPLATFORM golang:1.26.6 AS builder.

  • Standard Go cross-compile pattern: multi-arch builds (linux/amd64,linux/arm64) run the builder natively and cross-compile via GOARCH, and the distroless final stage only COPYs — so no QEMU and both architectures build fast.
  • Plain docker build behavior is unchanged (when target = host platform, $BUILDPLATFORM is the host platform too).

Verification

  • actionlint (the linter validate-gha-workflows.yml runs on every PR): clean.
  • docker buildx build --platform linux/amd64,linux/arm64 -f framework/components/chiprouter/Dockerfile framework/components/chiprouter — the exact command both jobs run — builds successfully on an arm64 host with no emulation.
  • Tag/version parsing checked for both trigger shapes (framework/components/chiprouter/v1.0.5 → v1.0.5; dispatch input validated against vX.Y.Z).

Open questions / follow-ups

  1. Does the ECR repo local-cre-chip-router exist in the QA account, and does AWS_OIDC_PUBLISH_ECR_ROLE_ARN's role have push permissions on it? (Parrot's role pushes to <QA_ECR>/parrot; if the role is repo-scoped, it needs local-cre-chip-router added, or a separate role secret.)
  2. Who dispatches the v1.0.5 backfill after this merges, and do downstream pins (chainlink setup.toml, data-feeds CI) move to the published image then?
  3. Publishes are amd64+arm64 manifest lists; the pre-existing v1.0.1 was amd64-only — consumers on amd64 see no difference.

Nothing in this repo publishes the chip-router image: consumers pin
local-cre-chip-router:vX.Y.Z, and chainlink CRE setups either clone and
build this repo at a pinned commit or pull from {{.SDLC_ECR}} — the QA
account ECR registry that parrot-release.yml already publishes to via
OIDC (chainlink's cre-local-env-tests.yaml resolves SDLC_AWS_ECR to that
same registry).

- chiprouter-release.yml: on a framework/components/chiprouter/v* tag
  push (same tag flow as release-go-module.yml), and on workflow_dispatch
  with a version input (checks out that module tag; backfill for already
  tagged versions such as v1.0.5), build the image and push it to
  $QA_ECR/local-cre-chip-router:<version> and :latest, reusing the
  existing AWS_OIDC_PUBLISH_ECR_ROLE_ARN OIDC role, AWS_REGION and
  QA_AWS_ACCOUNT_NUMBER secrets from the integration environment — the
  parrot-release.yml pattern, no new credentials.
- The same workflow also builds the image (no secrets, no push) on PRs
  touching framework/components/chiprouter/**, so image breakage fails
  CI before merge instead of surfacing at the next tag.
- Dockerfile: pin the builder stage to $BUILDPLATFORM so buildx
  multi-arch builds cross-compile via GOARCH instead of emulating the
  builder; the distroless final stage only COPYs, so no QEMU is needed.
  Plain docker build behavior is unchanged.

This branch has not been deployed

No deployments
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