From 593ffb3886aff45d048235899335e9d493104dd1 Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Fri, 2 Oct 2026 23:49:36 +1000 Subject: [PATCH] ci: switch Go steps to estate gobuilder + S3 build cache Moves build/test/pre-commit/release Go steps off golang:1.25 and the old almalinux9-gobuilder onto the verified gobuilder:0.1.2-alma9 image, and wires GOCACHEPROG (go-cache-plugin) at an absolute cache dir to the shared S3-backed Go cache. Leaves the golangci-lint step on its dedicated image (gobuilder has no golangci-lint binary) and leaves the rpm/upload/release steps untouched (no Go toolchain). --- .woodpecker/build.yaml | 14 +++++++++++++- .woodpecker/pre-commit.yaml | 14 +++++++++++++- .woodpecker/release.yaml | 28 ++++++++++++++++++++++++++-- .woodpecker/test.yaml | 14 +++++++++++++- 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index 74123b5..542c721 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -3,7 +3,19 @@ when: steps: - name: build - image: golang:1.25 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + 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-node-lookup + GOCACHE_METRICS: "true" + 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 commands: - make build backend_options: diff --git a/.woodpecker/pre-commit.yaml b/.woodpecker/pre-commit.yaml index d57b508..a0ad822 100644 --- a/.woodpecker/pre-commit.yaml +++ b/.woodpecker/pre-commit.yaml @@ -3,7 +3,19 @@ when: steps: - name: pre-commit - image: git.unkin.net/unkin/almalinux9-gobuilder:20260606 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + 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-node-lookup + GOCACHE_METRICS: "true" + 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 commands: - uvx pre-commit run --all-files backend_options: diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml index 528b18c..3187e90 100644 --- a/.woodpecker/release.yaml +++ b/.woodpecker/release.yaml @@ -3,7 +3,19 @@ when: steps: - name: test - image: golang:1.25 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + 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-node-lookup + GOCACHE_METRICS: "true" + 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 commands: - go test -race ./... backend_options: @@ -21,7 +33,19 @@ steps: # cross-platform binaries attached to the Gitea release. Each tool is a # separate main package, so they are built individually per os/arch. - name: build - image: git.unkin.net/unkin/almalinux9-gobuilder:20260606 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + 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-node-lookup + GOCACHE_METRICS: "true" + 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 commands: - make build VERSION=${CI_COMMIT_TAG} # Shell variables/expansions are escaped as $$ so Woodpecker leaves them diff --git a/.woodpecker/test.yaml b/.woodpecker/test.yaml index 5e179a7..e4a83bc 100644 --- a/.woodpecker/test.yaml +++ b/.woodpecker/test.yaml @@ -18,7 +18,19 @@ steps: cpu: 2 - name: test - image: golang:1.25 + image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9 + 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-node-lookup + GOCACHE_METRICS: "true" + 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 commands: - go test -v -race ./... backend_options: