chore: move all images to new GCP project (#18324)

This commit is contained in:
Dean Sheather
2025-06-11 23:06:31 +10:00
committed by GitHub
parent af4a6682b4
commit ae3882a600
10 changed files with 21 additions and 17 deletions

View File

@ -582,7 +582,7 @@ jobs:
# NOTE: this could instead be defined as a matrix strategy, but we want to
# only block merging if tests on postgres 13 fail. Using a matrix strategy
# here makes the check in the above `required` job rather complicated.
test-go-pg-16:
test-go-pg-17:
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
needs:
- changes
@ -613,11 +613,11 @@ jobs:
id: download-cache
uses: ./.github/actions/test-cache/download
with:
key-prefix: test-go-pg-16-${{ runner.os }}-${{ runner.arch }}
key-prefix: test-go-pg-17-${{ runner.os }}-${{ runner.arch }}
- name: Test with PostgreSQL Database
env:
POSTGRES_VERSION: "16"
POSTGRES_VERSION: "17"
TS_DEBUG_DISCO: "true"
TEST_RETRIES: 2
run: |
@ -719,7 +719,7 @@ jobs:
# c.f. discussion on https://github.com/coder/coder/pull/15106
- name: Run Tests
env:
POSTGRES_VERSION: "16"
POSTGRES_VERSION: "17"
run: |
make test-postgres-docker
DB=ci gotestsum --junitfile="gotests.xml" --packages="./..." --rerun-fails=2 --rerun-fails-abort-on-data-race -- -race -parallel 4 -p 4

View File

@ -36,7 +36,9 @@ GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
GOOS_BIN_EXT := $(if $(filter windows, $(GOOS)),.exe,)
VERSION := $(shell ./scripts/version.sh)
POSTGRES_VERSION ?= 16
POSTGRES_VERSION ?= 17
POSTGRES_IMAGE ?= us-docker.pkg.dev/coder-v2-images-public/public/postgres:$(POSTGRES_VERSION)
# Use the highest ZSTD compression level in CI.
ifdef CI
@ -949,12 +951,12 @@ test-postgres-docker:
docker rm -f test-postgres-docker-${POSTGRES_VERSION} || true
# Try pulling up to three times to avoid CI flakes.
docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} || {
docker pull ${POSTGRES_IMAGE} || {
retries=2
for try in $(seq 1 ${retries}); do
echo "Failed to pull image, retrying (${try}/${retries})..."
sleep 1
if docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION}; then
if docker pull ${POSTGRES_IMAGE}; then
break
fi
done
@ -982,7 +984,7 @@ test-postgres-docker:
--restart no \
--detach \
--memory 16GB \
gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} \
${POSTGRES_IMAGE} \
-c shared_buffers=2GB \
-c effective_cache_size=1GB \
-c work_mem=8MB \

View File

@ -298,7 +298,7 @@ func PGDumpSchemaOnly(dbURL string) ([]byte, error) {
"run",
"--rm",
"--network=host",
fmt.Sprintf("gcr.io/coder-dev-1/postgres:%d", minimumPostgreSQLVersion),
fmt.Sprintf("%s:%d", postgresImage, minimumPostgreSQLVersion),
}, cmdArgs...)
}
cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...) //#nosec

View File

@ -26,6 +26,8 @@ import (
"github.com/coder/retry"
)
const postgresImage = "us-docker.pkg.dev/coder-v2-images-public/public/postgres"
type ConnectionParams struct {
Username string
Password string
@ -379,8 +381,8 @@ func openContainer(t TBSubset, opts DBContainerOptions) (container, func(), erro
return container{}, nil, xerrors.Errorf("create tempdir: %w", err)
}
runOptions := dockertest.RunOptions{
Repository: "gcr.io/coder-dev-1/postgres",
Tag: "13",
Repository: postgresImage,
Tag: strconv.Itoa(minimumPostgreSQLVersion),
Env: []string{
"POSTGRES_PASSWORD=postgres",
"POSTGRES_USER=postgres",

View File

@ -31,7 +31,7 @@ services:
database:
# Minimum supported version is 13.
# More versions here: https://hub.docker.com/_/postgres
image: "postgres:16"
image: "postgres:17"
ports:
- "5432:5432"
environment:

View File

@ -39,7 +39,7 @@ certificates, you'll need a domain name that resolves to your Caddy server.
condition: service_healthy
database:
image: "postgres:16"
image: "postgres:17"
ports:
- "5432:5432"
environment:

View File

@ -87,7 +87,7 @@ RUN apt-get update && \
rm -rf /tmp/go/src
# alpine:3.18
FROM gcr.io/coder-dev-1/alpine@sha256:25fad2a32ad1f6f510e528448ae1ec69a28ef81916a004d3629874104f8a7f70 AS proto
FROM us-docker.pkg.dev/coder-v2-images-public/public/alpine@sha256:fd032399cd767f310a1d1274e81cab9f0fd8a49b3589eba2c3420228cd45b6a7 AS proto
WORKDIR /tmp
RUN apk add curl unzip
RUN curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip && \

View File

@ -1,6 +1,6 @@
# This image is used to run scaletest jobs and, although it is inside
# the template directory, it is built separately and pushed to
# gcr.io/coder-dev-1/scaletest-runner:latest.
# us-docker.pkg.dev/coder-v2-images-public/public/scaletest-runner:latest.
#
# Future improvements will include versioning and including the version
# in the template push.

View File

@ -822,7 +822,7 @@ resource "kubernetes_pod" "main" {
container {
name = "dev"
image = "gcr.io/coder-dev-1/scaletest-runner:latest"
image = "us-docker.pkg.dev/coder-v2-images-public/public/scaletest-runner:latest"
image_pull_policy = "Always"
command = ["sh", "-c", coder_agent.main.init_script]
security_context {

View File

@ -408,7 +408,7 @@ RUN apt-get update && \
rm -rf /tmp/go/src
# alpine:3.18
FROM gcr.io/coder-dev-1/alpine@sha256:25fad2a32ad1f6f510e528448ae1ec69a28ef81916a004d3629874104f8a7f70 AS proto
FROM us-docker.pkg.dev/coder-v2-images-public/public/alpine@sha256:fd032399cd767f310a1d1274e81cab9f0fd8a49b3589eba2c3420228cd45b6a7 AS proto
WORKDIR /tmp
RUN apk add curl unzip
RUN curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip && \