Skip to content

Commit cec8472

Browse files
Container with pre-built E2E
1 parent 788d8d3 commit cec8472

File tree

4 files changed

+133
-82
lines changed

4 files changed

+133
-82
lines changed
Lines changed: 85 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,101 @@
1-
name: CI Containers
1+
name: Create container with pre-built tests
2+
23
on:
34
workflow_dispatch:
4-
schedule:
5-
# Every 1st and 15th day of month
6-
- cron: '0 0 1,15 * *'
7-
push:
8-
branches:
9-
- sycl
10-
paths:
11-
- 'devops/actions/build_container/**'
12-
- 'devops/containers/**'
13-
- 'devops/dependencies.json'
14-
- 'devops/scripts/install_drivers.sh'
15-
- 'devops/scripts/install_build_tools.sh'
16-
- '.github/workflows/sycl-containers.yaml'
17-
pull_request:
18-
paths:
19-
- 'devops/actions/build_container/**'
20-
- 'devops/containers/**'
21-
- 'devops/dependencies.json'
22-
- 'devops/scripts/install_drivers.sh'
23-
- 'devops/scripts/install_build_tools.sh'
24-
- '.github/workflows/sycl-containers.yaml'
5+
inputs:
6+
ref:
7+
type: string
8+
description: tag/sha
9+
required: true
10+
default: nightly-2025-07-18
2511

2612
permissions: read-all
2713

