Skip to content

Commit aa71920

Browse files
authored
[CI] Move yarpgen to standalone workflow (#21731)
The idea is to make yarpgen a standalone workflow, so it'd possible to launch custom yarpgen runs with other than nightly builds (e.g. release builds). In general it's a copy-paste of what we had before + some adjustments to make it work with specific artifacts.
1 parent 7e21bf5 commit aa71920

File tree

2 files changed

+90
-42
lines changed

2 files changed

+90
-42
lines changed

.github/workflows/sycl-weekly.yml

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
toolchain_artifact: sycl_linux_default
2121

2222
# This job builds SYCL-CTS with -fsycl-use-spirv-backend-for-spirv-gen.
23+
# TODO: Usually there are no new changes on weekends. Consider removing
24+
# the ubuntu2204_build job and switching to nightly build instead.
2325
build-sycl-cts:
2426
needs: ubuntu2204_build
2527
permissions:
@@ -72,45 +74,3 @@ jobs:
7274
toolchain_artifact_filename: ${{ needs.ubuntu2204_build.outputs.toolchain_artifact_filename }}
7375
toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.toolchain_decompress_command }}
7476
binaries_artifact: sycl_cts_bin
75-
76-
yarpgen:
77-
if: ${{ !cancelled() }}
78-
runs-on: ["Linux", "gen12"]
79-
container:
80-
# This workflow runs on Sundays, so in almost all cases there are no new
81-
# commits on Saturday, and therefore the latest nightly can be used.
82-
# TODO: Consider switching sycl-cts run to nightly build.
83-
image: ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest
84-
# Is it the minimum set of options to get a working toolchain?
85-
options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
86-
steps:
87-
- name: Checkout actions/source-tbb
88-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
89-
with:
90-
sparse-checkout: |
91-
devops/actions/source-tbb
92-
sparse-checkout-cone-mode: false
93-
- name: Source OneAPI TBB vars.sh
94-
uses: ./devops/actions/source-tbb
95-
- name: Set up yarpgen
96-
run: |
97-
git clone https://github.com/intel/yarpgen.git
98-
cmake -B yarpgen/build -G Ninja yarpgen/
99-
ninja -C yarpgen/build
100-
- run: sycl-ls
101-
- name: Run yarpgen
102-
run: |
103-
cd yarpgen
104-
python3 --version
105-
# A system hits OOM when using all available threads.
106-
python3 scripts/run_gen.py --target dpcpp --std sycl -t 60 -j 2
107-
- name: Pack results
108-
run: tar -czf yarpgen_results.tar.gz yarpgen/testing
109-
- uses: actions/upload-artifact@v6
110-
with:
111-
name: yarpgen_results
112-
path: yarpgen_results.tar.gz
113-
retention-days: 7
114-
- name: Clean up
115-
if: always()
116-
run: rm -rf devops yarpgen yarpgen_results.tar.gz

.github/workflows/sycl-yarpgen.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: SYCL Yarpgen
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
toolchain_run_id:
7+
description: |
8+
Run ID of a workflow run to download the toolchain artifact from.
9+
If not set, the toolchain pre-installed in the container image is used.
10+
type: string
11+
default: ''
12+
toolchain_artifact:
13+
description: Name of the artifact to download.
14+
type: string
15+
default: 'sycl_linux_default'
16+
schedule:
17+
# At 00:00 on Sunday.
18+
- cron: '0 0 * * 0'
19+
20+
permissions: read-all
21+
22+
jobs:
23+
yarpgen:
24+
runs-on: ["Linux", "gen12"]
25+
container:
26+
# This workflow runs on Sundays, so in almost all cases there are no new
27+
# commits on Saturday, and therefore the latest nightly can be used.
28+
image: ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest
29+
options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
30+
steps:
31+
- name: Checkout actions/source-tbb
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
33+
with:
34+
sparse-checkout: |
35+
devops/actions/source-tbb
36+
sparse-checkout-cone-mode: false
37+
persist-credentials: false
38+
39+
- name: Source OneAPI TBB vars.sh
40+
uses: ./devops/actions/source-tbb
41+
42+
- name: Download SYCL toolchain
43+
if: inputs.toolchain_run_id != ''
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
run: |
47+
gh run download ${{ inputs.toolchain_run_id }} \
48+
-n ${{ inputs.toolchain_artifact }} \
49+
-R ${{ github.repository }}
50+
51+
- name: Extract/Setup SYCL toolchain
52+
if: inputs.toolchain_run_id != ''
53+
run: |
54+
mkdir toolchain
55+
tar -xf ${{ inputs.toolchain_artifact }}/sycl_linux.tar.gz \
56+
-C toolchain
57+
echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV
58+
echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV
59+
60+
- run: clang++ --version
61+
62+
- run: sycl-ls
63+
64+
- name: Set up yarpgen
65+
run: |
66+
git clone https://github.com/intel/yarpgen.git
67+
cmake -B yarpgen/build -G Ninja yarpgen/
68+
ninja -C yarpgen/build
69+
70+
- name: Run yarpgen
71+
run: |
72+
cd yarpgen
73+
# A system hits OOM when using all available threads.
74+
python3 scripts/run_gen.py --target dpcpp --std sycl -t 60 -j 2 | tee yarpgen_run.log
75+
awk '/^YARPGEN runs stat:/{found=1} found {print}' yarpgen_run.log >> $GITHUB_STEP_SUMMARY
76+
77+
- name: Pack results
78+
run: tar -czf yarpgen_results.tar.gz yarpgen/testing
79+
80+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
81+
with:
82+
name: yarpgen_results
83+
path: yarpgen_results.tar.gz
84+
retention-days: 7
85+
86+
- name: Clean up
87+
if: always()
88+
run: rm -rf devops yarpgen yarpgen_results.tar.gz

0 commit comments

Comments
 (0)