From 62ef1e5822d2c843abb814396df28a176fcc4b96 Mon Sep 17 00:00:00 2001 From: Noah Santschi-Cooney Date: Wed, 14 Aug 2024 17:13:24 +0100 Subject: [PATCH 1/2] feat(ci): don't push to dockerhub outside of release builds --- dev/ci/internal/ci/images_operations.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/ci/internal/ci/images_operations.go b/dev/ci/internal/ci/images_operations.go index 66291cf3863e..1151c3b01df9 100644 --- a/dev/ci/internal/ci/images_operations.go +++ b/dev/ci/internal/ci/images_operations.go @@ -95,12 +95,14 @@ func bazelPushImagesCmd(c Config, isCandidate bool, opts ...bk.StepOpt) func(*bk } // Default registries. devRegistry := images.SourcegraphDockerDevRegistry - prodRegistry := images.SourcegraphDockerPublishRegistry - additionalProdRegistry := images.SourcegraphArtifactRegistryPublicRegistry + prodRegistry := images.SourcegraphArtifactRegistryPublicRegistry + var additionalProdRegistry string // If we're building an internal release, we push the final images to that specific registry instead. // See also: release_operations.go switch c.RunType { + case runtype.PromoteRelease: + additionalProdRegistry = images.SourcegraphDockerPublishRegistry case runtype.InternalRelease: prodRegistry = images.SourcegraphInternalReleaseRegistry // we don't want to push to the public registry on internal releases, but we do want to publish the release to the cloud ephemeral registry From 9c5e551b8d0b504cdfa71b615cbb5b4e1d613bf6 Mon Sep 17 00:00:00 2001 From: Noah Santschi-Cooney Date: Thu, 15 Aug 2024 14:22:03 +0100 Subject: [PATCH 2/2] sg.config.yaml and release ops --- dev/ci/internal/ci/release_operations.go | 2 +- doc/dev/background-information/sg/index.md | 2 +- sg.config.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/ci/internal/ci/release_operations.go b/dev/ci/internal/ci/release_operations.go index 4b84c6d0959d..b1b5af108747 100644 --- a/dev/ci/internal/ci/release_operations.go +++ b/dev/ci/internal/ci/release_operations.go @@ -58,7 +58,7 @@ func releasePromoteImages(c Config) operations.Operation { // releaseTestOperations runs the script defined in release.yaml that tests the release. func releaseTestOperation(c Config) operations.Operation { devRegistry := images.SourcegraphDockerDevRegistry - prodRegistry := images.SourcegraphDockerPublishRegistry + prodRegistry := images.SourcegraphArtifactRegistryPublicRegistry if c.RunType.Is(runtype.InternalRelease) { prodRegistry = images.SourcegraphInternalReleaseRegistry diff --git a/doc/dev/background-information/sg/index.md b/doc/dev/background-information/sg/index.md index 07be2ceff337..c407babc615d 100644 --- a/doc/dev/background-information/sg/index.md +++ b/doc/dev/background-information/sg/index.md @@ -245,7 +245,7 @@ OFFLINE=true sg start Ensure that the `sourcegraph/syntax-highlighter:insiders` image is already available locally. If not, pull it with the following command before going offline to ensure that offline mode works seamlessly: ```bash -docker pull -q sourcegraph/syntax-highlighter:insiders +docker pull -q us-docker.pkg.dev/sourcegraph-public-images/sourcegraph-public-images/syntax-highlighter:insiders ``` ## `sg` and pre-commit hooks diff --git a/sg.config.yaml b/sg.config.yaml index d31bcd7f7200..c28ae9b00406 100644 --- a/sg.config.yaml +++ b/sg.config.yaml @@ -590,7 +590,7 @@ commands: cmd: | docker run --name=syntax-highlighter --rm -p9238:9238 \ -e WORKERS=1 -e ROCKET_ADDRESS=0.0.0.0 \ - sourcegraph/syntax-highlighter:insiders + us-docker.pkg.dev/sourcegraph-public-images/sourcegraph-public-images/syntax-highlighter:insiders install: | # Remove containers by the old name, too. docker inspect syntect_server >/dev/null 2>&1 && docker rm -f syntect_server || true @@ -598,7 +598,7 @@ commands: # Pull syntax-highlighter latest insider image, only during install, but # skip if OFFLINE=true is set. if [[ "$OFFLINE" != "true" ]]; then - docker pull -q sourcegraph/syntax-highlighter:insiders + docker pull -q us-docker.pkg.dev/sourcegraph-public-images/sourcegraph-public-images/syntax-highlighter:insiders fi zoekt-indexserver-template: &zoekt_indexserver_template