Skip to content

Commit 339eae5

Browse files
authored
ci(e2e): reuse prebuilt CLI and gateway artifacts (#2311)
* ci(e2e): reuse prebuilt CLI artifacts Signed-off-by: Evan Lezar <elezar@nvidia.com> * ci(e2e): reuse prebuilt gateway artifacts Signed-off-by: Evan Lezar <elezar@nvidia.com> * ci(e2e): reuse prebuilt VM driver artifact Signed-off-by: Evan Lezar <elezar@nvidia.com> --------- Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 9a4f8a8 commit 339eae5

17 files changed

Lines changed: 367 additions & 76 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 CLI
2+
description: Download an architecture-matched prebuilt OpenShell CLI 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 CLI
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-cli
17+
18+
- name: Configure prebuilt CLI
19+
shell: bash
20+
run: |
21+
set -euo pipefail
22+
cli="$GITHUB_WORKSPACE/.e2e/prebuilt-cli/openshell"
23+
if [[ ! -f "$cli" ]]; then
24+
echo "downloaded artifact is missing $cli" >&2
25+
exit 1
26+
fi
27+
chmod +x "$cli"
28+
"$cli" --version
29+
echo "OPENSHELL_BIN=$cli" >> "$GITHUB_ENV"
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"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Setup E2E VM Driver
2+
description: Download a prebuilt OpenShell VM driver for E2E tests
3+
4+
inputs:
5+
artifact-name:
6+
description: Artifact name to download, such as driver-vm-linux-amd64
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Download prebuilt VM driver
13+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
14+
with:
15+
name: ${{ inputs.artifact-name }}
16+
path: .e2e/prebuilt-vm-driver
17+
18+
- name: Configure prebuilt VM driver
19+
shell: bash
20+
run: |
21+
set -euo pipefail
22+
extract_dir="$GITHUB_WORKSPACE/.e2e/prebuilt-vm-driver/bin"
23+
mkdir -p "$extract_dir"
24+
archive="$(find "$GITHUB_WORKSPACE/.e2e/prebuilt-vm-driver" -maxdepth 1 -type f -name 'openshell-driver-vm-*.tar.gz' -print -quit)"
25+
if [[ -z "$archive" ]]; then
26+
echo "downloaded artifact is missing openshell-driver-vm-*.tar.gz" >&2
27+
find "$GITHUB_WORKSPACE/.e2e/prebuilt-vm-driver" -maxdepth 2 -type f -print >&2 || true
28+
exit 1
29+
fi
30+
tar -xzf "$archive" -C "$extract_dir"
31+
driver="$extract_dir/openshell-driver-vm"
32+
if [[ ! -f "$driver" ]]; then
33+
echo "downloaded artifact is missing $driver" >&2
34+
exit 1
35+
fi
36+
chmod +x "$driver"
37+
"$driver" --version
38+
echo "OPENSHELL_VM_DRIVER_BIN=$driver" >> "$GITHUB_ENV"

‎.github/workflows/branch-e2e.yml‎

Lines changed: 45 additions & 10 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
@@ -95,38 +95,59 @@ jobs:
9595

9696
build-cli:
9797
needs: [pr_metadata]
98-
if: needs.pr_metadata.outputs.should_run == 'true'
98+
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_any_e2e == 'true'
9999
permissions:
100100
contents: read
101101
packages: write
102102
uses: ./.github/workflows/docker-build.yml
103103
with:
104104
component: cli
105-
platform: linux/amd64
105+
platform: linux/amd64,linux/arm64
106+
107+
build-driver-vm-linux:
108+
needs: [pr_metadata]
109+
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
110+
permissions:
111+
contents: read
112+
packages: read
113+
uses: ./.github/workflows/driver-vm-linux.yml
114+
with:
115+
image-tag: ${{ github.sha }}
116+
checkout-ref: ${{ github.sha }}
117+
runtime-platforms: linux-x86_64
118+
driver-targets: >-
119+
[{"arch":"amd64","runner":"linux-amd64-cpu8","target":"x86_64-unknown-linux-gnu","zig_target":"x86_64-unknown-linux-gnu.2.28","platform":"linux-x86_64","guest_arch":"x86_64"}]
106120
107121
e2e:
108-
needs: [pr_metadata, build-gateway, build-supervisor]
122+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, build-driver-vm-linux]
109123
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
110124
permissions:
125+
actions: read
111126
contents: read
112127
packages: read
113128
uses: ./.github/workflows/e2e-test.yml
114129
with:
115130
image-tag: ${{ github.sha }}
116131
runner: linux-arm64-cpu8
132+
cli-artifact-prefix: rust-binary-cli
133+
gateway-artifact-prefix: rust-binary-gateway
134+
vm-driver-artifact-name: driver-vm-linux-amd64
117135

118136
gpu-e2e:
119-
needs: [pr_metadata, build-supervisor]
137+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli]
120138
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_gpu_e2e == 'true'
121139
permissions:
140+
actions: read
122141
contents: read
123142
packages: read
124143
uses: ./.github/workflows/e2e-gpu-test.yaml
125144
with:
126145
image-tag: ${{ github.sha }}
146+
cli-artifact-prefix: rust-binary-cli
147+
gateway-artifact-prefix: rust-binary-gateway
127148

128149
kubernetes-e2e:
129-
needs: [pr_metadata, build-gateway, build-supervisor]
150+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli]
130151
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
131152
strategy:
132153
fail-fast: false
@@ -145,6 +166,7 @@ jobs:
145166
topology: sidecar
146167
extra_helm_values: deploy/helm/openshell/ci/values-sidecar.yaml
147168
permissions:
169+
actions: read
148170
contents: read
149171
packages: read
150172
uses: ./.github/workflows/e2e-kubernetes-test.yml
@@ -153,11 +175,13 @@ jobs:
153175
job-name: Kubernetes E2E (Rust smoke, ${{ matrix.topology }}, Agent Sandbox ${{ matrix.agent_sandbox_api }})
154176
agent-sandbox-version: ${{ matrix.agent_sandbox_version }}
155177
extra-helm-values: ${{ matrix.extra_helm_values }}
178+
cli-artifact-prefix: rust-binary-cli
156179

157180
kubernetes-ha-e2e:
158-
needs: [pr_metadata, build-gateway, build-supervisor]
181+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli]
159182
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true'
160183
permissions:
184+
actions: read
161185
contents: read
162186
packages: read
163187
uses: ./.github/workflows/e2e-kubernetes-test.yml
@@ -166,17 +190,20 @@ jobs:
166190
job-name: Kubernetes HA E2E (Rust smoke)
167191
extra-helm-values: deploy/helm/openshell/ci/values-high-availability.yaml
168192
external-postgres-secret: openshell-ha-pg
193+
cli-artifact-prefix: rust-binary-cli
169194

170195
core-e2e-result:
171196
name: Core E2E result
172-
needs: [pr_metadata, build-gateway, build-supervisor, e2e, kubernetes-e2e]
197+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, build-driver-vm-linux, e2e, kubernetes-e2e]
173198
if: always() && needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
174199
runs-on: ubuntu-latest
175200
steps:
176201
- name: Verify core E2E jobs
177202
env:
178203
BUILD_GATEWAY_RESULT: ${{ needs.build-gateway.result }}
179204
BUILD_SUPERVISOR_RESULT: ${{ needs.build-supervisor.result }}
205+
BUILD_CLI_RESULT: ${{ needs.build-cli.result }}
206+
BUILD_DRIVER_VM_RESULT: ${{ needs.build-driver-vm-linux.result }}
180207
E2E_RESULT: ${{ needs.e2e.result }}
181208
KUBERNETES_E2E_RESULT: ${{ needs.kubernetes-e2e.result }}
182209
run: |
@@ -185,6 +212,8 @@ jobs:
185212
for item in \
186213
"build-gateway:$BUILD_GATEWAY_RESULT" \
187214
"build-supervisor:$BUILD_SUPERVISOR_RESULT" \
215+
"build-cli:$BUILD_CLI_RESULT" \
216+
"build-driver-vm-linux:$BUILD_DRIVER_VM_RESULT" \
188217
"e2e:$E2E_RESULT" \
189218
"kubernetes-e2e:$KUBERNETES_E2E_RESULT"; do
190219
name="${item%%:*}"
@@ -198,19 +227,23 @@ jobs:
198227
199228
gpu-e2e-result:
200229
name: GPU E2E result
201-
needs: [pr_metadata, build-supervisor, gpu-e2e]
230+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, gpu-e2e]
202231
if: always() && needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_gpu_e2e == 'true'
203232
runs-on: ubuntu-latest
204233
steps:
205234
- name: Verify GPU E2E jobs
206235
env:
236+
BUILD_GATEWAY_RESULT: ${{ needs.build-gateway.result }}
207237
BUILD_SUPERVISOR_RESULT: ${{ needs.build-supervisor.result }}
238+
BUILD_CLI_RESULT: ${{ needs.build-cli.result }}
208239
GPU_E2E_RESULT: ${{ needs.gpu-e2e.result }}
209240
run: |
210241
set -euo pipefail
211242
failed=0
212243
for item in \
244+
"build-gateway:$BUILD_GATEWAY_RESULT" \
213245
"build-supervisor:$BUILD_SUPERVISOR_RESULT" \
246+
"build-cli:$BUILD_CLI_RESULT" \
214247
"gpu-e2e:$GPU_E2E_RESULT"; do
215248
name="${item%%:*}"
216249
result="${item#*:}"
@@ -223,21 +256,23 @@ jobs:
223256
224257
kubernetes-ha-e2e-result:
225258
name: Kubernetes HA E2E result
226-
needs: [pr_metadata, build-gateway, build-supervisor, kubernetes-ha-e2e]
259+
needs: [pr_metadata, build-gateway, build-supervisor, build-cli, kubernetes-ha-e2e]
227260
if: always() && needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_kubernetes_ha_e2e == 'true'
228261
runs-on: ubuntu-latest
229262
steps:
230263
- name: Verify Kubernetes HA E2E jobs
231264
env:
232265
BUILD_GATEWAY_RESULT: ${{ needs.build-gateway.result }}
233266
BUILD_SUPERVISOR_RESULT: ${{ needs.build-supervisor.result }}
267+
BUILD_CLI_RESULT: ${{ needs.build-cli.result }}
234268
KUBERNETES_HA_E2E_RESULT: ${{ needs.kubernetes-ha-e2e.result }}
235269
run: |
236270
set -euo pipefail
237271
failed=0
238272
for item in \
239273
"build-gateway:$BUILD_GATEWAY_RESULT" \
240274
"build-supervisor:$BUILD_SUPERVISOR_RESULT" \
275+
"build-cli:$BUILD_CLI_RESULT" \
241276
"kubernetes-ha-e2e:$KUBERNETES_HA_E2E_RESULT"; do
242277
name="${item%%:*}"
243278
result="${item#*:}"

‎.github/workflows/docker-build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
echo "arches=${arches[*]}"
155155
echo "binary_component=$binary_component"
156156
echo "binary_name=$binary_name"
157-
echo "artifact_prefix=rust-binary-${component}-${binary_component}"
157+
echo "artifact_prefix=rust-binary-${component}"
158158
echo "image_tag_base=$image_tag_base"
159159
echo "features=$features"
160160
echo "has_image=$has_image"

‎.github/workflows/driver-vm-linux.yml‎

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,26 @@ on:
44
workflow_call:
55
inputs:
66
cargo-version:
7-
required: true
7+
required: false
88
type: string
9+
default: ""
910
image-tag:
1011
required: true
1112
type: string
1213
checkout-ref:
1314
required: true
1415
type: string
16+
runtime-platforms:
17+
description: "Comma-separated VM runtime platforms to download: linux-aarch64,linux-x86_64"
18+
required: false
19+
type: string
20+
default: "linux-aarch64,linux-x86_64"
21+
driver-targets:
22+
description: "JSON matrix entries for Linux VM driver targets"
23+
required: false
24+
type: string
25+
default: >-
26+
[{"arch":"arm64","runner":"linux-arm64-cpu8","target":"aarch64-unknown-linux-gnu","zig_target":"aarch64-unknown-linux-gnu.2.28","platform":"linux-aarch64","guest_arch":"aarch64"},{"arch":"amd64","runner":"linux-amd64-cpu8","target":"x86_64-unknown-linux-gnu","zig_target":"x86_64-unknown-linux-gnu.2.28","platform":"linux-x86_64","guest_arch":"x86_64"}]
1527
1628
permissions:
1729
contents: read
@@ -39,11 +51,29 @@ jobs:
3951
- name: Download Linux runtime tarballs
4052
env:
4153
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
RUNTIME_PLATFORMS: ${{ inputs['runtime-platforms'] }}
4255
run: |
4356
set -euo pipefail
4457
mkdir -p runtime-artifacts
4558
46-
for platform in linux-aarch64 linux-x86_64; do
59+
runtime_platforms="${RUNTIME_PLATFORMS//[[:space:]]/}"
60+
IFS=',' read -r -a platforms <<< "$runtime_platforms"
61+
if [ "${#platforms[@]}" -eq 0 ]; then
62+
echo "::error::No VM runtime platforms requested"
63+
exit 1
64+
fi
65+
for platform in "${platforms[@]}"; do
66+
case "$platform" in
67+
linux-aarch64 | linux-x86_64) ;;
68+
*)
69+
echo "::error::Unsupported VM runtime platform '$platform' in runtime-platforms"
70+
exit 1
71+
;;
72+
esac
73+
done
74+
printf '%s\n' "${platforms[@]}" > runtime-artifacts/platforms.txt
75+
76+
for platform in "${platforms[@]}"; do
4777
asset="vm-runtime-${platform}.tar.zst"
4878
echo "Downloading ${asset}..."
4979
if ! gh release download vm-runtime \
@@ -61,9 +91,9 @@ jobs:
6191
- name: Verify downloads
6292
run: |
6393
set -euo pipefail
64-
for platform in linux-aarch64 linux-x86_64; do
94+
while IFS= read -r platform; do
6595
test -f "runtime-artifacts/vm-runtime-${platform}.tar.zst"
66-
done
96+
done < runtime-artifacts/platforms.txt
6797
6898
- name: Upload runtime artifacts
6999
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
@@ -77,19 +107,7 @@ jobs:
77107
needs: [download-kernel-runtime]
78108
strategy:
79109
matrix:
80-
include:
81-
- arch: arm64
82-
runner: linux-arm64-cpu8
83-
target: aarch64-unknown-linux-gnu
84-
zig_target: aarch64-unknown-linux-gnu.2.28
85-
platform: linux-aarch64
86-
guest_arch: aarch64
87-
- arch: amd64
88-
runner: linux-amd64-cpu8
89-
target: x86_64-unknown-linux-gnu
90-
zig_target: x86_64-unknown-linux-gnu.2.28
91-
platform: linux-x86_64
92-
guest_arch: x86_64
110+
include: ${{ fromJSON(inputs['driver-targets']) }}
93111
runs-on: ${{ matrix.runner }}
94112
timeout-minutes: 30
95113
container:

0 commit comments

Comments
 (0)