2814
jobs:
29-
build_and_push_images:
30-
if: github.repository == 'intel/llvm'
31-
name: Build and Push Docker Images
32-
runs-on: ubuntu-latest
15+
build:
16+
uses: ./.github/workflows/sycl-linux-build.yml
17+
with:
18+
build_ref: ${{ inputs.ref }}
19+
build_cache_root: "/__w/"
20+
21+
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest"
22+
cc: clang
23+
cxx: clang++
24+
25+
changes: '[]'
26+
27+
toolchain_artifact: toolchain
28+
toolchain_artifact_filename: toolchain.tar.zst
29+
e2e_binaries_artifact: e2e_bin
30+
31+
# Couldn't make it work from inside the container, so have to use an extra job
32+
# and pass an artifact.
33+
docker:
34+
runs-on: [Linux, build]
35+
needs: build
3336
permissions:
3437
packages: write
35-
strategy:
36-
matrix:
37-
include:
38-
- name: Base Ubuntu 22.04 Docker image
39-
file: ubuntu2204_base
40-
tag: latest
41-
build_args: ""
42-
- name: Base Ubuntu 24.04 Docker image
43-
file: ubuntu2404_base
44-
tag: latest
45-
build_args: ""
46-
- name: Build Ubuntu 22.04 Docker image
47-
file: ubuntu2204_build
48-
tag: latest
49-
build_args: ""
50-
- name: Build Ubuntu 24.04 Docker image
51-
file: ubuntu2404_build
52-
tag: latest
53-
build_args: ""
54-
- name: Intel Drivers Ubuntu 22.04 Docker image
55-
file: ubuntu2204_intel_drivers
56-
tag: latest
57-
build_args: ""
58-
- name: Intel Drivers Ubuntu 24.04 Docker image
59-
file: ubuntu2404_intel_drivers
60-
tag: latest
61-
build_args: ""
62-
- name: Build + Intel Drivers Ubuntu 22.04 Docker image
63-
file: ubuntu2204_intel_drivers
64-
tag: alldeps
65-
build_args: |
66-
base_image=ghcr.io/intel/llvm/ubuntu2204_build
67-
base_tag=latest
68-
- name: Build + Intel Drivers Ubuntu 24.04 Docker image
69-
file: ubuntu2404_intel_drivers
70-
tag: alldeps
71-
build_args: |
72-
base_image=ghcr.io/intel/llvm/ubuntu2404_build
73-
base_tag=latest
38+
if: always()
7439
steps:
75-
- name: Checkout
76-
uses: actions/checkout@v4
40+
- uses: actions/checkout@v4
41+
with:
42+
sparse-checkout: |
43+
devops/
44+
45+
- uses: actions/checkout@v4
7746
with:
78-
fetch-depth: 2
79-
- name: Build and Push Container
47+
ref: ${{ inputs.ref }}
48+
path: llvm
49+
sparse-checkout: |
50+
llvm/utils/lit
51+
sycl/test-e2e
52+
- name: Pack sources
53+
run: |
54+
tar -I 'zstd -9' -cf devops/e2e_sources.tar.zst -C ./llvm .
55+
56+
- uses: actions/download-artifact@v4
57+
with:
58+
name: toolchain
59+
path: devops/
60+
- uses: actions/download-artifact@v4
61+
with:
62+
name: e2e_bin
63+
path: devops/
64+
65+
66+
- name: Build container
8067
uses: ./devops/actions/build_container
8168
with:
82-
push: ${{ github.event_name != 'pull_request' }}
83-
file: ${{ matrix.file }}
69+
push: true
70+
file: release_tests_binaries
8471
username: ${{ github.repository_owner }}
8572
password: ${{ secrets.GITHUB_TOKEN }}
8673
tags: |
87-
ghcr.io/${{ github.repository }}/${{ matrix.file }}:${{ matrix.tag }}-${{ github.sha }}
88-
ghcr.io/${{ github.repository }}/${{ matrix.file }}:${{ matrix.tag }}
89-
build-args: ${{ matrix.build_args }}
74+
ghcr.io/${{ github.repository }}/sycl_prebuilt_tests:${{ inputs.ref }}
9075
76+
run-e2e:
77+
runs-on: [Linux, pvc]
78+
needs: [docker, build]
79+
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
80+
container:
81+
image: ghcr.io/${{ github.repository }}/sycl_prebuilt_tests:${{ inputs.ref }}
82+
options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
83+
steps:
84+
- uses: actions/checkout@v4
85+
with:
86+
sparse-checkout: |
87+
devops
88+
- run: |
89+
mkdir toolchain
90+
tar -I 'zstd' -xf /sycl-prebuilt/toolchain.tar.zst -C toolchain
91+
echo LD_LIBRARY_PATH=$PWD/toolchain/lib:$LD_LIBRARY_PATH >> $GITHUB_ENV
92+
echo PATH=$PWD/toolchain/bin:$PATH >> $GITHUB_ENV
93+
- run: |
94+
sycl-ls
95+
- name: Run E2E tests
96+
uses: ./devops/actions/run-tests/e2e
97+
timeout-minutes: 60
98+
with:
99+
ref: ${{ inputs.ref }}
100+
testing_mode: run-only
101+
target_devices: level_zero:gpu

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ on:
3737

3838
repo_ref:
3939
type: string
40-
required: True
40+
required: False
4141
description: |
4242
Commit SHA or branch to checkout the intel/llvm repo.
4343
tests_ref:
@@ -60,9 +60,10 @@ on:
6060

6161
e2e_binaries_artifact:
6262
description: |
63-
Must be set if `e2e_testing_mode` is equal to `run-only` and the
64-
artifact must exist. Can be set in other modes resulting in artifact
65-
upload.
63+
When set in modes other than `run-only` results in artifact upload.
64+
For `run-only` mode, if specified, means downloading pre-built
65+
binaries from the artifact, otherwise they are expected to be part of
66+
the container.
6667
type: string
6768
default: ''
6869
required: False
@@ -144,17 +145,21 @@ on:
144145
runner:
145146
type: choice
146147
options:
148+
- '["Linux", "pvc"]'
147149
- '["Linux", "gen12"]'
148150
- '["amdgpu"]'
149151
- '["Linux", "arc"]'
150-
- '["Linux", "pvc"]'
151152
- '["cts-cpu"]'
152153
- '["Linux", "build"]'
153154
- '["cuda"]'
154155
- '["PVC_PERF"]'
155156
image:
156157
type: choice
157158
options:
159+
- 'ghcr.io/intel/llvm/sycl_prebuilt_tests:sycl-rel-6_2'
160+
- 'ghcr.io/intel/llvm/sycl_prebuilt_tests:v6.1.0'
161+
- 'ghcr.io/intel/llvm/sycl_prebuilt_tests:nightly-2025-06-20'
162+
- 'ghcr.io/intel/llvm/sycl_prebuilt_tests:nightly-2025-07-18'
158163
- 'ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest'
159164
- 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps'
160165
image_options:
@@ -205,6 +210,7 @@ on:
205210
options:
206211
- "full"
207212
- "build-only"
213+
- "run-only"
208214

