Skip to content

authserver/storage: add UpdateDCRCredentialsIfPresent #7875

authserver/storage: add UpdateDCRCredentialsIfPresent

authserver/storage: add UpdateDCRCredentialsIfPresent #7875

name: E2E Tests Lifecycle
on:
workflow_dispatch:
pull_request:
paths:
- 'cmd/vmcp/**'
- 'cmd/thv-operator/**'
- 'pkg/**'
- 'test/e2e/thv-operator/**'
# This job is the only one that runs the Ginkgo suite under
# test/e2e/thv-operator, and that suite sources every backend container
# image from test/e2e/images. A change there alters what these tests
# actually deploy, so it has to trigger them.
- 'test/e2e/images/**'
- '.github/workflows/test-e2e-lifecycle.yml'
# Cancel superseded PR runs; keep other events independent.
concurrency:
group: test-e2e-lifecycle-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
e2e-test-lifecycle:
name: E2E Test Lifecycle
runs-on: ubuntu-8cores-32gb
timeout-minutes: 30
env:
YARDSTICK_IMAGE: ghcr.io/stackloklabs/yardstick/yardstick-server:1.2.0
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
version: [
"kindest/node:v1.33.7",
"kindest/node:v1.34.3",
"kindest/node:v1.35.1"
]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Disable containerd image store
# Workaround for https://github.com/kubernetes-sigs/kind/issues/3795
# Docker 29+ defaults to containerd image store, which causes
# `kind load docker-image` to fail for multi-arch images because
# `docker save` preserves the OCI index referencing all platforms
# even when only the host platform layers were pulled.
# --platform on docker pull is not sufficient; the image store
# itself must be switched back to the classic overlay2 driver.
run: |
sudo mkdir -p /etc/docker
echo '{"features":{"containerd-snapshotter": false}}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
- name: Set up Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: v4.3.0
- name: Setup Ko
uses: ko-build/setup-ko@61b4d1d396f5b2e7d6bb6fefdce3dc38d1a13445 # v0.10
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version: 'stable'
cache: true
- name: Install Task
uses: arduino/setup-task@c0bc642852239c2689f73f4ea6459c29405f3c52 # v3.0.0
with:
version: 3.44.1
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Create KIND Cluster with port mappings
uses: helm/kind-action@06c1ae10762d3b9c1644e7fe69596ae519e015a2 # v1.15.0
with:
cluster_name: toolhive
version: v0.33.0 # kind
config: test/e2e/thv-operator/kind-config.yaml
node_image: ${{ matrix.version }}
- name: Setup cluster and install CRDs
run: |
kind get kubeconfig --name toolhive > kconfig.yaml
export KUBECONFIG=kconfig.yaml
task operator-install-crds
- name: Build and load test images
run: |
# Build and load vmcp image
echo "Building vmcp image..."
VMCP_IMAGE=$(KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/vmcp | tail -n 1)
echo "Loading vmcp image ${VMCP_IMAGE} into kind..."
kind load docker-image --name toolhive ${VMCP_IMAGE}
# Save VMCP_IMAGE for later steps
echo "VMCP_IMAGE=${VMCP_IMAGE}" >> $GITHUB_ENV
echo "Built and loaded vmcp image: ${VMCP_IMAGE}"
# Pull and load all test server images in parallel to speed up CI
echo "Pulling and loading test server images..."
docker pull "$YARDSTICK_IMAGE" &
docker pull ghcr.io/stackloklabs/gofetch/server:1.0.1 &
docker pull ghcr.io/stackloklabs/osv-mcp/server:0.0.7 &
docker pull python:3.9-slim &
docker pull curlimages/curl:8.17.0 &
docker pull ghcr.io/huggingface/text-embeddings-inference:cpu-latest &
docker pull ghcr.io/dexidp/dex:v2.42.0 &
wait
# Load all images into kind
kind load docker-image --name toolhive "$YARDSTICK_IMAGE"
kind load docker-image --name toolhive ghcr.io/stackloklabs/gofetch/server:1.0.1
kind load docker-image --name toolhive ghcr.io/stackloklabs/osv-mcp/server:0.0.7
kind load docker-image --name toolhive python:3.9-slim
kind load docker-image --name toolhive curlimages/curl:8.17.0
kind load docker-image --name toolhive ghcr.io/huggingface/text-embeddings-inference:cpu-latest
kind load docker-image --name toolhive ghcr.io/dexidp/dex:v2.42.0
- name: Deploy operator with VMCP_IMAGE
run: |
export KUBECONFIG=kconfig.yaml
echo "Deploying operator with vmcp image: ${VMCP_IMAGE}"
# Build operator and proxyrunner images
OPERATOR_IMAGE=$(KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/thv-operator | tail -n 1)
TOOLHIVE_IMAGE=$(KO_DOCKER_REPO=kind.local ko build --local -B ./cmd/thv-proxyrunner | tail -n 1)
# Load operator images into kind
kind load docker-image --name toolhive ${OPERATOR_IMAGE}
kind load docker-image --name toolhive ${TOOLHIVE_IMAGE}
# Deploy operator with VMCP_IMAGE environment variable
helm upgrade --install toolhive-operator deploy/charts/operator \
--set operator.image=${OPERATOR_IMAGE} \
--set operator.toolhiveRunnerImage=${TOOLHIVE_IMAGE} \
--set operator.vmcpImage=${VMCP_IMAGE} \
--namespace toolhive-system \
--create-namespace \
--kubeconfig kconfig.yaml
# Wait for operator to be ready
kubectl rollout status deployment/toolhive-operator -n toolhive-system --timeout=2m --kubeconfig kconfig.yaml
- name: Run VirtualMCP Lifecycle E2E tests
run: |
export KUBECONFIG=kconfig.yaml
task thv-operator-e2e-test-run
- name: Cleanup cluster
if: always()
run: |
kind delete cluster --name toolhive