Skip to content

Commit e8be9a2

Browse files
committed
ci(helm): add Branch Helm E2E workflow gated on test:e2e-helm
Adds a label-gated GitHub Actions workflow that exercises the Helm chart end-to-end against the Rust e2e suite via `mise run e2e:helm`. Pipeline: - pr_metadata gates on the `test:e2e-helm` label via the pr-gate action. - build-gateway / build-supervisor build and push Docker images using the reusable docker-build.yml workflow. - helm-e2e (bare runner): apt-installs z3 build deps so cargo can compile the openshell-policy crate's z3-sys backend, creates a kind cluster via helm/kind-action, materializes the kind kubeconfig at the path mise's [env] block expects, side-loads the freshly built gateway/supervisor images, applies deploy/kube/manifests/agent-sandbox.yaml so the sandboxes.agents.x-k8s.io CRD and reconciling StatefulSet are in place, and finally runs `mise run e2e:helm`. Also expands the `e2e:helm` task to run the full Rust e2e suite (matching `e2e:podman`) instead of only the smoke test, with OPENSHELL_E2E_KUBE_TEST as an opt-in single-test override for local debugging. Extends the e2e-label-help workflow so applying `test:e2e-helm` posts the next-step hint pointing at this workflow. Signed-off-by: Taylor Mutch <taylormutch@gmail.com>
1 parent d7577f1 commit e8be9a2

4 files changed

Lines changed: 139 additions & 5 deletions

File tree

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Branch Helm E2E
5+
6+
on:
7+
push:
8+
branches:
9+
- "pull-request/[0-9]+"
10+
workflow_dispatch: {}
11+
12+
permissions: {}
13+
14+
jobs:
15+
pr_metadata:
16+
name: Resolve PR metadata
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
pull-requests: read
21+
outputs:
22+
should_run: ${{ steps.gate.outputs.should_run }}
23+
steps:
24+
- uses: actions/checkout@v6
25+
26+
- id: gate
27+
uses: ./.github/actions/pr-gate
28+
with:
29+
required_label: test:e2e-helm
30+
31+
build-gateway:
32+
needs: [pr_metadata]
33+
if: needs.pr_metadata.outputs.should_run == 'true'
34+
permissions:
35+
contents: read
36+
packages: write
37+
uses: ./.github/workflows/docker-build.yml
38+
with:
39+
component: gateway
40+
platform: linux/amd64
41+
42+
build-supervisor:
43+
needs: [pr_metadata]
44+
if: needs.pr_metadata.outputs.should_run == 'true'
45+
permissions:
46+
contents: read
47+
packages: write
48+
uses: ./.github/workflows/docker-build.yml
49+
with:
50+
component: supervisor
51+
platform: linux/amd64
52+
53+
helm-e2e:
54+
name: Helm E2E (Rust smoke)
55+
needs: [pr_metadata, build-gateway, build-supervisor]
56+
if: needs.pr_metadata.outputs.should_run == 'true'
57+
# Bare runner: kind-in-container hits the same nested-Docker / kubeconfig
58+
# complications take-1 saw with k3d (commit 4b5961fe). The runner has
59+
# Docker; mise installs helm, kubectl, and the Rust toolchain.
60+
runs-on: linux-amd64-cpu8
61+
timeout-minutes: 60
62+
permissions:
63+
contents: read
64+
packages: read
65+
env:
66+
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
KIND_CLUSTER_NAME: helm-e2e-${{ github.run_id }}
68+
steps:
69+
- uses: actions/checkout@v6
70+
71+
- name: Install mise
72+
run: |
73+
curl https://mise.run | sh
74+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
75+
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"
76+
77+
- name: Install tools
78+
run: mise install --locked
79+
80+
# The openshell-policy crate transitively pulls in z3-sys, whose
81+
# build script needs the z3 C/C++ headers and clang/bindgen to
82+
# compile. The bare runner doesn't ship them; the CI container
83+
# image used by other Rust e2e jobs does, but we can't run helm-e2e
84+
# there (the runner's container handler injects its own --network
85+
# bridge, which conflicts with the --network host we need so kind's
86+
# API server is reachable from the test process).
87+
- name: Install z3 build deps
88+
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libz3-dev clang
89+
90+
- name: Log in to GHCR
91+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
92+
93+
- name: Create kind cluster
94+
uses: helm/kind-action@v1
95+
with:
96+
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
97+
wait: 120s
98+
99+
# mise.toml sets KUBECONFIG="{{config_root}}/kubeconfig"; helm/kind-action
100+
# writes to ~/.kube/config. Materialize the kind context at the mise path
101+
# so `mise run e2e:helm` (and the wrapper's `kubectl --context=…`) finds
102+
# the kind cluster.
103+
- name: Export kind kubeconfig to mise path
104+
run: |
105+
set -euo pipefail
106+
kind get kubeconfig --name "$KIND_CLUSTER_NAME" > "$GITHUB_WORKSPACE/kubeconfig"
107+
chmod 600 "$GITHUB_WORKSPACE/kubeconfig"
108+
109+
# Pre-pull and side-load: kind nodes don't have ghcr credentials, and
110+
# tagging IMAGE_TAG to a SHA means the chart's IfNotPresent pull policy
111+
# is satisfied once the image is loaded into the node's containerd.
112+
- name: Load gateway and supervisor images into kind
113+
run: |
114+
set -euo pipefail
115+
for component in gateway supervisor; do
116+
image="ghcr.io/nvidia/openshell/${component}:${{ github.sha }}"
117+
docker pull "$image"
118+
kind load docker-image "$image" --name "$KIND_CLUSTER_NAME"
119+
done
120+
121+
- name: Run Helm E2E (Rust smoke)
122+
env:
123+
OPENSHELL_E2E_KUBE_CONTEXT: kind-${{ env.KIND_CLUSTER_NAME }}
124+
IMAGE_TAG: ${{ github.sha }}
125+
OPENSHELL_REGISTRY: ghcr.io/nvidia/openshell
126+
run: mise run --no-deps --skip-deps e2e:helm

