mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: move all images to new GCP project (#18324)
This commit is contained in:
8
.github/workflows/ci.yaml
vendored
8
.github/workflows/ci.yaml
vendored
@ -582,7 +582,7 @@ jobs:
|
|||||||
# NOTE: this could instead be defined as a matrix strategy, but we want to
|
# 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
|
# only block merging if tests on postgres 13 fail. Using a matrix strategy
|
||||||
# here makes the check in the above `required` job rather complicated.
|
# 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' }}
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
||||||
needs:
|
needs:
|
||||||
- changes
|
- changes
|
||||||
@ -613,11 +613,11 @@ jobs:
|
|||||||
id: download-cache
|
id: download-cache
|
||||||
uses: ./.github/actions/test-cache/download
|
uses: ./.github/actions/test-cache/download
|
||||||
with:
|
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
|
- name: Test with PostgreSQL Database
|
||||||
env:
|
env:
|
||||||
POSTGRES_VERSION: "16"
|
POSTGRES_VERSION: "17"
|
||||||
TS_DEBUG_DISCO: "true"
|
TS_DEBUG_DISCO: "true"
|
||||||
TEST_RETRIES: 2
|
TEST_RETRIES: 2
|
||||||
run: |
|
run: |
|
||||||
@ -719,7 +719,7 @@ jobs:
|
|||||||
# c.f. discussion on https://github.com/coder/coder/pull/15106
|
# c.f. discussion on https://github.com/coder/coder/pull/15106
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
env:
|
env:
|
||||||
POSTGRES_VERSION: "16"
|
POSTGRES_VERSION: "17"
|
||||||
run: |
|
run: |
|
||||||
make test-postgres-docker
|
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
|
DB=ci gotestsum --junitfile="gotests.xml" --packages="./..." --rerun-fails=2 --rerun-fails-abort-on-data-race -- -race -parallel 4 -p 4
|
||||||
|
10
Makefile
10
Makefile
@ -36,7 +36,9 @@ GOOS := $(shell go env GOOS)
|
|||||||
GOARCH := $(shell go env GOARCH)
|
GOARCH := $(shell go env GOARCH)
|
||||||
GOOS_BIN_EXT := $(if $(filter windows, $(GOOS)),.exe,)
|
GOOS_BIN_EXT := $(if $(filter windows, $(GOOS)),.exe,)
|
||||||
VERSION := $(shell ./scripts/version.sh)
|
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.
|
# Use the highest ZSTD compression level in CI.
|
||||||
ifdef CI
|
ifdef CI
|
||||||
@ -949,12 +951,12 @@ test-postgres-docker:
|
|||||||
docker rm -f test-postgres-docker-${POSTGRES_VERSION} || true
|
docker rm -f test-postgres-docker-${POSTGRES_VERSION} || true
|
||||||
|
|
||||||
# Try pulling up to three times to avoid CI flakes.
|
# 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
|
retries=2
|
||||||
for try in $(seq 1 ${retries}); do
|
for try in $(seq 1 ${retries}); do
|
||||||
echo "Failed to pull image, retrying (${try}/${retries})..."
|
echo "Failed to pull image, retrying (${try}/${retries})..."
|
||||||
sleep 1
|
sleep 1
|
||||||
if docker pull gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION}; then
|
if docker pull ${POSTGRES_IMAGE}; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -982,7 +984,7 @@ test-postgres-docker:
|
|||||||
--restart no \
|
--restart no \
|
||||||
--detach \
|
--detach \
|
||||||
--memory 16GB \
|
--memory 16GB \
|
||||||
gcr.io/coder-dev-1/postgres:${POSTGRES_VERSION} \
|
${POSTGRES_IMAGE} \
|
||||||
-c shared_buffers=2GB \
|
-c shared_buffers=2GB \
|
||||||
-c effective_cache_size=1GB \
|
-c effective_cache_size=1GB \
|
||||||
-c work_mem=8MB \
|
-c work_mem=8MB \
|
||||||
|
@ -298,7 +298,7 @@ func PGDumpSchemaOnly(dbURL string) ([]byte, error) {
|
|||||||
"run",
|
"run",
|
||||||
"--rm",
|
"--rm",
|
||||||
"--network=host",
|
"--network=host",
|
||||||
fmt.Sprintf("gcr.io/coder-dev-1/postgres:%d", minimumPostgreSQLVersion),
|
fmt.Sprintf("%s:%d", postgresImage, minimumPostgreSQLVersion),
|
||||||
}, cmdArgs...)
|
}, cmdArgs...)
|
||||||
}
|
}
|
||||||
cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...) //#nosec
|
cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...) //#nosec
|
||||||
|
@ -26,6 +26,8 @@ import (
|
|||||||
"github.com/coder/retry"
|
"github.com/coder/retry"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const postgresImage = "us-docker.pkg.dev/coder-v2-images-public/public/postgres"
|
||||||
|
|
||||||
type ConnectionParams struct {
|
type ConnectionParams struct {
|
||||||
Username string
|
Username string
|
||||||
Password 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)
|
return container{}, nil, xerrors.Errorf("create tempdir: %w", err)
|
||||||
}
|
}
|
||||||
runOptions := dockertest.RunOptions{
|
runOptions := dockertest.RunOptions{
|
||||||
Repository: "gcr.io/coder-dev-1/postgres",
|
Repository: postgresImage,
|
||||||
Tag: "13",
|
Tag: strconv.Itoa(minimumPostgreSQLVersion),
|
||||||
Env: []string{
|
Env: []string{
|
||||||
"POSTGRES_PASSWORD=postgres",
|
"POSTGRES_PASSWORD=postgres",
|
||||||
"POSTGRES_USER=postgres",
|
"POSTGRES_USER=postgres",
|
||||||
|
@ -31,7 +31,7 @@ services:
|
|||||||
database:
|
database:
|
||||||
# Minimum supported version is 13.
|
# Minimum supported version is 13.
|
||||||
# More versions here: https://hub.docker.com/_/postgres
|
# More versions here: https://hub.docker.com/_/postgres
|
||||||
image: "postgres:16"
|
image: "postgres:17"
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
environment:
|
environment:
|
||||||
|
@ -39,7 +39,7 @@ certificates, you'll need a domain name that resolves to your Caddy server.
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
||||||
database:
|
database:
|
||||||
image: "postgres:16"
|
image: "postgres:17"
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
environment:
|
environment:
|
||||||
|
@ -87,7 +87,7 @@ RUN apt-get update && \
|
|||||||
rm -rf /tmp/go/src
|
rm -rf /tmp/go/src
|
||||||
|
|
||||||
# alpine:3.18
|
# 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
|
WORKDIR /tmp
|
||||||
RUN apk add curl unzip
|
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 && \
|
RUN curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip && \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# This image is used to run scaletest jobs and, although it is inside
|
# This image is used to run scaletest jobs and, although it is inside
|
||||||
# the template directory, it is built separately and pushed to
|
# 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
|
# Future improvements will include versioning and including the version
|
||||||
# in the template push.
|
# in the template push.
|
||||||
|
@ -822,7 +822,7 @@ resource "kubernetes_pod" "main" {
|
|||||||
|
|
||||||
container {
|
container {
|
||||||
name = "dev"
|
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"
|
image_pull_policy = "Always"
|
||||||
command = ["sh", "-c", coder_agent.main.init_script]
|
command = ["sh", "-c", coder_agent.main.init_script]
|
||||||
security_context {
|
security_context {
|
||||||
|
@ -408,7 +408,7 @@ RUN apt-get update && \
|
|||||||
rm -rf /tmp/go/src
|
rm -rf /tmp/go/src
|
||||||
|
|
||||||
# alpine:3.18
|
# 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
|
WORKDIR /tmp
|
||||||
RUN apk add curl unzip
|
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 && \
|
RUN curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip && \
|
||||||
|
Reference in New Issue
Block a user