Skip to content

Build the release Docker images in GitHub Actions - #923

Merged
HoustonPutman merged 4 commits into
apache:mainfrom
HoustonPutman:release-docker-images-from-ci
Dec 2, 2026
Merged

HoustonPutman merged 4 commits into
apache:mainfrom
HoustonPutman:release-docker-images-from-ci

Conversation

@HoustonPutman

@HoustonPutman HoustonPutman commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

The release manager no longer needs personal push access to Docker Hub. The release wizard pushes git refs, and GitHub Actions builds and publishes the images from them.

Release flow

  • RC: after the local smoke test, the wizard pushes the release commit to its own branch, rc/<version>-rc<N>. The new Publish Docker Image workflow then builds and pushes apache/solr-operator:<version>-rc<N>. The release commit is still not pushed to the release branch during the vote.
  • Release: once the vote passes, the wizard fast-forwards release-X.Y to that same commit, so its ID doesn't change, and pushes the tag. The tag triggers the same workflow, which publishes apache/solr-operator:<version>.
  • The wizard's local docker buildx --push steps are replaced by steps that point the release manager at the workflow run and check the published image (imagetools inspect, verify_docker.sh).
  • The Helm OCI smoke test now runs after the release image is checked, and uses the release image instead of the RC image.

Publish Docker Image workflow

  • Publishes only commits whose version/version.go has the release version with no suffix.
  • Publishes a release tag only if its commit is on the release branch.
  • Never overwrites a release image. An RC image is overwritten only when its RC branch is force-pushed, which the wizard allows only before the vote on that RC starts. The run summary records the digest it replaced.
  • Pulls the image back anonymously for each platform and checks the version and Git SHA the operator reports (on amd64; arm64 is only checked by its image metadata).
  • Uses only the Docker CLI and the already-pinned actions/checkout, so no new third-party actions need ASF allowlisting.

build/Dockerfile now cross-compiles the binary (FROM --platform=$BUILDPLATFORM, with TARGETOS/TARGETARCH passed to make). The arm64 image is built on the same runner without QEMU. The license list is unchanged, since go-licenses is already pinned to linux/amd64.

