From 1c4d2db5e8d02ba81494600ffef5087bf16307b4 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Fri, 2 Oct 2026 23:40:40 +1000 Subject: [PATCH] Switch Go CI steps to gobuilder + S3 build cache Cuts go vet/go test wall time via a shared package-object cache. - pre-commit and test steps move from docker.io/golang:1.26 to the pinned estate gobuilder image (go1.26.7, trusts the internal CA) - wire GOCACHEPROG to go-cache-plugin against the S3 cache bucket, creds from org-level GOCACHE_AWS_* secrets - bump test step memory limit to 4Gi for envtest + -race headroom - buildx steps (build.yaml, docker.yaml) untouched: compilation happens inside Dockerfile.operator, not the Woodpecker step --- .woodpecker/pre-commit.yaml | 13 ++++++++++++- .woodpecker/test.yaml | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.woodpecker/pre-commit.yaml b/.woodpecker/pre-commit.yaml index fbaa75b..516598e 100644 --- a/.woodpecker/pre-commit.yaml +++ b/.woodpecker/pre-commit.yaml @@ -3,10 +3,21 @@ when: steps: - name: pre-commit - image: golang:1.26 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 commands: - test -z "$(gofmt -l cmd/ internal/)" - go vet -mod=vendor ./... + environment: + GOCACHE_S3_BUCKET: gocache + GOCACHE_S3_REGION: us-east-1 + GOCACHE_S3_ENDPOINT_URL: "https://s3.ceph.unkin.net" + GOCACHE_S3_PATH_STYLE: "true" + GOCACHE_KEY_PREFIX: ci-autobackup-operator + GOCACHEPROG: "go-cache-plugin --cache-dir=/tmp/gocache" + AWS_ACCESS_KEY_ID: + from_secret: GOCACHE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY backend_options: kubernetes: serviceAccountName: autobackup-operator-ci diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index 561f516..e7b3d2f 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -3,12 +3,23 @@ when: steps: - name: test - image: golang:1.26 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 commands: # Fetch the envtest control-plane binaries; the controller tests skip # gracefully if this cannot be downloaded. - export KUBEBUILDER_ASSETS="$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use 1.31.0 -p path 2>/dev/null)" - go test -race -count=1 -mod=vendor ./... + environment: + GOCACHE_S3_BUCKET: gocache + GOCACHE_S3_REGION: us-east-1 + GOCACHE_S3_ENDPOINT_URL: "https://s3.ceph.unkin.net" + GOCACHE_S3_PATH_STYLE: "true" + GOCACHE_KEY_PREFIX: ci-autobackup-operator + GOCACHEPROG: "go-cache-plugin --cache-dir=/tmp/gocache" + AWS_ACCESS_KEY_ID: + from_secret: GOCACHE_AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: GOCACHE_AWS_SECRET_ACCESS_KEY backend_options: kubernetes: serviceAccountName: autobackup-operator-ci @@ -17,5 +28,5 @@ steps: memory: 1Gi cpu: 1 limits: - memory: 2Gi + memory: 4Gi cpu: 2