6 Commits

Author SHA1 Message Date
unkin-agent 1dada3d5b0 ci: move Go steps to gobuilder, enable S3 build cache
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
Standardizes on the estate gobuilder image for every step invoking
the Go toolchain and wires in the shared S3-backed GOCACHEPROG.

- Replace golang:1.25 and almalinux9-gobuilder:20260606 with
  gobuilder:0.1.2-alma9 in build/test/pre-commit/release(build)
- Add GOCACHE_* env + AWS creds from org secrets to those steps
- Bump their k8s resource requests/limits for compile+cache overhead
2026-10-02 23:53:58 +10:00
benvin 3edff726f2 Merge pull request 'Build an OpenBao RPM alongside the Vault one' (#3) from benvin/openbao-rpm into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #3
2026-07-06 23:21:49 +10:00
unkinben ac38203b8e Build an OpenBao RPM alongside the Vault one
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
The plugin runs under both Vault and OpenBao, but nfpm only produced a
single RPM that installs into /opt/vault-plugins. OpenBao hosts expect
their plugins under /opt/openbao-plugins, so a second package is needed.

- Parameterize nfpm.yaml with PACKAGE_NAME, PACKAGE_PLUGIN_DIR, and
  PACKAGE_PREINSTALL so one config renders per target server
- Replace the static preinstall.sh with preinstall.sh.tmpl that
  mkdir -p's the flavour's plugin directory
- Build two RPMs in build-rpm.sh via a build_flavor helper:
  vault-plugin-secrets-litellm -> /opt/vault-plugins and
  openbao-plugin-secrets-litellm -> /opt/openbao-plugins
2026-07-06 23:14:43 +10:00
benvin a55bc77f38 Merge pull request 'Set kubernetes backend options on all woodpecker steps' (#2) from benvin/woodpecker-backend-options into main
Reviewed-on: #2
2026-07-03 13:28:12 +10:00
unkinben 0e8acca9c6 Set kubernetes backend options on all woodpecker steps
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Give every CI step explicit resource requests/limits and the default service
account (matching the pre-commit step), so the k8s woodpecker backend schedules
them with bounded resources.

- build/test/lint/package steps: 512Mi/1cpu requests, 2Gi/2cpu limits
- upload step: lighter 128Mi/100m requests, 512Mi/500m limits
2026-07-03 13:13:48 +10:00
benvin 0edc93f6db Merge pull request 'Add LiteLLM dynamic secrets engine implementation' (#1) from benvin/initial-implementation into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #1
2026-07-03 13:04:56 +10:00
8 changed files with 157 additions and 20 deletions
+23 -1
View File
@@ -3,6 +3,28 @@ when:
steps: steps:
- name: build - name: build
image: golang:1.25 image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9
commands: commands:
- make build - make build
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-vault-plugin-secrets-litellm
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
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 3Gi
cpu: 2
+15 -3
View File
@@ -3,16 +3,28 @@ when:
steps: steps:
- name: pre-commit - 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
commands: commands:
- uvx pre-commit run --all-files - uvx pre-commit run --all-files
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-vault-plugin-secrets-litellm
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
backend_options: backend_options:
kubernetes: kubernetes:
serviceAccountName: default serviceAccountName: default
resources: resources:
requests: requests:
memory: 512Mi memory: 1Gi
cpu: 1 cpu: 1
limits: limits:
memory: 2Gi memory: 3Gi
cpu: 2 cpu: 2
+43 -1
View File
@@ -3,15 +3,47 @@ when:
steps: steps:
- name: build - name: build
image: git.unkin.net/unkin/almalinux9-gobuilder:20260606 image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9
commands: commands:
- make build VERSION=${CI_COMMIT_TAG} - make build VERSION=${CI_COMMIT_TAG}
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-vault-plugin-secrets-litellm
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
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 3Gi
cpu: 2
- name: package - name: package
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
commands: commands:
- ./scripts/build-rpm.sh ${CI_COMMIT_TAG} - ./scripts/build-rpm.sh ${CI_COMMIT_TAG}
depends_on: [build] depends_on: [build]
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 512Mi
cpu: 1
limits:
memory: 2Gi
cpu: 2
- name: upload - name: upload
image: git.unkin.net/unkin/almalinux9-base:20260606 image: git.unkin.net/unkin/almalinux9-base:20260606
@@ -36,3 +68,13 @@ steps:
--data-binary @"$$rpm" --data-binary @"$$rpm"
done done
depends_on: [package] depends_on: [package]
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 128Mi
cpu: 100m
limits:
memory: 512Mi
cpu: 500m
+46 -2
View File
@@ -3,11 +3,55 @@ when:
steps: steps:
- name: lint - name: lint
image: golang:1.25 image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9
commands: commands:
- make lint - make lint
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-vault-plugin-secrets-litellm
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
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 3Gi
cpu: 2
- name: test - name: test
image: golang:1.25 image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder:0.1.2-alma9
commands: commands:
- make test - make test
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-vault-plugin-secrets-litellm
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
backend_options:
kubernetes:
serviceAccountName: default
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 3Gi
cpu: 2
+8 -6
View File
@@ -1,6 +1,8 @@
--- ---
# nfpm config for building the vault-plugin-secrets-litellm RPM. # nfpm config for building the vault-plugin-secrets-litellm RPM.
# Rendered through envsubst (see scripts/build-rpm.sh) then fed to `nfpm pkg`. # Rendered through envsubst (see scripts/build-rpm.sh) then fed to `nfpm pkg`.
# Built once per target server (Vault, OpenBao); PACKAGE_NAME and
# PACKAGE_PLUGIN_DIR vary per flavour.
name: ${PACKAGE_NAME} name: ${PACKAGE_NAME}
version: ${PACKAGE_VERSION} version: ${PACKAGE_VERSION}
@@ -18,19 +20,19 @@ license: ${PACKAGE_LICENSE}
disable_globbing: false disable_globbing: false
replaces: replaces:
- vault-plugin-secrets-litellm - ${PACKAGE_NAME}
provides: provides:
- vault-plugin-secrets-litellm - ${PACKAGE_NAME}
# Install the plugin binary into the Vault/OpenBao plugin directory. Point the # Install the plugin binary into the server's plugin directory. Point the
# server's plugin_directory at /opt/vault-plugins to pick it up. # server's plugin_directory at PACKAGE_PLUGIN_DIR to pick it up.
contents: contents:
- src: dist/vault-plugin-secrets-litellm - src: dist/vault-plugin-secrets-litellm
dst: /opt/vault-plugins/vault-plugin-secrets-litellm dst: ${PACKAGE_PLUGIN_DIR}/vault-plugin-secrets-litellm
file_info: file_info:
mode: 0755 mode: 0755
owner: root owner: root
group: root group: root
scripts: scripts:
preinstall: packaging/scripts/preinstall.sh preinstall: ${PACKAGE_PREINSTALL}
-3
View File
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
# Ensure the plugin directory exists before the binary is laid down.
mkdir -p /opt/vault-plugins
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Ensure the plugin directory exists before the binary is laid down.
# Rendered per flavour via envsubst (see scripts/build-rpm.sh).
mkdir -p ${PACKAGE_PLUGIN_DIR}
+18 -4
View File
@@ -1,6 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Package the (already built) plugin binary into an RPM with nfpm. # Package the (already built) plugin binary into RPMs with nfpm.
# Builds one RPM per target server: Vault (/opt/vault-plugins) and
# OpenBao (/opt/openbao-plugins). Both wrap the same binary.
# Usage: scripts/build-rpm.sh [version] (version defaults to $CI_COMMIT_TAG) # Usage: scripts/build-rpm.sh [version] (version defaults to $CI_COMMIT_TAG)
# #
set -euo pipefail set -euo pipefail
@@ -18,7 +20,7 @@ if [ ! -f "${DIST}/${BINARY}" ]; then
exit 1 exit 1
fi fi
export PACKAGE_NAME="${BINARY}" # Fields shared across every flavour.
export PACKAGE_VERSION="${VERSION}" export PACKAGE_VERSION="${VERSION}"
export PACKAGE_RELEASE="1" export PACKAGE_RELEASE="1"
export PACKAGE_ARCH="amd64" export PACKAGE_ARCH="amd64"
@@ -28,8 +30,20 @@ export PACKAGE_MAINTAINER="Ben Vincent <ben@unkin.net>"
export PACKAGE_HOMEPAGE="https://git.unkin.net/unkin/vault-plugin-secrets-litellm" export PACKAGE_HOMEPAGE="https://git.unkin.net/unkin/vault-plugin-secrets-litellm"
export PACKAGE_LICENSE="MIT" export PACKAGE_LICENSE="MIT"
envsubst < packaging/nfpm.yaml > "${DIST}/nfpm.yaml" # build_flavor <package-name> <plugin-dir>
nfpm pkg --config "${DIST}/nfpm.yaml" --target "${DIST}" --packager rpm build_flavor() {
export PACKAGE_NAME="$1"
export PACKAGE_PLUGIN_DIR="$2"
export PACKAGE_PREINSTALL="${DIST}/preinstall-${PACKAGE_NAME}.sh"
envsubst '${PACKAGE_PLUGIN_DIR}' \
< packaging/scripts/preinstall.sh.tmpl > "${PACKAGE_PREINSTALL}"
envsubst < packaging/nfpm.yaml > "${DIST}/nfpm-${PACKAGE_NAME}.yaml"
nfpm pkg --config "${DIST}/nfpm-${PACKAGE_NAME}.yaml" --target "${DIST}" --packager rpm
}
build_flavor "vault-plugin-secrets-litellm" "/opt/vault-plugins"
build_flavor "openbao-plugin-secrets-litellm" "/opt/openbao-plugins"
echo "Built:" echo "Built:"
ls -1 "${DIST}"/*.rpm ls -1 "${DIST}"/*.rpm