Skip to content

Commit 706e6a5

Browse files
committed
ci(e2e): reuse prebuilt gateway artifacts
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 5cd379d commit 706e6a5

6 files changed

Lines changed: 75 additions & 10 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Setup E2E Gateway
2+
description: Download an architecture-matched prebuilt OpenShell gateway for E2E tests
3+
4+
inputs:
5+
artifact-prefix:
6+
description: Artifact name prefix; linux-<arch> is appended automatically
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Download prebuilt gateway
13+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
14+
with:
15+
name: ${{ format('{0}-linux-{1}', inputs.artifact-prefix, runner.arch == 'X64' && 'amd64' || 'arm64') }}
16+
path: .e2e/prebuilt-gateway
17+
18+
- name: Configure prebuilt gateway
19+
shell: bash
20+
run: |
21+
set -euo pipefail
22+
gateway="$GITHUB_WORKSPACE/.e2e/prebuilt-gateway/openshell-gateway"
23+
if [[ ! -f "$gateway" ]]; then
24+
echo "downloaded artifact is missing $gateway" >&2
25+
exit 1
26+
fi
27+
chmod +x "$gateway"
28+
"$gateway" --version
29+
echo "OPENSHELL_GATEWAY_BIN=$gateway" >> "$GITHUB_ENV"

.github/workflows/branch-e2e.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
7474
build-gateway:
7575
needs: [pr_metadata]
76-
if: needs.pr_metadata.outputs.should_run == 'true' && (needs.pr_metadata.outputs.run_core_e2e == 'true' || needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true')
76+
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true'
7777
permissions:
7878
contents: read
7979
packages: write
@@ -116,9 +116,10 @@ jobs:
116116
image-tag: ${{ github.sha }}
117117
runner: linux-arm64-cpu8
118118
cli-artifact-prefix: rust-binary-cli
119+
gateway-artifact-prefix: rust-binary-gateway
119120

120121
gpu-e2e:
121-
needs: [pr_metadata, build-supervisor, build-cli]
122+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli]
122123
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_gpu_e2e == 'true'
123124
permissions:
124125
actions: read
@@ -128,6 +129,7 @@ jobs:
128129
with:
129130
image-tag: ${{ github.sha }}
130131
cli-artifact-prefix: rust-binary-cli
132+
gateway-artifact-prefix: rust-binary-gateway
131133

132134
kubernetes-e2e:
133135
needs: [pr_metadata, build-gateway, build-supervisor, build-cli]
@@ -208,19 +210,21 @@ jobs:
208210
209211
gpu-e2e-result:
210212
name: GPU E2E result
211-
needs: [pr_metadata, build-supervisor, build-cli, gpu-e2e]
213+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, gpu-e2e]
212214
if: always() && needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_gpu_e2e == 'true'
213215
runs-on: ubuntu-latest
214216
steps:
215217
- name: Verify GPU E2E jobs
216218
env:
219+
BUILD_GATEWAY_RESULT: ${{ needs.build-gateway.result }}
217220
BUILD_SUPERVISOR_RESULT: ${{ needs.build-supervisor.result }}
218221
BUILD_CLI_RESULT: ${{ needs.build-cli.result }}
219222
GPU_E2E_RESULT: ${{ needs.gpu-e2e.result }}
220223
run: |
221224
set -euo pipefail
222225
failed=0
223226
for item in \
227+
"build-gateway:$BUILD_GATEWAY_RESULT" \
224228
"build-supervisor:$BUILD_SUPERVISOR_RESULT" \
225229
"build-cli:$BUILD_CLI_RESULT" \
226230
"gpu-e2e:$GPU_E2E_RESULT"; do

.github/workflows/e2e-gpu-test.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
required: false
1313
type: string
1414
default: ""
15+
gateway-artifact-prefix:
16+
description: "Optional prebuilt gateway artifact prefix (artifact suffix is linux-<arch>)"
17+
required: false
18+
type: string
19+
default: ""
1520

1621
permissions:
1722
actions: read
@@ -70,6 +75,12 @@ jobs:
7075
with:
7176
artifact-prefix: ${{ inputs.cli-artifact-prefix }}
7277

78+
- name: Use prebuilt OpenShell gateway
79+
if: inputs.gateway-artifact-prefix != ''
80+
uses: ./.github/actions/setup-e2e-gateway
81+
with:
82+
artifact-prefix: ${{ inputs.gateway-artifact-prefix }}
83+
7384
- name: Log in to GHCR
7485
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
7586

.github/workflows/e2e-test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
required: false
2323
type: string
2424
default: ""
25+
gateway-artifact-prefix:
26+
description: "Optional prebuilt gateway artifact prefix (artifact suffix is linux-<arch>)"
27+
required: false
28+
type: string
29+
default: ""
2530

2631
permissions:
2732
actions: read
@@ -75,6 +80,12 @@ jobs:
7580
with:
7681
artifact-prefix: ${{ inputs.cli-artifact-prefix }}
7782

83+
- name: Use prebuilt OpenShell gateway
84+
if: inputs.gateway-artifact-prefix != ''
85+
uses: ./.github/actions/setup-e2e-gateway
86+
with:
87+
artifact-prefix: ${{ inputs.gateway-artifact-prefix }}
88+
7889
- name: Check out MCP conformance tests
7990
if: matrix.suite == 'mcp'
8091
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
@@ -144,6 +155,12 @@ jobs:
144155
with:
145156
artifact-prefix: ${{ inputs.cli-artifact-prefix }}
146157

158+
- name: Use prebuilt OpenShell gateway
159+
if: inputs.gateway-artifact-prefix != ''
160+
uses: ./.github/actions/setup-e2e-gateway
161+
with:
162+
artifact-prefix: ${{ inputs.gateway-artifact-prefix }}
163+
147164
- name: Install mise
148165
run: |
149166
curl https://mise.run | MISE_VERSION=v2026.4.25 sh

CI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Three opt-in labels enable the long-running E2E suites:
2020
- `test:e2e-kubernetes` runs Kubernetes E2E with the HA Helm overlay
2121
(`replicaCount: 2` and bundled PostgreSQL) in `Branch E2E Checks`
2222

23-
When multiple labels are present, `Branch E2E Checks` builds the shared gateway and supervisor images once, builds one CLI artifact per runner architecture, and fans out all enabled suites in parallel. Rust and MCP E2E jobs reuse the matching prebuilt CLI instead of compiling another debug CLI in each job.
23+
When multiple labels are present, `Branch E2E Checks` builds the shared gateway and supervisor images once, builds one CLI artifact per runner architecture, and fans out all enabled suites in parallel. Docker, Podman, GPU, Rust, Python, and MCP E2E jobs reuse the matching prebuilt gateway and CLI binaries instead of compiling additional debug binaries in each job; Kubernetes E2E consumes the gateway image directly and reuses the prebuilt CLI.
2424
The `OpenShell / E2E` and `OpenShell / GPU E2E` required statuses are evaluated from separate suite result jobs inside that workflow. `test:e2e-kubernetes` is optional while HA behavior is under active iteration: failures are visible in the workflow run but do not publish a required CI gate status.
2525

2626
The GitHub ruleset should require the `OpenShell / ...` statuses published by `Required CI Gates`, not the push-triggered workflow jobs directly.

e2e/support/gateway-common.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,16 @@ e2e_build_gateway_binaries() {
181181

182182
target_dir="$(e2e_cargo_target_dir "${root}")"
183183
printf -v "${target_var}" '%s' "${target_dir}"
184-
printf -v "${gateway_var}" '%s' "${target_dir}/debug/openshell-gateway"
184+
printf -v "${gateway_var}" '%s' "${OPENSHELL_GATEWAY_BIN:-${target_dir}/debug/openshell-gateway}"
185185
printf -v "${cli_var}" '%s' "${OPENSHELL_BIN:-${target_dir}/debug/openshell}"
186186

187-
echo "Building openshell-gateway..."
188-
cargo build "${jobs[@]}" \
189-
-p openshell-server --bin openshell-gateway
187+
if [ -z "${OPENSHELL_GATEWAY_BIN:-}" ]; then
188+
echo "Building openshell-gateway..."
189+
cargo build "${jobs[@]}" \
190+
-p openshell-server --bin openshell-gateway
191+
else
192+
echo "Using prebuilt openshell gateway at ${OPENSHELL_GATEWAY_BIN}"
193+
fi
190194

191195
if [ -z "${OPENSHELL_BIN:-}" ]; then
192196
echo "Building openshell-cli..."
@@ -196,8 +200,8 @@ e2e_build_gateway_binaries() {
196200
echo "Using prebuilt openshell CLI at ${OPENSHELL_BIN}"
197201
fi
198202

199-
if [ ! -x "${target_dir}/debug/openshell-gateway" ]; then
200-
echo "ERROR: expected openshell-gateway binary at ${target_dir}/debug/openshell-gateway" >&2
203+
if [ ! -x "${!gateway_var}" ]; then
204+
echo "ERROR: expected openshell-gateway binary at ${!gateway_var}" >&2
201205
exit 1
202206
fi
203207
if [ ! -x "${!cli_var}" ]; then

0 commit comments

Comments
 (0)