Wizard changes

  • Continuing on a different machine: new global variables rc_branch and release_commit_title. If the wizard doesn't know build_rc.git_rev, it looks the release commit up from the RC branch the first time a template uses it. The RC branch must be a single commit on top of the release branch (or already on it, after the vote), with the release commit's title and version. The values stored are computed from build_rc's own vars.
  • Re-runnable push_rc_branch: does nothing if the branch is already at the release commit. If it's at a different commit, it asks, then pushes with --force-with-lease. It refuses once the vote has been initiated.
  • Cleanup: aborting or restarting an RC offers to delete its RC branch. A new publish step deletes every remaining RC branch for the release. Deleting an rc/* branch triggers the new Delete RC Docker Image workflow, which deletes the RC image from Docker Hub. That workflow can also be run manually, deletes only vX.Y.Z-rcN tags, and refuses while the RC branch still exists.

Removed: uploading the release CRDs to nightlies

The documented CRD URL, https://solr.apache.org/operator/downloads/crds/<version>/<name>.yaml, is redirected by solr-site (themes/solr/templates/htaccess.template) to the crds/ folder of the official release, through closer.lua. Only v0.2.6 to v0.2.8, which predate the Apache releases, go to nightlies. The CRDs the publish_crds step uploaded to nightlies were never served, so that step and hack/release/upload/upload_crds.sh are removed.

Before the first release that uses this

  • ASF Infra makes DOCKERHUB_USER / DOCKERHUB_TOKEN available to this repo. Deleting RC images needs the token to have the Delete permission.
  • Check that force-pushing rc/* branches is allowed. Only main is protected in .asf.yaml.
  • Backport the publish workflow to the release branch being released. RC commits are built on top of it, so the workflow must be on that branch. The delete workflow only needs to be on main, since delete events run the default branch's version.

Testing

  • The wizard YAML loads with the wizard's classes, and all changed templates render.
  • The RC-commit lookup, push_rc_branch (create / no-op / overwrite / refuse after the vote) and the RC branch cleanup were exercised with the wizard's real functions, against a throwaway origin repo and clone.
  • make GOOS=linux ARCH=arm64 build produces a static aarch64 binary.
  • The ref parsing in the publish workflow accepts and rejects the expected branch and tag names.
  • Not run: the Docker image build itself (no Docker daemon was available), and both workflows against GitHub and Docker Hub. The Docker Hub tag-deletion API calls in particular are untested.

The release manager no longer needs personal push access to Docker Hub.
Instead of building and pushing the RC and release images locally, the
release wizard pushes git refs, and GitHub Actions builds the images
from them:

- After the local smoke test, the release commit is pushed to its own
  branch, rc/<version>-rc<N>, which publishes the
  apache/solr-operator:<version>-rc<N> image. The release commit is
  still not pushed to the release branch during the vote.
- Once the vote passes, the release branch is fast-forwarded to that
  same commit, so its ID does not change, and the release tag is
  pushed. That publishes apache/solr-operator:<version>.

The publish workflow only publishes a commit whose version.go has the
release version with no suffix, only publishes a release tag whose
commit is on the release branch, and never overwrites a release image.
The Dockerfile now cross-compiles the binary, so the arm64 image is
built on the same runner without CPU emulation.

The release can be continued on a different machine. If the wizard
does not know the release commit, it looks it up from the RC branch,
which must be a single commit on top of the release branch, with the
release commit's title and version. The RC branch can be overwritten
until the vote starts. RC branches are deleted when an RC is aborted
and once the release is published, which triggers a workflow that
deletes their RC images from Docker Hub.
The documented CRD location,
https://solr.apache.org/operator/downloads/crds/<version>/<name>.yaml,
is redirected by solr-site to the crds/ folder of the official release,
through closer.lua. Only v0.2.6 to v0.2.8, which predate the Apache
releases, are redirected to nightlies.apache.org. So the CRDs uploaded
to nightlies by the publish_crds step were never served, and the step
and upload_crds.sh can go.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Uncoordinated cleanup and unrestricted RC reruns can recreate deleted images or overwrite the current candidate with stale or rebuilt content, including during voting.

5 open issues
What changed in this PR

Moves release Docker publishing to GitHub Actions, removing the release manager’s need for Docker Hub push access.

Changes:

  • Adds image publication and RC-image cleanup workflows.
  • Updates the wizard to manage RC branches, recover release commits, and verify published images.
  • Enables cross-compilation and removes obsolete CRD uploads to nightlies.
File Description
hack/​release/​wizard/​releaseWizard.yaml Updates release steps and image verification.
hack/​release/​wizard/​releaseWizard.py Adds RC branch management and commit recovery.
hack/​release/​upload/​upload_crds.sh Removes the obsolete upload script.
docs/​modules/​development/​pages/​release-instructions.adoc Documents automated image publishing.
build/​Dockerfile Cross-compiles binaries for target platforms.
.github/​workflows/​publish-docker-image.yaml Builds, publishes, and verifies release images.
.github/​workflows/​delete-rc-docker-image.yaml Deletes images for removed RC branches.

Review effort: Balanced

HoustonPutman and others added 2 commits December 1, 2026 15:51
…ng the publishing job'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ommit

Review follow-ups for the Docker image workflows:

- A new first job checks that the RC branch or release tag still points
  at the run's commit, and the image is only published if it does. A
  re-run of an old run after the RC branch was overwritten, or a queued
  run whose RC branch has since been deleted, now publishes nothing,
  rather than overwriting the current RC image.
- If the image tag already exists and was built from the same commit
  (its org.opencontainers.image.revision label), the run only verifies
  it. A re-run no longer replaces an image that may be under vote with
  a rebuild, which is not identical. A run whose verification failed
  after publishing can now be re-run to finish its verification,
  including for a release tag.
- An existing release image built from a different commit still fails
  the run. An RC image built from a different commit is still replaced,
  since the run is current, so its RC branch was overwritten.
- Publishing and deleting an image share one concurrency group, keyed by
  the RC branch name, so an RC image can not be deleted while it is
  still being published and then recreated by that run.
Comment thread hack/release/wizard/releaseWizard.py Resolved
Comment thread hack/release/wizard/releaseWizard.yaml Resolved

@janhoy janhoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's take it for a spin.

I have a branch with my own wizard fixes that I use to drive the release, but I'll merge in this and continue from where I left.

@HoustonPutman
HoustonPutman merged commit 6893b4a into apache:main Dec 2, 2026
4 checks passed
@HoustonPutman
HoustonPutman deleted the release-docker-images-from-ci branch December 2, 2026 00:26
HoustonPutman added a commit that referenced this pull request Dec 2, 2026
* Build the release Docker images in GitHub Actions

The release manager no longer needs personal push access to Docker Hub.
Instead of building and pushing the RC and release images locally, the
release wizard pushes git refs, and GitHub Actions builds the images
from them:

- After the local smoke test, the release commit is pushed to its own
  branch, rc/<version>-rc<N>, which publishes the
  apache/solr-operator:<version>-rc<N> image. The release commit is
  still not pushed to the release branch during the vote.
- Once the vote passes, the release branch is fast-forwarded to that
  same commit, so its ID does not change, and the release tag is
  pushed. That publishes apache/solr-operator:<version>.

The publish workflow only publishes a commit whose version.go has the
release version with no suffix, only publishes a release tag whose
commit is on the release branch, and never overwrites a release image.
The Dockerfile now cross-compiles the binary, so the arm64 image is
built on the same runner without CPU emulation.

The release can be continued on a different machine. If the wizard
does not know the release commit, it looks it up from the RC branch,
which must be a single commit on top of the release branch, with the
release commit's title and version. The RC branch can be overwritten
until the vote starts. RC branches are deleted when an RC is aborted
and once the release is published, which triggers a workflow that
deletes their RC images from Docker Hub.

* Remove the upload of the release CRDs to nightlies

The documented CRD location,
https://solr.apache.org/operator/downloads/crds/<version>/<name>.yaml,
is redirected by solr-site to the crds/ folder of the official release,
through closer.lua. Only v0.2.6 to v0.2.8, which predate the Apache
releases, are redirected to nightlies.apache.org. So the CRDs uploaded
to nightlies by the publish_crds step were never served, and the step
and upload_crds.sh can go.

* Potential fix for pull request finding 'Skip deleted refs when starting the publishing job'

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Only publish current refs, and never rebuild an image from the same commit

Review follow-ups for the Docker image workflows:

- A new first job checks that the RC branch or release tag still points
  at the run's commit, and the image is only published if it does. A
  re-run of an old run after the RC branch was overwritten, or a queued
  run whose RC branch has since been deleted, now publishes nothing,
  rather than overwriting the current RC image.
- If the image tag already exists and was built from the same commit
  (its org.opencontainers.image.revision label), the run only verifies
  it. A re-run no longer replaces an image that may be under vote with
  a rebuild, which is not identical. A run whose verification failed
  after publishing can now be re-run to finish its verification,
  including for a release tag.
- An existing release image built from a different commit still fails
  the run. An RC image built from a different commit is still replaced,
  since the run is current, so its RC branch was overwritten.
- Publishing and deleting an image share one concurrency group, keyed by
  the RC branch name, so an RC image can not be deleted while it is
  still being published and then recreated by that run.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants