Skip to content

Commit 2a3583b

Browse files
committed
ci(integration): split input preparation from runners
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent b9b5e57 commit 2a3583b

6 files changed

Lines changed: 302 additions & 143 deletions

File tree

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

Lines changed: 74 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
pull-requests: read
2424
outputs:
2525
should_run: ${{ steps.gate.outputs.should_run }}
26+
run_integration: ${{ steps.labels.outputs.run_core_e2e }}
2627
run_core_e2e: ${{ steps.labels.outputs.run_core_e2e }}
2728
run_gpu_e2e: ${{ steps.labels.outputs.run_gpu_e2e }}
2829
run_kubernetes_ha_e2e: ${{ steps.labels.outputs.run_kubernetes_ha_e2e }}
@@ -199,40 +200,82 @@ jobs:
199200
packages: write
200201
uses: ./.github/workflows/build-images.yml
201202

202-
docker-e2e:
203+
prepare-integration:
203204
needs: [pr_metadata, build-binaries, build-images]
204-
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
205+
if: needs.pr_metadata.outputs.run_integration == 'true'
205206
permissions:
206207
actions: read
207208
contents: read
208209
packages: read
209-
uses: ./.github/workflows/e2e-docker-test.yml
210+
uses: ./.github/workflows/prepare-integration-inputs.yml
211+
212+
# Run driver-independent conformance tests.
213+
conformance-integration:
214+
needs: prepare-integration
215+
permissions:
216+
actions: read
217+
contents: read
218+
packages: read
219+
uses: ./.github/workflows/integration-runner.yml
210220
with:
211-
image-tag: ${{ github.sha }}
212-
runner: linux-arm64-cpu8
213-
conformance-artifact-prefix: openshell-conformance
221+
category: conformance
222+
source-sha: ${{ needs.prepare-integration.outputs.source_sha }}
223+
integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
224+
test-matrix: >-
225+
[
226+
{"scenario":"ubuntu-docker-rootful","testsuite":"conformance"},
227+
{"scenario":"fedora-podman-rootful","testsuite":"conformance"},
228+
{"scenario":"fedora-podman-rootless","testsuite":"conformance"}
229+
]
214230
215-
podman-e2e:
216-
needs: [pr_metadata, build-binaries, build-images]
217-
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
231+
# Run feature-specific integration tests:
232+
feature-specific-integration:
233+
needs: prepare-integration
218234
permissions:
219235
actions: read
220236
contents: read
221237
packages: read
222-
uses: ./.github/workflows/tmachine-test.yml
238+
uses: ./.github/workflows/integration-runner.yml
223239
with:
240+
category: feature-specific
241+
source-sha: ${{ needs.prepare-integration.outputs.source_sha }}
242+
integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
224243
test-matrix: >-
225244
[
226-
{
227-
"scenario":"fedora-podman-rootful",
228-
"testsuite":"conformance"
229-
},
230-
{
231-
"scenario":"fedora-podman-rootful",
232-
"testsuite":"provider-refresh"
233-
}
245+
{"scenario":"fedora-podman-rootful","testsuite":"provider-refresh"},
246+
{"scenario":"fedora-podman-rootless","testsuite":"provider-refresh"}
234247
]
235248
249+
# Run driver-specific integration tests:
250+
# TODO: This should be added as soon as we have driver-specific tests enabled in tmachine.
251+
# driver-specific:
252+
# needs: prepare-integration
253+
# permissions:
254+
# actions: read
255+
# contents: read
256+
# packages: read
257+
# uses: ./.github/workflows/integration-runner.yml
258+
# with:
259+
# category: driver-specific
260+
# source-sha: ${{ needs.prepare-integration.outputs.source_sha }}
261+
# integration-inputs-artifact-id: ${{ needs.prepare-integration.outputs.integration_inputs_artifact_id }}
262+
# test-matrix: >-
263+
# [
264+
# ]
265+
266+
docker-e2e:
267+
needs: [pr_metadata, build-binaries, build-images]
268+
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
269+
permissions:
270+
actions: read
271+
contents: read
272+
packages: read
273+
uses: ./.github/workflows/e2e-docker-test.yml
274+
with:
275+
image-tag: ${{ github.sha }}
276+
runner: linux-arm64-cpu8
277+
conformance-artifact-prefix: openshell-conformance
278+
236279
vm-e2e:
237280
needs: [pr_metadata, build-binaries, build-vm-driver]
238281
if: needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
@@ -401,7 +444,19 @@ jobs:
401444

