-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Docker: Mirror images to GitHub Container Registry #3098
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
Changes from 1 commit
6838346
82175dc
ea45e63
5985419
a87f7e5
6306dfc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,6 +145,9 @@ jobs: | |
| env: | ||
| DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | ||
| DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | ||
| - name: Login GitHub Container Registry | ||
| if: github.event.inputs.skip-build-push-image != 'true' | ||
| run: echo "${{ secrets.SELENIUM_CI_TOKEN }}" | docker login ghcr.io -u "${{ github.repository_owner }}" --password-stdin | ||
| - name: Deploy new images | ||
| if: github.event.inputs.skip-build-push-image != 'true' | ||
| uses: nick-invision/retry@master | ||
|
|
@@ -153,6 +156,14 @@ jobs: | |
| max_attempts: 5 | ||
| retry_wait_seconds: 300 | ||
| command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release | ||
| - name: Mirror versioned images to GHCR | ||
| if: github.event.inputs.skip-build-push-image != 'true' | ||
| uses: nick-invision/retry@master | ||
| with: | ||
| timeout_minutes: 30 | ||
| max_attempts: 5 | ||
| retry_wait_seconds: 300 | ||
| command: GHCR_NAMESPACE="ghcr.io/${{ github.repository_owner }}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_ghcr | ||
|
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. 2. build_date unquoted in command The workflow passes BUILD_DATE=${BUILD_DATE} without quotes, which can cause
word-splitting/globbing if the value ever contains whitespace or special characters. This violates
the requirement for robust shell quoting in scripts/configured commands.
Agent Prompt
|
||
| - name: Tag images as latest | ||
| if: github.event.inputs.skip-build-push-image != 'true' | ||
| run: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_latest | ||
|
|
@@ -164,6 +175,14 @@ jobs: | |
| max_attempts: 5 | ||
| retry_wait_seconds: 300 | ||
| command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_latest | ||
| - name: Mirror latest images to GHCR | ||
| if: github.event.inputs.skip-build-push-image != 'true' | ||
| uses: nick-invision/retry@master | ||
| with: | ||
| timeout_minutes: 20 | ||
| max_attempts: 5 | ||
| retry_wait_seconds: 300 | ||
| command: GHCR_NAMESPACE="ghcr.io/${{ github.repository_owner }}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_ghcr_latest | ||
| - name: Update package versions | ||
| run: make update_browser_versions_matrix | ||
| # make generate_latest_sbom | ||
|
|
@@ -176,6 +195,14 @@ jobs: | |
| max_attempts: 5 | ||
| retry_wait_seconds: 300 | ||
| command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} PUSH_IMAGE=true make tag_and_push_browser_images | ||
| - name: Mirror browser images to GHCR | ||
| if: github.event.inputs.skip-build-push-image != 'true' | ||
| uses: nick-invision/retry@master | ||
| with: | ||
| timeout_minutes: 30 | ||
| max_attempts: 5 | ||
| retry_wait_seconds: 300 | ||
| command: GHCR_NAMESPACE="ghcr.io/${{ github.repository_owner }}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_and_push_browser_images_ghcr | ||
| - name: Delete previous nightly tag & release if any | ||
| uses: dev-drprasad/delete-tag-and-release@master | ||
| with: | ||
|
|
||
|
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. If space is a concern on ghcr, perhaps we should skip uploading nightly builds to ghcri. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,7 @@ KEDA_BASED_NAME := $(or $(KEDA_BASED_NAME),$(KEDA_BASED_NAME),kedacore) | |
| KEDA_BASED_TAG := $(or $(KEDA_BASED_TAG),$(KEDA_BASED_TAG),2.19.0) | ||
| TEST_PATCHED_KEDA := $(or $(TEST_PATCHED_KEDA),$(TEST_PATCHED_KEDA),false) | ||
| TRACING_EXPORTER_ENDPOINT := $(or $(TRACING_EXPORTER_ENDPOINT),$(TRACING_EXPORTER_ENDPOINT),http://\$$KUBERNETES_NODE_HOST_IP:4317) | ||
| GHCR_NAMESPACE := $(or $(GHCR_NAMESPACE),$(GHCR_NAMESPACE),ghcr.io/seleniumhq) | ||
|
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. 1. ghcr_namespace defaults to seleniumhq The GHCR namespace is set to ghcr.io/seleniumhq, but the compliance requirement specifies publishing under ghcr.io/selenium/.... This can break the expected pull path and fails the required registry naming scheme. Agent Prompt
|
||
|
|
||
| all: hub \ | ||
| distributor \ | ||
|
|
@@ -468,6 +469,28 @@ tag_and_push_edge_images: | |
| tag_and_push_firefox_images: | ||
| ./tag_and_push_browser_images.sh $(VERSION) $(BUILD_DATE) $(NAMESPACE) $(PUSH_IMAGE) firefox $(RELEASE_OLD_VERSION) | ||
|
|
||
| tag_and_push_browser_images_ghcr: | ||
| for image in node-chrome standalone-chrome \ | ||
| node-chromium standalone-chromium \ | ||
| node-chrome-for-testing standalone-chrome-for-testing \ | ||
| node-edge standalone-edge \ | ||
| node-firefox standalone-firefox; do \ | ||
| docker images --format "{{.Tag}}" "$(NAME)/$$image" | grep -v "^<none>$$" | while IFS= read -r tag; do \ | ||
| docker buildx imagetools create \ | ||
| --tag $(GHCR_NAMESPACE)/$$image:$$tag \ | ||
| docker.io/$(NAME)/$$image:$$tag ; \ | ||
| done ; \ | ||
| done | ||
|
|
||
| mirror_browser_images_ghcr: | ||
| for image in node-$(BROWSER_NAME) standalone-$(BROWSER_NAME); do \ | ||
| docker images --format "{{.Tag}}" "$(NAME)/$$image" | grep -v "^<none>$$" | while IFS= read -r tag; do \ | ||
| docker buildx imagetools create \ | ||
| --tag $(GHCR_NAMESPACE)/$$image:$$tag \ | ||
| docker.io/$(NAME)/$$image:$$tag ; \ | ||
| done ; \ | ||
| done | ||
|
Comment on lines
+472
to
+492
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. 4. Mirror can silently no-op The new Makefile GHCR mirroring targets can exit successfully without mirroring anything when docker images returns no tags, because the grep | while pipeline returns success even on empty input. Agent Prompt
|
||
|
|
||
| tag_ffmpeg_latest: | ||
| docker tag $(NAME)/ffmpeg:$(FFMPEG_VERSION)-$(BUILD_DATE) $(NAME)/ffmpeg:latest | ||
| docker tag $(NAME)/ffmpeg:$(FFMPEG_VERSION)-$(BUILD_DATE) $(NAME)/ffmpeg:$(FFMPEG_VERSION) | ||
|
|
@@ -537,6 +560,18 @@ release_latest: | |
| docker push $(NAME)/standalone-all-browsers:latest | ||
| docker push $(NAME)/video:latest | ||
|
|
||
| release_ghcr_latest: | ||
| for image in base hub distributor router sessions session-queue event-bus \ | ||
| node-base node-chrome node-chromium node-chrome-for-testing node-edge \ | ||
| node-firefox node-docker node-kubernetes node-all-browsers \ | ||
| standalone-chrome standalone-chromium standalone-chrome-for-testing \ | ||
| standalone-edge standalone-firefox standalone-docker \ | ||
| standalone-kubernetes standalone-all-browsers video; do \ | ||
| docker buildx imagetools create \ | ||
| --tag $(GHCR_NAMESPACE)/$$image:latest \ | ||
| docker.io/$(NAME)/$$image:latest ; \ | ||
| done | ||
|
|
||
| generate_latest_sbom: | ||
| NAME=$(NAME) FILTER_IMAGE_TAG=latest OUTPUT_FILE=$(SBOM_OUTPUT) ./generate_sbom.sh | ||
|
|
||
|
|
@@ -600,6 +635,18 @@ release_nightly: | |
| docker push $(NAME)/standalone-all-browsers:nightly | ||
| docker push $(NAME)/video:nightly | ||
|
|
||
| release_ghcr_nightly: | ||
| for image in base hub distributor router sessions session-queue event-bus \ | ||
| node-base node-chrome node-chromium node-chrome-for-testing node-edge \ | ||
| node-firefox node-docker node-kubernetes node-all-browsers \ | ||
| standalone-chrome standalone-chromium standalone-chrome-for-testing \ | ||
| standalone-edge standalone-firefox standalone-docker \ | ||
| standalone-kubernetes standalone-all-browsers video; do \ | ||
| docker buildx imagetools create \ | ||
| --tag $(GHCR_NAMESPACE)/$$image:nightly \ | ||
| docker.io/$(NAME)/$$image:nightly ; \ | ||
| done | ||
|
|
||
| generate_nightly_sbom: | ||
| NAME=$(NAME) FILTER_IMAGE_TAG=nightly OUTPUT_FILE=$(SBOM_OUTPUT) ./generate_sbom.sh | ||
|
|
||
|
|
@@ -800,6 +847,23 @@ release: tag_major_minor | |
| docker push $(NAME)/standalone-all-browsers:$(MAJOR_MINOR_PATCH) | ||
| docker push $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) | ||
|
|
||
| release_ghcr: | ||
| for image in base hub distributor router sessions session-queue event-bus \ | ||
| node-base node-chrome node-chromium node-chrome-for-testing node-edge \ | ||
| node-firefox node-docker node-kubernetes node-all-browsers \ | ||
| standalone-chrome standalone-chromium standalone-chrome-for-testing \ | ||
| standalone-edge standalone-firefox standalone-docker \ | ||
| standalone-kubernetes standalone-all-browsers; do \ | ||
| for tag in $(TAG_VERSION) $(MAJOR) $(MAJOR).$(MINOR) $(MAJOR_MINOR_PATCH); do \ | ||
| docker buildx imagetools create \ | ||
| --tag $(GHCR_NAMESPACE)/$$image:$$tag \ | ||
| docker.io/$(NAME)/$$image:$$tag ; \ | ||
| done ; \ | ||
| done | ||
| docker buildx imagetools create \ | ||
| --tag $(GHCR_NAMESPACE)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) \ | ||
| docker.io/$(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) | ||
|
|
||
| start_test_site: | ||
| @docker rm -f the-internet 2>/dev/null || true | ||
| @docker run --rm --name the-internet -d -p 5001:5000 ndviet/the-internet:latest | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.