Repository navigation
122 lines (111 loc) · 4.71 KB
/
Copy pathe2e-kubernetes-test.yml
File metadata and controls
122 lines (111 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Kubernetes E2E Test
on:
workflow_call:
inputs:
image-tag:
description: "Image tag to test (typically the commit SHA)"
required: true
type: string
runner:
description: "GitHub Actions runner label"
required: false
type: string
default: "linux-amd64-cpu8"
checkout-ref:
description: "Git ref to check out for test inputs (defaults to the workflow SHA)"
required: false
type: string
default: ""
job-name:
description: "Display name for the Kubernetes e2e job"
required: false
type: string
default: "Kubernetes E2E (Rust smoke)"
extra-helm-values:
description: "Colon-separated Helm values files to layer on the Kubernetes e2e chart install"
required: false
type: string
default: ""
external-postgres-secret:
description: "Create an ephemeral external PostgreSQL fixture and write its URI to this Secret"
required: false
type: string
default: ""
mise-version:
description: "mise version to install on the bare Kubernetes e2e runner"
required: false
type: string
default: "v2026.4.25"
permissions:
contents: read
packages: read
jobs:
e2e-kubernetes:
name: ${{ inputs.job-name }}
# Bare runner: running kind-in-container hits nested-Docker / kubeconfig
# complications. The runner has Docker; mise installs helm, kubectl, and
# the Rust toolchain.
runs-on: ${{ inputs.runner }}
timeout-minutes: 60
permissions:
contents: read
packages: read
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Keep bare-runner installs aligned with the project CI image.
MISE_VERSION: ${{ inputs.mise-version }}
KIND_CLUSTER_NAME: kube-e2e-${{ github.run_id }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
ref: ${{ inputs['checkout-ref'] || github.sha }}
- name: Install mise
run: |
curl https://mise.run | MISE_VERSION=v2026.4.25 sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"
- name: Install tools
run: mise install --locked
# The openshell-policy crate transitively pulls in z3-sys, whose
# build script needs the z3 C/C++ headers and clang/bindgen to
# compile. The bare runner doesn't ship them; the CI container
# image used by other Rust e2e jobs does, but we can't run this job
# there (the runner's container handler injects its own --network
# bridge, which conflicts with the --network host we need so kind's
# API server is reachable from the test process).
- name: Install z3 build deps
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends libz3-dev clang
- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Create kind cluster
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
with:
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
wait: 120s
# mise.toml sets KUBECONFIG="{{config_root}}/kubeconfig"; helm/kind-action
# writes to ~/.kube/config. Materialize the kind context at the mise path
# so `mise run e2e:kubernetes` (and the wrapper's `kubectl --context=...`)
# finds the kind cluster.
- name: Export kind kubeconfig to mise path
run: |
set -euo pipefail
kind get kubeconfig --name "$KIND_CLUSTER_NAME" > "$GITHUB_WORKSPACE/kubeconfig"
chmod 600 "$GITHUB_WORKSPACE/kubeconfig"
- name: Load gateway and supervisor images into kind
run: |
set -euo pipefail
for component in gateway supervisor; do
image="ghcr.io/nvidia/openshell/${component}:${{ inputs.image-tag }}"
archive="${RUNNER_TEMP:-/tmp}/openshell-${component}-linux-amd64.tar"
docker pull --platform linux/amd64 "$image"
docker image save --platform linux/amd64 --output "$archive" "$image"
kind load image-archive "$archive" --name "$KIND_CLUSTER_NAME"
done
- name: Run Kubernetes E2E (Rust smoke)
env:
OPENSHELL_E2E_KUBE_CONTEXT: kind-${{ env.KIND_CLUSTER_NAME }}
OPENSHELL_E2E_KUBE_EXTRA_VALUES: ${{ inputs.extra-helm-values }}
OPENSHELL_E2E_KUBE_EXTERNAL_POSTGRES_SECRET: ${{ inputs.external-postgres-secret }}
IMAGE_TAG: ${{ inputs.image-tag }}
OPENSHELL_REGISTRY: ghcr.io/nvidia/openshell
run: mise run --no-deps --skip-deps e2e:kubernetes