.github/workflows/e2e-label-help.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions: {}
1919
jobs:
2020
hint:
2121
name: Post next-step hint for E2E label
22-
if: github.event.label.name == 'test:e2e' || github.event.label.name == 'test:e2e-gpu'
22+
if: github.event.label.name == 'test:e2e' || github.event.label.name == 'test:e2e-gpu' || github.event.label.name == 'test:e2e-helm'
2323
runs-on: ubuntu-latest
2424
permissions:
2525
pull-requests: write
@@ -40,6 +40,7 @@ jobs:
4040
case "$LABEL_NAME" in
4141
test:e2e) workflow_file=branch-e2e.yml; workflow_name="Branch E2E Checks" ;;
4242
test:e2e-gpu) workflow_file=test-gpu.yml; workflow_name="GPU Test" ;;
43+
test:e2e-helm) workflow_file=branch-helm-e2e.yml; workflow_name="Branch Helm E2E" ;;
4344
*) echo "Unrecognized label $LABEL_NAME"; exit 1 ;;
4445
esac
4546

e2e/rust/e2e-helm.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@
22
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44

5-
# Run a Rust e2e test against a Helm-deployed OpenShell gateway. Set
5+
# Run the Rust e2e suite against a Helm-deployed OpenShell gateway. Set
66
# OPENSHELL_E2E_KUBE_CONTEXT to target an existing cluster; otherwise an
77
# ephemeral k3d cluster is created and torn down by with-kube-gateway.sh.
8+
# Set OPENSHELL_E2E_KUBE_TEST to scope to a single integration test
9+
# (e.g. smoke) for local debugging.
810

911
set -euo pipefail
1012

1113
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
12-
E2E_TEST="${OPENSHELL_E2E_KUBE_TEST:-smoke}"
1314

1415
cargo build -p openshell-cli --features openshell-core/dev-settings
1516

17+
test_filter=()
18+
if [ -n "${OPENSHELL_E2E_KUBE_TEST:-}" ]; then
19+
test_filter+=(--test "${OPENSHELL_E2E_KUBE_TEST}")
20+
fi
21+
1622
exec "${ROOT}/e2e/with-kube-gateway.sh" \
1723
cargo test --manifest-path "${ROOT}/e2e/rust/Cargo.toml" \
1824
--features e2e \
19-
--test "${E2E_TEST}" \
25+
--no-fail-fast \
26+
${test_filter[@]+"${test_filter[@]}"} \
2027
-- --nocapture

tasks/test.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ description = "Run Rust CLI e2e tests against a Podman-backed gateway"
5151
run = "e2e/rust/e2e-podman.sh"
5252

5353
["e2e:helm"]
54-
description = "Run smoke e2e against a Helm-deployed gateway (set OPENSHELL_E2E_KUBE_CONTEXT to reuse a cluster, otherwise creates a local k3d cluster)"
54+
description = "Run Rust CLI e2e tests against a Helm-deployed gateway (set OPENSHELL_E2E_KUBE_CONTEXT to reuse a cluster, otherwise creates a local k3d cluster; set OPENSHELL_E2E_KUBE_TEST=<name> to scope to one test)"
5555
run = "e2e/rust/e2e-helm.sh"
5656

5757
["e2e:vm"]

0 commit comments

Comments
 (0)