209215
permissions:
210216
contents: read

devops/actions/run-tests/e2e/action.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,34 @@ runs:
2424
using: "composite"
2525
steps:
2626
- name: Checkout E2E tests
27+
if: ${{ inputs.testing_mode != 'run-only' || inputs.binaries_artifact }}
2728
uses: actions/checkout@v4
2829
with:
2930
path: llvm
3031
ref: ${{ inputs.ref || github.sha }}
3132
sparse-checkout: |
3233
llvm/utils/lit
3334
sycl/test-e2e
34-
3535
- name: Download E2E Binaries
36-
if: inputs.testing_mode == 'run-only'
36+
if: ${{ inputs.testing_mode == 'run-only' && inputs.binaries_artifact != '' }}
3737
uses: actions/download-artifact@v4
3838
with:
3939
name: ${{ inputs.binaries_artifact }}
4040
- name: Extract E2E Binaries
41-
if: inputs.testing_mode == 'run-only'
41+
if: ${{ inputs.testing_mode == 'run-only' && inputs.binaries_artifact != '' }}
4242
shell: bash
4343
run: |
4444
mkdir build-e2e
4545
tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e
4646
47+
- name: Extract E2E tests from container image
48+
if: ${{ inputs.testing_mode == 'run-only' && inputs.binaries_artifact == '' }}
49+
shell: bash
50+
run: |
51+
mkdir build-e2e llvm
52+
tar -I 'zstd' -xf /sycl-prebuilt/e2e_binaries.tar.zst -C build-e2e
53+
tar -I 'zstd' -xf /sycl-prebuilt/e2e_sources.tar.zst -C llvm
54+
4755
- name: Deduce E2E CMake options
4856
if: inputs.testing_mode != 'run-only'
4957
id: cmake_opts
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ARG base_tag=alldeps
2+
ARG base_image=ghcr.io/intel/llvm/ubuntu2404_intel_drivers
3+
4+
FROM $base_image:$base_tag
5+
6+
# Actual CI maps volumes via something like "/runner/host/path":"/__w/", so
7+
# these won't be visible there. They can be used when manually reproducing
8+
# issues though. Path `/__w/llvm/llvm` is the property of Github Actions and
9+
# when CMake configures E2E tests this path is hardcoded in both CMake files and
10+
# e2e binaries themselve. As such, it's useful to have these in the image for
11+
# local manual experiments.
12+
#
13+
# One can map volumes as "/host/system/new/toolchain":"/__w/llvm/llvm/toolchain"
14+
# to override the toolchain in order to run the tests with local SYCL RT instead
15+
# of using the release RT included in this image.
16+
ADD --chown=sycl:sycl toolchain.tar.zst /__w/llvm/llvm/toolchain
17+
ADD --chown=sycl:sycl e2e_binaries.tar.zst /__w/llvm/llvm/build-e2e
18+
ADD --chown=sycl:sycl e2e_sources.tar.zst /__w/llvm/llvm/llvm
19+
20+
# Since `/__w/llvm/llvm` above is overriden by GHA, need to provide the
21+
# following for using in CI:
22+
COPY e2e_binaries.tar.zst /sycl-prebuilt/
23+
COPY e2e_sources.tar.zst /sycl-prebuilt/
24+
COPY toolchain.tar.zst /sycl-prebuilt/
25+
26+
COPY scripts/drivers_entrypoint.sh /drivers_entrypoint.sh

0 commit comments

Comments
 (0)