402445
core-e2e-result:
403446
name: Core E2E result
404-
needs: [pr_metadata, docker-e2e, podman-e2e, vm-e2e, docker-external-driver-e2e, podman-external-driver-e2e, vm-external-driver-e2e, kubernetes-e2e, kubernetes-external-driver-e2e, kubernetes-workspace-managed-e2e, kubernetes-workspace-operator-e2e]
447+
needs:
448+
- pr_metadata
449+
- conformance-integration
450+
- feature-specific-integration
451+
- docker-e2e
452+
- vm-e2e
453+
- docker-external-driver-e2e
454+
- podman-external-driver-e2e
455+
- vm-external-driver-e2e
456+
- kubernetes-e2e
457+
- kubernetes-external-driver-e2e
458+
- kubernetes-workspace-managed-e2e
459+
- kubernetes-workspace-operator-e2e
405460
if: always() && needs.pr_metadata.outputs.should_run == 'true' && needs.pr_metadata.outputs.run_core_e2e == 'true'
406461
runs-on: ubuntu-latest
407462
steps:
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Integration Test Runner
5+
6+
on:
7+
workflow_call:
8+
inputs:
9+
source-sha:
10+
description: Source revision of the prepared candidate artifacts
11+
required: true
12+
type: string
13+
integration-inputs-artifact-id:
14+
description: Immutable ID of the prepared integration inputs artifact
15+
required: true
16+
type: string
17+
category:
18+
description: Integration-test category, used for the job name and concurrency key
19+
required: false
20+
type: string
21+
test-matrix:
22+
description: JSON array of scenario and testsuite combinations
23+
required: false
24+
type: string
25+
default: >-
26+
[
27+
{"scenario":"ubuntu-docker-rootful","testsuite":"conformance"},
28+
{"scenario":"fedora-podman-rootful","testsuite":"conformance"},
29+
{"scenario":"fedora-podman-rootless","testsuite":"conformance"}
30+
]
31+
32+
permissions:
33+
actions: read
34+
contents: read
35+
packages: read
36+
37+
concurrency:
38+
group: ${{ github.workflow }}-integration-${{ inputs.category }}-${{ github.ref }}
39+
cancel-in-progress: true
40+
41+
jobs:
42+
integration:
43+
name: Integration test (${{ inputs.category }}, ${{ matrix.scenario }}, ${{ matrix.testsuite }})
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include: ${{ fromJSON(inputs['test-matrix']) }}
48+
runs-on: ubuntu-24.04
49+
timeout-minutes: 90
50+
steps:
51+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
52+
with:
53+
ref: ${{ inputs['source-sha'] }}
54+
persist-credentials: false
55+
56+
- name: Enable KVM access
57+
run: |
58+
set -euo pipefail
59+
if [[ ! -c /dev/kvm ]]; then
60+
echo "::error::The runner did not expose /dev/kvm"
61+
exit 1
62+
fi
63+
sudo chmod 0666 /dev/kvm
64+
exec 3<>/dev/kvm
65+
exec 3>&-
66+
67+
- uses: ./.github/actions/setup-nix
68+
69+
- name: Cache tmachine disks
70+
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
71+
with:
72+
path: ~/.cache/tmachine
73+
key: tmachine-${{ runner.os }}-${{ runner.arch }}
74+
75+
- name: Download integration inputs
76+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
77+
with:
78+
artifact-ids: ${{ inputs['integration-inputs-artifact-id'] }}
79+
path: artifacts
80+
81+
- name: Run test suite
82+
env:
83+
SCENARIO: ${{ matrix.scenario }}
84+
TESTSUITE: ${{ matrix.testsuite }}
85+
run: nix run .#tmachine -- test "${SCENARIO}" "${TESTSUITE}"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Integration Tests
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
artifact-run-id:
10+
description: Workflow run containing the candidate artifacts
11+
required: false
12+
type: string
13+
default: ""
14+
category:
15+
description: Integration-test category, used for the job name and concurrency key
16+
required: true
17+
type: string
18+
default: conformance
19+
test-matrix:
20+
description: JSON array of scenario and testsuite combinations
21+
required: true
22+
type: string
23+
default: >-
24+
[
25+
{"scenario":"ubuntu-docker-rootful","testsuite":"conformance"},
26+
{"scenario":"fedora-podman-rootful","testsuite":"conformance"},
27+
{"scenario":"fedora-podman-rootless","testsuite":"conformance"}
28+
]
29+
30+
permissions:
31+
actions: read
32+
contents: read
33+
packages: read
34+
35+
jobs:
36+
prepare:
37+
uses: ./.github/workflows/prepare-integration-inputs.yml
38+
with:
39+
artifact-run-id: ${{ inputs['artifact-run-id'] }}
40+
41+
integration:
42+
needs: prepare
43+
uses: ./.github/workflows/integration-runner.yml
44+
with:
45+
category: ${{ inputs.category }}
46+
source-sha: ${{ needs.prepare.outputs.source_sha }}
47+
integration-inputs-artifact-id: ${{ needs.prepare.outputs.integration_inputs_artifact_id }}
48+
test-matrix: ${{ inputs.test-matrix }}
Lines changed: 11 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
name: Tmachine Tests
4+
name: Prepare Integration Inputs
55

