Skip to content

Commit 377ce24

Browse files
[CI] Use single reusable workflow for E2E tests on Linux (#10292)
The workflow will be shared between normal "Build + E2E" and "E2E on Nightly" tasks.
1 parent 3fea807 commit 377ce24

File tree

4 files changed

+78
-130
lines changed

4 files changed

+78
-130
lines changed

.github/workflows/linux_matrix_e2e_on_nightly.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,33 @@ jobs:
2222
- name: AMD/HIP
2323
runner: '["Linux", "amdgpu"]'
2424
image: ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build
25-
extra_cmake_args: -DHIP_PLATFORM="AMD" -DAMD_ARCH="gfx1031"
2625
extra_image_opts: --device=/dev/kfd
26+
extra_cmake_args: -DHIP_PLATFORM="AMD" -DAMD_ARCH="gfx1031"
2727
target_devices: ext_oneapi_hip:gpu
2828
reset_gpu: false
2929

3030
- name: Intel
3131
runner: '["Linux", "gen9"]'
3232
image: ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:latest
33-
extra_cmake_args:
3433
extra_image_opts: -u 1001
34+
extra_cmake_args:
3535
target_devices: ext_oneapi_level_zero:gpu;opencl:gpu;opencl:cpu
3636
reset_gpu: true
3737

3838
- name: ESIMD Emu
3939
runner: '["Linux", "x86-cpu"]'
4040
image: ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:latest
41-
extra_cmake_args:
4241
extra_image_opts: -u 1001
42+
extra_cmake_args:
4343
target_devices: ext_intel_esimd_emulator:gpu
4444
reset_gpu: false
45-
uses: ./.github/workflows/linux_single_e2e_on_nightly.yml
45+
uses: ./.github/workflows/linux_single_e2e.yml
4646
with:
4747
name: ${{ matrix.name }}
4848
runner: ${{ matrix. runner }}
4949
image: ${{ matrix.image }}
50+
image_options: --device=/dev/dri --privileged --cap-add SYS_ADMIN ${{ matrix.extra_image_opts }}
5051
extra_cmake_args: ${{ matrix.extra_cmake_args }}
51-
extra_image_opts: ${{ matrix.extra_image_opts }}
5252
target_devices: ${{ matrix.target_devices }}
5353
ref: ${{ inputs.ref }}
5454
reset_gpu: ${{ matrix.reset_gpu }}
@@ -64,13 +64,13 @@ jobs:
6464
linux_e2e_on_nightly_aws:
6565
name: '[AWS][CUDA] E2E on Nightly'
6666
needs: [aws_start]
67-
uses: ./.github/workflows/linux_single_e2e_on_nightly.yml
67+
uses: ./.github/workflows/linux_single_e2e.yml
6868
with:
6969
name: CUDA
7070
runner: '["aws-cuda_${{ inputs.uniq }}"]'
7171
image: ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build
72+
image_options: --device=/dev/dri --privileged --cap-add SYS_ADMIN --gpus all
7273
extra_cmake_args:
73-
extra_image_opts: --gpus all
7474
target_devices: all
7575
ref: ${{ inputs.ref }}
7676
reset_gpu: false
Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: SYCL E2E on Nightly build
1+
name: SYCL E2E
22

33
on:
44
workflow_call:
@@ -9,9 +9,9 @@ on:
99
type: string
1010
image:
1111
type: string
12-
extra_cmake_args:
12+
image_options:
1313
type: string
14-
extra_image_opts:
14+
extra_cmake_args:
1515
type: string
1616
target_devices:
1717
type: string
@@ -20,13 +20,28 @@ on:
2020
reset_gpu:
2121
type: string
2222

23+
sycl_toolchain_artifact:
24+
type: string
25+
default: ''
26+
sycl_toolchain_archive:
27+
type: string
28+
default: ''
29+
sycl_toolchain_decompress_command:
30+
type: string
31+
default: ''
32+
33+
env:
34+
type: string
35+
default: '{}'
36+
2337
jobs:
2438
lin_e2e_only:
2539
name: ${{ inputs.name }}
2640
runs-on: ${{ fromJSON(inputs.runner) }}
2741
container:
2842
image: ${{ inputs.image }}
29-
options: --device=/dev/dri --privileged --cap-add SYS_ADMIN ${{ inputs.extra_image_opts }}
43+
options: ${{ inputs.image_options }}
44+
env: ${{ fromJSON(inputs.env) }}
3045
steps:
3146
- name: Reset GPU
3247
if: inputs.reset_gpu == 'true'
@@ -39,29 +54,56 @@ jobs:
3954
ref: ${{ inputs.ref }}
4055
sparse-checkout: |
4156
devops/actions
57+
devops/scripts/get_release.py
4258
sycl/test-e2e
4359
llvm/utils
60+
- name: Install drivers
61+
if: env.compute_runtime_tag != ''
62+
run: |
63+
if [ -e /opt/install_drivers.sh ]; then
64+
# TODO pack this script into container
65+
sudo cp llvm/devops/scripts/get_release.py /opt/
66+
sudo -E /opt/install_drivers.sh --all
67+
fi
4468
- name: Register cleanup after job is finished
4569
uses: ./llvm/devops/actions/cleanup
46-
- name: Configure
47-
run: |
48-
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DSYCL_TEST_E2E_TARGETS="${{ inputs.target_devices }}" -DCMAKE_CXX_COMPILER="clang++" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ inputs.extra_cmake_args }}
49-
# opencl:cpu backend won't be visible in the sycl-ls commands below, see the
50-
# comment below referencing https://github.com/actions/runner/issues/1964.
51-
- run: sycl-ls --verbose
52-
- run: SYCL_PI_TRACE=-1 sycl-ls
53-
- name: SYCL End-to-end tests
54-
env:
55-
LIT_OPTS: -v --no-progress-bar --show-unsupported --max-time 3600 --time-tests
70+
- name: Source OneAPI TBB vars.sh
5671
shell: bash
5772
run: |
5873
# https://github.com/actions/runner/issues/1964 prevents us from using
5974
# the ENTRYPOINT in the image.
75+
env | sort > env_before
6076
if [ -e /runtimes/oneapi-tbb/env/vars.sh ]; then
6177
source /runtimes/oneapi-tbb/env/vars.sh;
6278
elif [ -e /opt/runtimes/oneapi-tbb/env/vars.sh ]; then
6379
source /opt/runtimes/oneapi-tbb/env/vars.sh;
6480
else
6581
echo "no TBB vars in /opt/runtimes or /runtimes";
6682
fi
83+
env | sort > env_after
84+
comm -13 env_before env_after >> $GITHUB_ENV
85+
rm env_before env_after
86+
- name: Download SYCL toolchain
87+
if: inputs.sycl_toolchain_artifact != ''
88+
uses: actions/download-artifact@v3
89+
with:
90+
name: ${{ inputs.sycl_toolchain_artifact }}
91+
- name: Extract/Setup SYCL toolchain
92+
if: inputs.sycl_toolchain_artifact != ''
93+
run: |
94+
mkdir toolchain
95+
tar -I '${{ inputs.sycl_toolchain_decompress_command }}' -xf ${{ inputs.sycl_toolchain_archive }} -C toolchain
96+
rm -f ${{ inputs.sycl_toolchain_archive }}
97+
echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV
98+
echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV
99+
- run: which clang++ sycl-ls
100+
- run: sycl-ls --verbose
101+
- run: SYCL_PI_TRACE=-1 sycl-ls
102+
- name: Configure
103+
run: |
104+
cmake -GNinja -B./build-e2e -S./llvm/sycl/test-e2e -DSYCL_TEST_E2E_TARGETS="${{ inputs.target_devices }}" -DCMAKE_CXX_COMPILER="$(which clang++)" -DLLVM_LIT="$PWD/llvm/llvm/utils/lit/lit.py" ${{ inputs.extra_cmake_args }}
105+
- name: SYCL End-to-end tests
106+
env:
107+
LIT_OPTS: -v --no-progress-bar --show-unsupported --max-time 3600 --time-tests
108+
run: |
67109
ninja -C build-e2e check-sycl-e2e

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -222,45 +222,22 @@ jobs:
222222
fail-fast: false
223223
matrix:
224224
include: ${{ fromJSON(inputs.lts_matrix) }}
225-
name: ${{ matrix.name }}
226-
runs-on: ${{ matrix.runs-on }}
227-
env: ${{ matrix.env }}
228-
container:
225+
uses: ./.github/workflows/linux_single_e2e.yml
226+
with:
227+
name: ${{ matrix.name }}
228+
runner: ${{ toJSON(matrix.runs-on) }}
229229
image: ${{ matrix.image }}
230-
options: ${{ matrix.container_options }}
231-
steps:
232-
- name: Reset GPU
233-
if: ${{ contains(matrix.runs-on, 'gen9') && contains(matrix.runs-on, 'Linux') }}
234-
run: |
235-
sudo mount -t debugfs none /sys/kernel/debug
236-
sudo bash -c 'echo 1 > /sys/kernel/debug/dri/0/i915_wedged'
237-
- run: cp -r /actions .
238-
- name: Register cleanup after job is finished
239-
uses: ./actions/cleanup
240-
- name: Install drivers
241-
if: env.compute_runtime_tag != ''
242-
run: |
243-
if [ -e /opt/install_drivers.sh ]; then
244-
# TODO pack this script into container
245-
wget raw.githubusercontent.com/intel/llvm/${{ github.sha }}/devops/scripts/get_release.py
246-
sudo mv get_release.py /opt/
247-
sudo -E /opt/install_drivers.sh --all
248-
fi
249-
# FIXME cached_checkout fails here, but works everywhere else
250-
- uses: actions/checkout@v3
251-
with:
252-
persist-credentials: false
253-
path: llvm
254-
ref: ${{ inputs.build_ref || github.sha }}
255-
# TODO should this action be packed into container as well?
256-
- uses: ./llvm/devops/actions/e2e-tests
257-
name: Run SYCL End-to-End tests
258-
with:
259-
sycl_artifact: sycl_linux_${{ inputs.build_artifact_suffix }}
260-
sycl_archive: ${{ inputs.artifact_archive_name }}
261-
decompress_command: ${{ inputs.artifact_decompress_command }}
262-
targets: ${{ matrix.targets }}
263-
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
230+
image_options: ${{ matrix.container_options }}
231+
extra_cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'
232+
target_devices: ${{ matrix.targets }}
233+
ref: ${{ inputs.build_ref || github.sha }}
234+
reset_gpu: ${{ contains(matrix.runs-on, 'gen9') && contains(matrix.runs-on, 'Linux') }}
235+
236+
sycl_toolchain_artifact: sycl_linux_${{ inputs.build_artifact_suffix }}
237+
sycl_toolchain_archive: ${{ inputs.artifact_archive_name }}
238+
sycl_toolchain_decompress_command: ${{ inputs.artifact_decompress_command }}
239+
240+
env: ${{ toJSON(matrix.env) }}
264241

265242
khronos_sycl_cts:
266243
needs: build

devops/actions/e2e-tests/action.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)