Operator CRD and CR Testing workflow (vllm-project/production-stack)
The Operator CRD and CR Testing workflow from vllm-project/production-stack, explained and optimized by Latchkey.
CI health: A - excellent
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Operator CRD and CR Testing workflow from the vllm-project/production-stack repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Operator CRD and CR Testing
run-name: ${{ github.actor }} is testing operator CRDs and CRs π
concurrency:
group: ${{ github.ref }}-crd
cancel-in-progress: true
on:
push:
branches:
- main
paths:
- '.github/workflows/operator-test.yml'
- 'operator/**'
- 'tests/e2e/**'
pull_request:
paths:
- '.github/workflows/operator-test.yml'
- 'operator/**'
- 'tests/e2e/**'
merge_group:
jobs:
CRD-Validation:
runs-on: self-hosted
steps:
- run: echo "π The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: echo "π‘ The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "π₯οΈ The workflow is now ready to test your code on the runner."
- name: Setup test environment
env:
DOCKER_BUILDKIT: 1
run: |
echo "π§ Setting up test environment"
sudo sysctl fs.protected_regular=0
# Verify minikube is running
minikube status
# Ensure kubectl is configured for minikube
minikube kubectl -- get nodes
- name: Test CRDs and CRs
run: |
cd ${{ github.workspace }}
chmod +x tests/e2e/test-crds.sh
./tests/e2e/test-crds.sh
- name: Cleanup test resources
if: always()
run: |
echo "π§Ή Cleaning up test resources"
# Delete all CRs
kubectl delete vllmruntime --all || true
kubectl delete cacheserver --all || true
kubectl delete vllmrouter --all || true
# Delete all CRDs
kubectl delete crd vllmruntimes.production-stack.vllm.ai || true
kubectl delete crd cacheservers.production-stack.vllm.ai || true
kubectl delete crd vllmrouters.production-stack.vllm.ai || true
- name: Archive test results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: always()
with:
name: operator-test-results
path: |
operator-test-results/
- run: echo "π This job's status is ${{ job.status }}."
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Operator CRD and CR Testing run-name: ${{ github.actor }} is testing operator CRDs and CRs π concurrency: group: ${{ github.ref }}-crd cancel-in-progress: true on: push: branches: - main paths: - '.github/workflows/operator-test.yml' - 'operator/**' - 'tests/e2e/**' pull_request: paths: - '.github/workflows/operator-test.yml' - 'operator/**' - 'tests/e2e/**' merge_group: jobs: CRD-Validation: timeout-minutes: 30 runs-on: self-hosted steps: - run: echo "π The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "π§ This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "π The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - name: Check out repository code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - run: echo "π‘ The ${{ github.repository }} repository has been cloned to the runner." - run: echo "π₯οΈ The workflow is now ready to test your code on the runner." - name: Setup test environment env: DOCKER_BUILDKIT: 1 run: | echo "π§ Setting up test environment" sudo sysctl fs.protected_regular=0 # Verify minikube is running minikube status # Ensure kubectl is configured for minikube minikube kubectl -- get nodes - name: Test CRDs and CRs run: | cd ${{ github.workspace }} chmod +x tests/e2e/test-crds.sh ./tests/e2e/test-crds.sh - name: Cleanup test resources if: always() run: | echo "π§Ή Cleaning up test resources" # Delete all CRs kubectl delete vllmruntime --all || true kubectl delete cacheserver --all || true kubectl delete vllmrouter --all || true # Delete all CRDs kubectl delete crd vllmruntimes.production-stack.vllm.ai || true kubectl delete crd cacheservers.production-stack.vllm.ai || true kubectl delete crd vllmrouters.production-stack.vllm.ai || true - name: Archive test results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: always() with: name: operator-test-results path: | operator-test-results/ - run: echo "π This job's status is ${{ job.status }}."
What changed
- Add a job timeout so a hung step cannot burn hours of runner time.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- End-to-end and browser tests
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.