66
on:
77
workflow_call:
@@ -11,50 +11,27 @@ on:
1111
required: false
1212
type: string
1313
default: ""
14-
test-matrix:
15-
description: JSON array of scenario and testsuite combinations
16-
required: false
17-
type: string
18-
default: >-
19-
[
20-
{"scenario":"ubuntu-docker-rootful","testsuite":"conformance"},
21-
{"scenario":"fedora-podman-rootful","testsuite":"conformance"},
22-
{"scenario":"fedora-podman-rootless","testsuite":"conformance"}
23-
]
24-
workflow_dispatch:
25-
inputs:
26-
artifact-run-id:
27-
description: Workflow run containing the candidate artifacts
28-
required: false
29-
type: string
30-
default: ""
31-
test-matrix:
32-
description: JSON array of scenario and testsuite combinations
33-
required: false
34-
type: string
35-
default: >-
36-
[
37-
{"scenario":"ubuntu-docker-rootful","testsuite":"conformance"},
38-
{"scenario":"fedora-podman-rootful","testsuite":"conformance"},
39-
{"scenario":"fedora-podman-rootless","testsuite":"conformance"}
40-
]
14+
outputs:
15+
source_sha:
16+
description: Source revision of the candidate artifacts
17+
value: ${{ jobs.prepare.outputs.source_sha }}
18+
integration_inputs_artifact_id:
19+
description: Immutable ID of the prepared integration inputs artifact
20+
value: ${{ jobs.prepare.outputs.integration_inputs_artifact_id }}
4121

4222
permissions:
4323
actions: read
4424
contents: read
4525
packages: read
4626

47-
concurrency:
48-
group: ${{ github.workflow }}-conformance-${{ github.ref }}
49-
cancel-in-progress: true
50-
5127
jobs:
5228
prepare:
5329
name: Prepare tmachine inputs
5430
runs-on: ubuntu-24.04
5531
timeout-minutes: 30
5632
outputs:
5733
source_sha: ${{ steps.artifact-run.outputs.source_sha }}
34+
integration_inputs_artifact_id: ${{ steps.upload-integration-inputs.outputs.artifact-id }}
5835
steps:
5936
- name: Resolve artifact run
6037
id: artifact-run
@@ -108,57 +85,12 @@ jobs:
10885
- name: Build test archives
10986
run: nix run .#build-artifacts-test-archives
11087

111-
- name: Upload tmachine inputs
88+
- name: Upload integration inputs
89+
id: upload-integration-inputs
11290
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
11391
with:
11492
name: openshell-tmachine-inputs
11593
path: artifacts
11694
compression-level: 0
11795
retention-days: 5
11896
if-no-files-found: error
119-
120-
tmachine:
121-
name: Tmachine (${{ matrix.scenario }}, ${{ matrix.testsuite }})
122-
needs: prepare
123-
strategy:
124-
fail-fast: false
125-
matrix:
126-
include: ${{ fromJSON(inputs['test-matrix']) }}
127-
runs-on: ubuntu-24.04
128-
timeout-minutes: 90
129-
steps:
130-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
131-
with:
132-
ref: ${{ needs.prepare.outputs.source_sha }}
133-
persist-credentials: false
134-
135-
- name: Enable KVM access
136-
run: |
137-
set -euo pipefail
138-
if [[ ! -c /dev/kvm ]]; then
139-
echo "::error::The runner did not expose /dev/kvm"
140-
exit 1
141-
fi
142-
sudo chmod 0666 /dev/kvm
143-
exec 3<>/dev/kvm
144-
exec 3>&-
145-
146-
- uses: ./.github/actions/setup-nix
147-
148-
- name: Cache tmachine disks
149-
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
150-
with:
151-
path: ~/.cache/tmachine
152-
key: tmachine-${{ runner.os }}-${{ runner.arch }}
153-
154-
- name: Download tmachine inputs
155-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
156-
with:
157-
name: openshell-tmachine-inputs
158-
path: artifacts
159-
160-
- name: Run tmachine suite
161-
env:
162-
SCENARIO: ${{ matrix.scenario }}
163-
TESTSUITE: ${{ matrix.testsuite }}
164-
run: nix run .#tmachine -- test "${SCENARIO}" "${TESTSUITE}"

0 commit comments

Comments
 (0)