Skip to content

Commit

Permalink
Try using actions/download artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
coldav committed Mar 7, 2025
1 parent 57f3443 commit 5da97e9
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 87 deletions.
5 changes: 5 additions & 0 deletions .github/actions/do_build_ock_artefact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
llvm_version:
description: 'llvm version we want to use (18-19)'
default: '19'
llvm_source:
required: false
type: string
default: 'cache'
target:
description: 'target architecture'
download_ock_artefact:
Expand Down Expand Up @@ -40,6 +44,7 @@ runs:
&& 'none' || steps.calc_vars.outputs.arch }}
os: ${{ contains(inputs.target, 'windows') && 'windows' || 'ubuntu' }}
ubuntu_version: ${{ contains(inputs.target, 'riscv64') && '24.04' || '22.04' }}
llvm_source: ${{ inputs.llvm_source }}

- name: build native ock - x86_64 and aarch64
if: ( steps.calc_vars.outputs.arch == 'x86_64' || steps.calc_vars.outputs.arch == 'aarch64' )
Expand Down
26 changes: 25 additions & 1 deletion .github/actions/setup_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,42 @@ runs:
ln -s /usr/lib/llvm-${{ inputs.llvm_version }} llvm_install
- name: download llvm native
if: inputs.llvm_source != 'install' && inputs.llvm_source != 'cache'
uses: actions/download-artifact@v4
with:
name: llvm-${{ inputs.os }}-${{ steps.set_llvm_key.outputs.key_version }}-${{ steps.set_llvm_key.outputs.key_native_arch }}-${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
#llvm-ubuntu-22.04-x86_64-19-RelAssert
run-id: ${{ inputs.llvm_source }}
github-token: ${{ env.GH_TOKEN }}
path: llvm_install

- shell: bash
if: inputs.cross_arch != 'none'
run: mv llvm_install llvm_install_native

- name: load llvm cross
- name: load llvm cross cache
if: inputs.cross_arch != 'none' && inputs.llvm_source == 'cache'
uses: actions/cache/restore@v4
with:
path: llvm_install/**
key: llvm-${{ inputs.os }}-${{ steps.set_llvm_key.outputs.key_version }}-${{ steps.set_llvm_key.outputs.key_arch }}-v${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
fail-on-cache-miss: true

- name: load llvm cross download
if: inputs.cross_arch != 'none' && inputs.llvm_source != 'cache' && inputs.llvm_source != 'install'
uses: actions/download-artifact@v4
with:
name: llvm-${{ inputs.os }}-${{ steps.set_llvm_key.outputs.key_version }}-${{ steps.set_llvm_key.outputs.key_native_arch }}-${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
#llvm-ubuntu-22.04-x86_64-19-RelAssert
run-id: ${{ inputs.llvm_source }}
github-token: ${{ env.GH_TOKEN }}
path: llvm_install

- shell: bash
# TODO make artifacts using tar so we don't need to do this.
run: chmod +x llvm_install*/bin/*

# note the PR testing usage should set 'save' to false, to avoid PR testing creating new caches on a branch
- name: Setup ccache
uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/test_llvm_download/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: test llvm download
description: test llvm download

inputs:
token:
description: 'token for download'

runs:
using: "composite"
steps:
- name: Try downloading llvm install
uses: actions/download-artifact@v4
with:
name: llvm-ubuntu-22.04-x86_64-19-RelAssert
run-id: 13593517156
# github-token: ${{ inputs.token }}
github-token: ${{ env.GH_TOKEN }}
97 changes: 49 additions & 48 deletions .github/workflows/create_llvm_artefacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,53 @@ jobs:
create_llvm_artifacts:
strategy:
matrix:
# os: [ubuntu-22.04, ubuntu-24.04, windows-2019]
os: [ubuntu-22.04, ubuntu-24.04, windows-2019]
build_type: [RelAssert]
arch : [x86, x86_64, aarch64, riscv64]
exclude:
# Reduce the versions of llvm for aarch64, riscv64 & x86 architectures and windows, as
# well as any windows os variants
- os: windows-2019
arch: aarch64
- os: windows-2019
arch: riscv64
- os: windows-2019
arch: x86

- os: ubuntu-22.04
arch: riscv64
- os: ubuntu-24.04
arch: aarch64
- os: ubuntu-24.04
arch: x86
include:
# We want to set flags related to particular matrix dimensions. To do this
# we need to create default values first, and then against particular matrix
# dimensions.
# Note that we need to use RelAssert as the cache key matching can match Release against ReleaseAssert
- os_flags:
- arch_flags:
- build_type_flags:
- build_type_flags: -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON
build_type: RelAssert
- arch_flags: -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/ock/platform/arm-linux/aarch64-toolchain.cmake"
-DLLVM_HOST_TRIPLE=aarch64-unknown-linux-gnu
arch: aarch64
- arch_flags: -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/ock/platform/riscv64-linux/riscv64-gcc-toolchain.cmake"
-DLLVM_HOST_TRIPLE=riscv64-unknown-linux-gnu
arch: riscv64
- arch_flags: -DLLVM_BUILD_32_BITS=ON -DLIBXML2_LIBRARIES=IGNORE -DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_HOST_TRIPLE=i686-unknown-linux-gnu
arch: x86
- os: ubuntu-22.04
os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON
- os: ubuntu-24.04
os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON

# os: [ubuntu-22.04]
# build_type: [RelAssert]
# arch : [x86, x86_64, aarch64, riscv64]
# exclude:
# arch : [x86_64]
# # exclude:
# Reduce the versions of llvm for aarch64, riscv64 & x86 architectures and windows, as
# well as any windows os variants
# - os: windows-2019
Expand All @@ -50,48 +93,6 @@ jobs:
# - build_type_flags:
# - build_type_flags: -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON
# build_type: RelAssert
# - arch_flags: -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/ock/platform/arm-linux/aarch64-toolchain.cmake"
# -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-gnu
# arch: aarch64
# - arch_flags: -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/ock/platform/riscv64-linux/riscv64-gcc-toolchain.cmake"
# -DLLVM_HOST_TRIPLE=riscv64-unknown-linux-gnu
# arch: riscv64
# - arch_flags: -DLLVM_BUILD_32_BITS=ON -DLIBXML2_LIBRARIES=IGNORE -DLLVM_ENABLE_TERMINFO=OFF
# -DLLVM_HOST_TRIPLE=i686-unknown-linux-gnu
# arch: x86
# - os: ubuntu-22.04
# os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON
# - os: ubuntu-24.04
# os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON
os: [ubuntu-22.04]
build_type: [RelAssert]
arch : [x86_64]
# exclude:
# Reduce the versions of llvm for aarch64, riscv64 & x86 architectures and windows, as
# well as any windows os variants
# - os: windows-2019
# arch: aarch64
# - os: windows-2019
# arch: riscv64
# - os: windows-2019
# arch: x86

# - os: ubuntu-22.04
# arch: riscv64
# - os: ubuntu-24.04
# arch: aarch64
# - os: ubuntu-24.04
# arch: x86
include:
# We want to set flags related to particular matrix dimensions. To do this
# we need to create default values first, and then against particular matrix
# dimensions.
# Note that we need to use RelAssert as the cache key matching can match Release against ReleaseAssert
- os_flags:
- arch_flags:
- build_type_flags:
- build_type_flags: -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON
build_type: RelAssert
# - arch_flags: -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/ock/platform/arm-linux/aarch64-toolchain.cmake"
# -DLLVM_HOST_TRIPLE=aarch64-unknown-linux-gnu
# arch: aarch64
Expand All @@ -101,8 +102,8 @@ jobs:
# - arch_flags: -DLLVM_BUILD_32_BITS=ON -DLIBXML2_LIBRARIES=IGNORE -DLLVM_ENABLE_TERMINFO=OFF
# -DLLVM_HOST_TRIPLE=i686-unknown-linux-gnu
# arch: x86
- os: ubuntu-22.04
os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON
# - os: ubuntu-22.04
# os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON
# - os: ubuntu-24.04
# os_flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON
runs-on: ${{ matrix.os }}
Expand All @@ -125,7 +126,7 @@ jobs:
uses: llvm/actions/install-ninja@main

- name: Setup ccache
if: matrix.arch == 'x86_64'
# if: matrix.arch == 'x86_64'
uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16
with:
max-size: 200M
Expand Down
66 changes: 47 additions & 19 deletions .github/workflows/create_llvm_artefacts_caller.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Temporary for testing - move to planned_testing_caller.yml
name: Run ock tests for PR style testing
name: Try out llvm artefacts
on:
pull_request:
paths:
Expand All @@ -16,9 +16,13 @@ concurrency:
jobs:
build_llvm_artefacts:
name: Call PR testing on schedule
if: ${{ (github.event_name == 'schedule' && github.repository == 'uxlfoundation/oneapi-construction-kit') || github.event_name == 'pull_request' }}
permissions:
actions: write
# change to false and change llvm_source below to download from a previous day.
if: false
# ${{ (github.event_name == 'schedule' && github.repository == 'uxlfoundation/oneapi-construction-kit') || github.event_name == 'pull_request' }}
# permissions:
# actions: write


uses: ./.github/workflows/create_llvm_artefacts.yml
secrets: inherit
with:
Expand All @@ -27,18 +31,42 @@ jobs:

use_llvm_artefacts:
needs: [build_llvm_artefacts]
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: set up gh
uses: ./.github/actions/setup_gh
with:
os: ${{ contains( matrix.target, 'windows') && 'windows' || 'ubuntu' }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Try downloading llvm install
run: |
echo workflow id is ${{needs.build_llvm_artefacts.outputs.workflow_id}}
# TODO: We need to add tarring there and here
gh run download ${{github.run_id}} -n llvm-ubuntu-22.04-x86_64-19-RelAssert -D llvm_install
ls -l llvm_install/bin
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout repo
# uses: actions/checkout@v4
# - name: set up gh
# uses: ./.github/actions/setup_gh
# with:
# os: ${{ contains( matrix.target, 'windows') && 'windows' || 'ubuntu' }}
# token: ${{ secrets.GITHUB_TOKEN }}
# - name: Try downloading llvm install
# uses: actions/download-artifact@v4
# with:
# name: llvm-ubuntu-22.04-x86_64-19-RelAssert
# run-id: 13593517156
# github-token: ${{ secrets.GITHUB_TOKEN }}
# - name: Try downloading llvm install
# uses: ./.github/actions/test_llvm_download
# with:
# # name: llvm-ubuntu-22.04-x86_64-19-RelAssert

# # run-id: 13593517156
# token: ${{ secrets.GITHUB_TOKEN }}
name: run some form of planned testing
uses: ./.github/workflows/planned_testing.yml
with:
target_list: '[ "host_x86_64_linux",
"host_aarch64_linux",
"host_riscv64_linux",
"host_i686_linux",
"host_refsi_linux",
"host_x86_64_windows" ]'
ock: true
test_tornado: false
test_sycl_cts: false
test_opencl_cts: false
# Override this value if we wish to use a previous llvm source
llvm_source: 13703980099
# ${{ github.run_id }}
#13593517156
6 changes: 6 additions & 0 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ on:
required: false
type: string
default: ''
llvm_source:
required: false
type: string
default: 'cache'

permissions:
packages: read
Expand Down Expand Up @@ -135,6 +139,7 @@ jobs:
|| 'ghcr.io/uxlfoundation/ock_ubuntu_22.04-x86-64:latest' ) }}
volumes:
- ${{github.workspace}}:${{github.workspace}}
# runs-on: ubuntu-22.04
if: inputs.ock && contains(inputs.target_list, 'linux')
steps:
- name: Checkout repo
Expand All @@ -150,6 +155,7 @@ jobs:
target: ${{ matrix.target }}
llvm_version: ${{ inputs.llvm_version }}
download_ock_artefact: ${{ inputs.download_ock_artefact }}
llvm_source: ${{ inputs.llvm_source }}

build_icd:
if: inputs.test_tornado || inputs.test_opencl_cts || inputs.test_sycl_cts
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/planned_testing_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
name: Run planned testing
on:
# Note: use pull_request: for localized testing only
pull_request:
paths:
- '.github/workflows/planned_testing.yml'
- '.github/workflows/planned_testing_caller.yml'
# pull_request:
# paths:
# - '.github/workflows/planned_testing.yml'
# - '.github/workflows/planned_testing_caller.yml'
# branches:
# - main
schedule:
Expand All @@ -20,7 +20,8 @@ jobs:
call_planned:
# This makes the diagram too big if we post much here so S_ for scheduled.
name: S_
if: github.repository == 'uxlfoundation/oneapi-construction-kit' || github.event_name != 'schedule'
if: false
# github.repository == 'uxlfoundation/oneapi-construction-kit' || github.event_name != 'schedule'
uses: ./.github/workflows/planned_testing.yml
with:
target_list: '[ "host_x86_64_linux",
Expand Down
29 changes: 15 additions & 14 deletions .github/workflows/run_pr_tests_caller.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Calling workflow for running PR style tests
name: Run ock tests for PR style testing
on:
pull_request:
paths:
- 'source/**'
- 'clik/**'
- 'modules/**'
- 'examples/**'
- 'cmake/**'
- 'hal/**'
- '.github/actions/do_build_ock/**'
- '.github/actions/setup_build/**'
- '.github/workflows/run_pr_tests.yml'
- '.github/workflows/run_pr_tests_caller.yml'
- 'CMakeLists.txt'
# pull_request:
# paths:
# - 'source/**'
# - 'clik/**'
# - 'modules/**'
# - 'examples/**'
# - 'cmake/**'
# - 'hal/**'
# - '.github/actions/do_build_ock/**'
# - '.github/actions/setup_build/**'
# - '.github/workflows/run_pr_tests.yml'
# - '.github/workflows/run_pr_tests_caller.yml'
# - 'CMakeLists.txt'
schedule:
# Run Mon-Fri at 7pm
- cron: '00 19 * * 1-5'
Expand All @@ -25,7 +25,8 @@ concurrency:
jobs:
run-prs:
name: Call PR testing on schedule
if: ${{ (github.event_name == 'schedule' && github.repository == 'uxlfoundation/oneapi-construction-kit') || github.event_name == 'pull_request' }}
if: ${{ (github.event_name == 'schedule' && github.repository == 'uxlfoundation/oneapi-construction-kit') }}
#|| github.event_name == 'pull_request' }}
uses: ./.github/workflows/run_pr_tests.yml
with:
is_pull_request: ${{ github.event_name != 'schedule' }}
Expand Down

0 comments on commit 5da97e9

Please sign in to comment.