Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,18 @@ on:
toolchain_artifact_filename:
type: string
default: llvm_sycl.tar.zst

pack_release:
type: string
required: false

e2e_binaries_artifact:
type: string
required: false
pack_release:
e2e_binaries_spirv_backend_artifact:
type: string
required: false
e2e_binaries_preview_artifact:
type: string
required: false

Expand Down Expand Up @@ -174,6 +182,10 @@ jobs:
if: ${{ inputs.cc == 'icx' || inputs.cxx == 'icpx' }}
uses: ./devops/actions/setup_linux_oneapi_env
- name: Configure
# Setting `CMAKE_INSTALL_PREFIX` is important because that's the location
# where `sycl-linux-run-tests.yml` unpacks the toolchain to. That location
# *must* match between build-only and run-only E2E tests runs and we might
# be creating pre-built E2E tests' binaries in this workflow.
env:
CC: ${{ inputs.cc }}
CXX: ${{ inputs.cxx }}
Expand All @@ -183,7 +195,9 @@ jobs:
mkdir -p $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build \
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/toolchain \
-t Release \
--ci-defaults ${{ inputs.build_configure_extra_args }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
Expand Down Expand Up @@ -259,7 +273,7 @@ jobs:

- name: Pack toolchain release
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }}
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/toolchain .
- name: Upload toolchain release
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && inputs.pack_release == 'true' }}
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -289,7 +303,7 @@ jobs:

- name: Pack toolchain
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/build/install .
run: tar -I '${{ steps.artifact_info.outputs.COMPRESS }}' -cf ${{ steps.artifact_info.outputs.ARCHIVE_NAME }} -C $GITHUB_WORKSPACE/toolchain .
- name: Upload toolchain
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
uses: actions/upload-artifact@v4
Expand All @@ -298,14 +312,11 @@ jobs:
path: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
retention-days: ${{ inputs.retention-days }}

- name: Copy toolchain
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
# We must have the compiler in the same location as it will be in the E2E
# run-tests job.
run: cp -r $GITHUB_WORKSPACE/build/install $GITHUB_WORKSPACE/toolchain

- name: Source OneAPI TBB vars.sh
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
# Tasks that use the just built toolchain below, need extra environment
# setup. No harm in it if all of those tasks would get skipped.
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
run: |
# https://github.com/actions/runner/issues/1964 prevents us from using
# the ENTRYPOINT in the image.
Expand Down Expand Up @@ -333,31 +344,31 @@ jobs:
extra_lit_opts: --param sycl_build_targets="spir;nvidia;amd"

- name: Remove E2E tests before spirv-backend run
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
if: ${{ inputs.e2e_binaries_spirv_backend_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
run: rm -rf build-e2e

- name: Build E2E tests with SPIR-V Backend
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
if: ${{ inputs.e2e_binaries_spirv_backend_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
uses: ./devops/actions/run-tests/e2e
with:
ref: ${{ inputs.ref || github.sha }}
testing_mode: build-only
target_devices: all
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_spirv_backend
binaries_artifact: ${{ inputs.e2e_binaries_spirv_backend_artifact }}
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
extra_lit_opts: --param spirv-backend=True

- name: Remove E2E tests before preview-mode run
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
if: ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
run: rm -rf build-e2e

- name: Build E2E tests in Preview Mode
if: ${{ inputs.e2e_binaries_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
if: ${{ inputs.e2e_binaries_preview_artifact && always() && !cancelled() && steps.build.conclusion == 'success' }}
uses: ./devops/actions/run-tests/e2e
with:
ref: ${{ inputs.ref || github.sha }}
testing_mode: build-only
target_devices: all
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}_preview
binaries_artifact: ${{ inputs.e2e_binaries_preview_artifact }}
sycl_compiler: $GITHUB_WORKSPACE/toolchain/bin/clang++
extra_lit_opts: --param test-preview-mode=True
10 changes: 6 additions & 4 deletions .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ jobs:
changes: ${{ needs.detect_changes.outputs.filters }}

toolchain_artifact: sycl_linux_default
e2e_binaries_artifact: sycl_e2e_bin_default
e2e_binaries_artifact: e2e_bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again not really related but i wonder if we really need to expose as inputs to sycl-linux-build, could we just require they are e2e_bin{_spirv_backend, _preview}? i don't expect these will ever be used by anyone outside of CI testing so the name shouldnt matter to anyone

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I'm trying to do is to allow specifying only some kinds of e2e tests vs all-or-nothing (I'm not interested in preview mode when creating a container image for the compatibility testing).

It doesn't make much difference between three bools with default names vs three explicit names. However, we do need to pass the names later on to sycl-linux-run-tests.yml and it's easier if the names are defined here vs defaulted inside the sycl-linux-build.yml workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can also think of possibly having two toolchain builds (e.g. libstdc++ and libcxx) in a single task (e.g. Nightly/Weekly). We'd need to separate e2e tests built with either toolchain, so having this name would be handy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it thx

e2e_binaries_spirv_backend_artifact: e2e_bin_spirv_backend
e2e_binaries_preview_artifact: e2e_bin_preview

# If a PR changes CUDA adapter, run the build on Ubuntu 22.04 as well.
# Ubuntu 22.04 container has CUDA 12.1 installed while Ubuntu 24.0 image
Expand Down Expand Up @@ -131,13 +133,13 @@ jobs:
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
extra_lit_opts: --param spirv-backend=True
e2e_binaries_artifact: sycl_e2e_bin_default_spirv_backend
e2e_binaries_artifact: e2e_bin_spirv_backend
- name: Preview Mode
runner: '["Linux", "gen12"]'
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu;opencl:gpu;opencl:cpu
extra_lit_opts: --param test-preview-mode=True
e2e_binaries_artifact: sycl_e2e_bin_default_preview
e2e_binaries_artifact: e2e_bin_preview
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kinda of a nit maybe but i wonder if we could single-source these names by making it an output of the build step one something or some workflow global var or something

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a good way to do that... The fact that we have any tests built in the sycl-*-build.yml is kind of a hack to improve CI performance as we avoid extra job/upload/download by building the tests in the same job/on the same runner. That hack in itself is causing this weirdness.


uses: ./.github/workflows/sycl-linux-run-tests.yml
with:
Expand All @@ -151,7 +153,7 @@ jobs:
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }}
e2e_binaries_artifact: ${{ matrix.e2e_binaries_artifact || 'sycl_e2e_bin_default' }}
e2e_binaries_artifact: ${{ matrix.e2e_binaries_artifact || 'e2e_bin' }}
e2e_testing_mode: 'run-only'

# Do not install drivers on AMD and CUDA runners.
Expand Down
Loading