-
Notifications
You must be signed in to change notification settings - Fork 0
Update "latest" tagged images on new tag #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
davdhacs
wants to merge
13
commits into
main
Choose a base branch
from
davdhacs/apollo-ci-latest-tag
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+114
−0
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2adceb7
Push latest floating tag for apollo-ci images
davdhacs b9117ca
test: verify latest tag is not pushed on PR builds
davdhacs 5881f63
Add workflow to promote images to stable tag
davdhacs 9855563
Simplify promote-stable: single job, server-side retag
davdhacs ff6a9c7
Default promote-stable version to 'latest'
davdhacs aa293dd
test: add tag trigger to test promote-stable workflow
davdhacs 5d0d269
Revert test trigger from promote-stable workflow
davdhacs 7f6e570
Only push latest tag for the newest version on main
davdhacs 0b19a43
Also verify tagged commit is on main before pushing latest
davdhacs f0d10ad
Reword skip message for latest tag push
davdhacs e3d4758
Add image tags and release process documentation
davdhacs c956205
Remove specific reviewer name from docs
davdhacs f732abb
Reword latest tag description in docs
davdhacs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: Promote to stable | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: "Version to promote (e.g. 0.5.7). Defaults to 'latest'." | ||
| required: false | ||
| default: "latest" | ||
|
|
||
| env: | ||
| QUAY_STACKROX_IO_RW_USERNAME: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }} | ||
| QUAY_STACKROX_IO_RW_PASSWORD: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }} | ||
|
|
||
| jobs: | ||
| promote-stable: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Log in to Quay | ||
| run: | | ||
| docker login -u "$QUAY_STACKROX_IO_RW_USERNAME" --password-stdin <<<"$QUAY_STACKROX_IO_RW_PASSWORD" quay.io | ||
| - name: Retag all flavors as stable | ||
| run: | | ||
| VERSION="${{ inputs.version }}" | ||
| VERSION="${VERSION:-latest}" | ||
| for flavor in scanner-build scanner-test stackrox-build stackrox-test stackrox-ui-test jenkins-plugin; do | ||
| SRC="quay.io/stackrox-io/apollo-ci:${flavor}-${VERSION}" | ||
| DST="quay.io/stackrox-io/apollo-ci:${flavor}-stable" | ||
| echo "Promoting ${SRC} → ${DST}" | ||
| docker buildx imagetools create --tag "${DST}" "${SRC}" | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,55 @@ This repository holds the Dockerfiles for images used in StackRox CI & builds. | |||||
| [gha-badge]: https://github.com/stackrox/rox-ci-image/actions/workflows/build.yaml/badge.svg | ||||||
| [gha-link]: https://github.com/stackrox/rox-ci-image/actions/workflows/build.yaml | ||||||
|
|
||||||
| ## Image Tags and Release Process | ||||||
|
|
||||||
| Each image flavor (e.g. `stackrox-test`, `scanner-test`) is pushed to | ||||||
| `quay.io/stackrox-io/apollo-ci` with three types of tags: | ||||||
|
|
||||||
| | Tag | Example | Updated when | Use in | | ||||||
| |-----|---------|-------------|--------| | ||||||
| | **versioned** | `stackrox-test-0.5.7` | Every merge to main (auto-tagged) | Release branch prow configs, pinned references | | ||||||
| | **latest** | `stackrox-test-latest` | Every new version tag on main | Testing rox-ci-image version in openshift/release PRs with `/pj-rehearse` before promoting to stable. | | ||||||
| | **stable** | `stackrox-test-stable` | Manual promotion via workflow | Master/nightly prow configs in openshift/release | | ||||||
|
|
||||||
| ### How it works | ||||||
|
|
||||||
| 1. **Merge to main** -- `tag.yaml` auto-creates a semver tag (e.g. `0.5.8`) | ||||||
| 2. **Tag push** -- `build.yaml` builds all images, pushes versioned tags, and | ||||||
| updates `latest` (only if the tag is the highest version on main) | ||||||
| 3. **Promote to stable** -- run manually when ready: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For convenience:
Suggested change
|
||||||
| ```bash | ||||||
| gh workflow run promote-stable.yaml | ||||||
| # or with a specific version: | ||||||
| gh workflow run promote-stable.yaml -f version=0.5.8 | ||||||
| ``` | ||||||
| This does a server-side retag (no rebuild) of all image flavors from the | ||||||
| specified version (default: `latest`) to `stable`. | ||||||
|
|
||||||
| ### Updating prow jobs in openshift/release | ||||||
|
|
||||||
| Prow job configs in `openshift/release` reference these images via | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| `build_root.image_stream_tag`. The tags must first be mirrored in | ||||||
| `core-services/image-mirroring/_config.yaml`. | ||||||
|
|
||||||
| - **Master/nightly configs**: use `stable` tag -- automatically picks up | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| promoted versions without config changes. | ||||||
| - **Release branch configs**: pin to a specific version (e.g. `scanner-test-0.5.7`) | ||||||
| for reproducibility. | ||||||
| - **`latest` tag**: use only for testing PRs against openshift/release. | ||||||
| `latest` is a moving target and should not be used for required jobs -- | ||||||
| it is intended only for validation before promoting to `stable`. | ||||||
|
|
||||||
| ### Mirroring new versions to openshift CI | ||||||
|
|
||||||
| To mirror a new versioned tag for release branch use: | ||||||
|
|
||||||
| 1. Add an entry to `core-services/image-mirroring/_config.yaml` in openshift/release | ||||||
| 2. PR requires testplatform team review | ||||||
|
|
||||||
| The `latest` and `stable` floating tags are mirrored once and do not need | ||||||
| updates per version. | ||||||
|
|
||||||
| ## Updating the Go Version | ||||||
|
|
||||||
| To bump the Go version across all Docker images in this repository, use the automated script: | ||||||
|
|
||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all very nice and describes various bits and pieces. But what a random person who wants to bump a random dependency would look for is a step-by-step guide on how to get it out of the door.
We also need to agree on some sort of synchronization against multiple changes to this repo that are in flight. because there can only be one latest tag at a time so a single change to openshift/release can be tested at a given moment.