Skip to content

Commit

Permalink
github action now runs on any of our internal runners (#148)
Browse files Browse the repository at this point in the history
The action runs in a docker container that has:
    - ubuntu-22-04
    - oneAPI 2024.1.0
    - Agama driver 821.36

    Additionally it installs the l_compiler_p_2024.1.1.61_offline.sh
    in a different directory than traditional oneAPI so that
    it may be overlayed in the environment. This is the reason
    for the quirk of sourcing 2 setvars.sh
  • Loading branch information
tomasrodi authored May 3, 2024
1 parent 921c4d8 commit 055c9f2
Showing 1 changed file with 53 additions and 7 deletions.
60 changes: 53 additions & 7 deletions .github/workflows/sdk_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,38 @@ on:
pull_request:
branches: [ "master" ]

defaults:
run:
shell: bash

permissions:
contents: read

jobs:
sdk-build-and-test:
name: Test suite of pti library

container:
image: ${{ vars.PTI_DOCKER_IMAGE }}
options: --device=/dev/dri --cap-add CAP_PERFMON

if: vars.PTI_RUN_TESTS == 1
runs-on: self-hosted

#
# pti is a selector to machines with Intel Ponte Vecchio officially
# Intel(R) Data Center GPU Max 1100
#
runs-on: [pti]

#
# A note regarding the double call of source in every step in the
# sdk-build-and-test workflow.
#
# The first call to source is running oneapi-v2024.1.0
# the second call to source overlays the compiler 2024.1.1
#
# This will be improved in due course.
#
steps:
- name: Clean-up
run: rm -rf *
Expand All @@ -25,25 +48,33 @@ jobs:
- name: Build
working-directory: sdk
run: |
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapinext/setvars.sh --force
cmake --preset default
cmake --build --preset default -j $(($(nproc)/2))
- name: Test
working-directory: sdk
run: |
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapinext/setvars.sh --force
ctest --output-on-failure --preset default
- name: Build AddressSanitizer
if: always()
working-directory: sdk
run: |
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapinext/setvars.sh --force
cmake --preset asan
cmake --build --preset asan --parallel $(($(nproc)/2))
- name: Build ThreadSanitizer
if: always()
working-directory: sdk
run: |
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapinext/setvars.sh --force
cmake --preset tsan
cmake --build --preset tsan --parallel $(($(nproc)/2))
Expand All @@ -53,24 +84,32 @@ jobs:
run: |
# To ensure it still builds, run build for fuzz targets until we have
# proper fuzz testing infrastructure in place.
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapinext/setvars.sh --force
cmake --preset fuzz
cmake --build --preset fuzz --parallel $(($(nproc)/2))
- name: Test AddressSanitizer
if: always()
working-directory: sdk
run: |
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapinext/setvars.sh --force
ctest --preset asan --output-on-failure -L samples
- name: Test ThreadSanitizer
if: always()
working-directory: sdk
run: |
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapinext/setvars.sh --force
ctest --preset tsan --output-on-failure -L samples
- name: Install SDK
working-directory: sdk
run: |
source /opt/intel/oneapi/setvars.sh
source /opt/intel/oneapinext/setvars.sh --force
cmake --install build --config Release --prefix out
- name: Upload SDK
Expand All @@ -82,13 +121,14 @@ jobs:
pti-tools-build-and-test:

needs: sdk-build-and-test # this is a workaround to ensure jobs run sequentially
# TODO make the workflow more generic

# run this job only if the previous one run and provided some result
if: (needs.sdk-build-and-test.result == 'success' || needs.sdk-build-and-test.result == 'failure' )
container:
image: ${{ vars.PTI_DOCKER_IMAGE }}
#
# Sprinkle in the magic docker ingredients and poof!
#
options: "--device=/dev/dri --cap-add CAP_PERFMON "

runs-on: self-hosted
runs-on: [pti]

steps:
- name: Clean-up
Expand All @@ -99,29 +139,35 @@ jobs:

- name: Build-and-test-unitrace
run: |
source /opt/intel/oneapi/setvars.sh
python ./tests/run.py -s unitrace
- name: Build-and-test-onetrace
if: always()
run: |
source /opt/intel/oneapi/setvars.sh
python ./tests/run.py -s onetrace
- name: Build-and-test-oneprof
if: always()
run: |
source /opt/intel/oneapi/setvars.sh
python ./tests/run.py -s oneprof
- name: Build-and-test-sysmon
if: always()
run: |
source /opt/intel/oneapi/setvars.sh
python ./tests/run.py -s sysmon
- name: Build-and-test-cl_gpu_metrics
if: always()
run: |
source /opt/intel/oneapi/setvars.sh
python ./tests/run.py -s cl_gpu_metrics
- name: Build-and-test-gpu-inst-count
if: always()
run: |
source /opt/intel/oneapi/setvars.sh
python ./tests/run.py -s gpu_inst_count

0 comments on commit 055c9f2

Please sign in to comment.