Skip to content

Commit 690a3fd

Browse files
author
Colin Davidson
committed
Switch to using docker built by OCK
We need to use a host of different machines, so for consistency we want to use a docker. This will also allow us to add more in it and do less installing of packages in the workflow.
1 parent ad0d899 commit 690a3fd

File tree

6 files changed

+118
-72
lines changed

6 files changed

+118
-72
lines changed

.github/actions/do_build_ock/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ inputs:
100100
default: OFF
101101
gtest_launcher:
102102
description: "Googletest suite launcher command (default launcher used for ubuntu)"
103-
default: "/usr/bin/python;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"
103+
default: "/usr/bin/python3;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"
104104
build_32_bit:
105105
description: "32-bit building"
106106
default: OFF

.github/actions/setup_build/action.yml

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,57 @@ runs:
3535
# We don't want a new docker just a list of steps, so mark as composite
3636
using: "composite"
3737
steps:
38+
- name: set llvm key
39+
id: set_llvm_key
40+
shell: bash
41+
run: |
42+
KEY_VERSION="${{ inputs.ubuntu_version }}"
43+
if [ "${{ inputs.os }}" = "windows" ]; then
44+
KEY_VERSION="${{ inputs.windows_version }}"
45+
fi
46+
echo "key_version=$KEY_VERSION" >> "$GITHUB_OUTPUT"
47+
KEY_ARCH="x86_64"
48+
KEY_NATIVE_ARCH="x86_64"
49+
if [ "${{ runner.arch }}" = "ARM64" ]; then
50+
KEY_ARCH="aarch64" ;
51+
KEY_NATIVE_ARCH="aarch64"
52+
fi
53+
if [ "${{ inputs.cross_arch }}" != "none" ]; then
54+
KEY_ARCH="${{ inputs.cross_arch }}"
55+
fi
56+
echo "key_arch=$KEY_ARCH" >> "$GITHUB_OUTPUT"
57+
echo "key_native_arch=$KEY_NATIVE_ARCH" >> "$GITHUB_OUTPUT"
58+
cat $GITHUB_OUTPUT
59+
60+
- name: load llvm native
61+
if: inputs.cross_arch != 'none'
62+
uses: actions/cache/restore@v4
63+
with:
64+
path: llvm_install/**
65+
key: llvm-${{ inputs.os }}-${{ steps.set_llvm_key.outputs.key_version }}-${{ steps.set_llvm_key.outputs.key_native_arch }}-v${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
66+
fail-on-cache-miss: true
67+
enableCrossOsArchive: true
68+
- shell: bash
69+
if: inputs.cross_arch != 'none'
70+
run: mv llvm_install llvm_install_native
71+
72+
- name: load llvm
73+
uses: actions/cache/restore@v4
74+
with:
75+
path: llvm_install/**
76+
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 }}
77+
fail-on-cache-miss: true
78+
enableCrossOsArchive: true
79+
80+
# note the PR testing usage should set 'save' to false, to avoid PR testing creating new caches on a branch
81+
- name: Setup ccache
82+
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
83+
with:
84+
max-size: 200M
85+
key: ccache-build
86+
variant: ccache
87+
save: ${{ inputs.save }}
88+
3889
- name: Install ubuntu prerequisites
3990
if: ${{ inputs.os == 'ubuntu' }}
4091
shell: bash
@@ -43,7 +94,8 @@ runs:
4394
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
4495
# required due to using non docker to build llvm
4596
# If we switch to always using docker we can drop.
46-
sudo apt-get install --yes lib32ncurses-dev
97+
sudo apt-get install --yes lib32ncurses-dev
98+
sudo apt-get install --yes wget
4799
if [ "${{ inputs.cross_arch }}" = "x86" ]; then sudo dpkg --add-architecture i386 ; fi
48100
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
49101
if [ "${{ inputs.ubuntu_version }}" = "20.04" ]; then sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.3.243-focal.list https://packages.lunarg.com/vulkan/1.3.243/lunarg-vulkan-1.3.243-focal.list; fi
@@ -92,51 +144,3 @@ runs:
92144
- name: Install Ninja
93145
uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main branch
94146

95-
- name: set llvm key
96-
id: set_llvm_key
97-
shell: bash
98-
run: |
99-
KEY_VERSION="${{ inputs.ubuntu_version }}"
100-
if [ "${{ inputs.os }}" = "windows" ]; then
101-
KEY_VERSION="${{ inputs.windows_version }}"
102-
fi
103-
echo "key_version=$KEY_VERSION" >> "$GITHUB_OUTPUT"
104-
KEY_ARCH="x86_64"
105-
KEY_NATIVE_ARCH="x86_64"
106-
if [ "${{ runner.arch }}" = "ARM64" ]; then
107-
KEY_ARCH="aarch64" ;
108-
KEY_NATIVE_ARCH="aarch64"
109-
fi
110-
if [ "${{ inputs.cross_arch }}" != "none" ]; then
111-
KEY_ARCH="${{ inputs.cross_arch }}"
112-
fi
113-
echo "key_arch=$KEY_ARCH" >> "$GITHUB_OUTPUT"
114-
echo "key_native_arch=$KEY_NATIVE_ARCH" >> "$GITHUB_OUTPUT"
115-
cat $GITHUB_OUTPUT
116-
117-
- name: load llvm native
118-
if: inputs.cross_arch != 'none'
119-
uses: actions/cache/restore@v4
120-
with:
121-
path: llvm_install/**
122-
key: llvm-${{ inputs.os }}-${{ steps.set_llvm_key.outputs.key_version }}-${{ steps.set_llvm_key.outputs.key_native_arch }}-v${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
123-
fail-on-cache-miss: true
124-
- shell: bash
125-
if: inputs.cross_arch != 'none'
126-
run: mv llvm_install llvm_install_native
127-
128-
- name: load llvm
129-
uses: actions/cache/restore@v4
130-
with:
131-
path: llvm_install/**
132-
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 }}
133-
fail-on-cache-miss: true
134-
135-
# note the PR testing usage should set 'save' to false, to avoid PR testing creating new caches on a branch
136-
- name: Setup ccache
137-
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
138-
with:
139-
max-size: 200M
140-
key: ccache-build
141-
variant: ccache
142-
save: ${{ inputs.save }}

.github/workflows/planned_testing.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,17 @@ on:
3131
type: boolean
3232
default: false
3333

34+
35+
permissions:
36+
packages: read
37+
3438
jobs:
3539

3640
# Calculate some useful variables that can be used through the workflow
3741
# Currently this can be used to exclude all but certain targets in matrices
3842
workflow_vars:
3943
runs-on: ubuntu-22.04
44+
if: false
4045
outputs:
4146
matrix_only_linux_x86_64_aarch64: ${{ steps.vars.outputs.matrix_only_linux_x86_64_aarch64 }}
4247
matrix_only_linux_x86_64: ${{ steps.vars.outputs.matrix_only_linux_x86_64 }}
@@ -71,18 +76,19 @@ jobs:
7176
llvm_version: ${{ inputs.llvm_version }}
7277

7378
create_ock_artefacts_ubuntu:
74-
needs: [workflow_vars]
79+
# needs: [workflow_vars]
7580
strategy:
7681
fail-fast: false # let all matrix jobs complete
7782
matrix:
78-
target: ${{ fromJson(inputs.target_list) }}
79-
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}
83+
# target: ${{ fromJson(inputs.target_list) }}
84+
# exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}
85+
target: ['host_x86_64_linux']
8086

8187
# risc-v needs ubuntu 24.04 so we get the latest qemu as well as how we
8288
# build llvm. Otherwise we choose ubuntu-22.04 (use a container for both for consistency).
8389
runs-on: cp-ubuntu-24.04
8490
container:
85-
image: ${{ contains(matrix.target, 'host_riscv') && 'ghcr.io/intel/llvm/ubuntu2404_base:latest' || 'ghcr.io/intel/llvm/ubuntu2204_base:latest' }}
91+
image: ${{ contains(matrix.target, 'host_riscv') && 'ghcr.io/uxlfoundation/ock_ubuntu_24.04:latest' || 'ghcr.io/uxlfoundation/ock_ubuntu_24.04:latest' }}
8692
volumes:
8793
- ${{github.workspace}}:${{github.workspace}}
8894
if : inputs.ock && contains(inputs.target_list, 'linux')
@@ -159,7 +165,7 @@ jobs:
159165
# TODO: host-x86_64-linux only - expand for other targets
160166
runs-on: cp-ubuntu-24.04
161167
container:
162-
image: ${{ contains(matrix.target, 'host_riscv') && 'ghcr.io/intel/llvm/ubuntu2404_base:latest' || 'ghcr.io/intel/llvm/ubuntu2204_base:latest' }}
168+
image: ${{ contains(matrix.target, 'host_riscv') && 'ghcr.io/uxlfoundation/ock_ubuntu_24.04:latest' || 'ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest' }}
163169
volumes:
164170
- ${{github.workspace}}:${{github.workspace}}
165171
steps:
@@ -194,7 +200,7 @@ jobs:
194200
# TODO: Extend if we decide to enable for windows or build natively on another target
195201
runs-on: cp-ubuntu-24.04
196202
container:
197-
image: ghcr.io/intel/llvm/ubuntu2204_base:latest
203+
image: 'ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest'
198204
volumes:
199205
- ${{github.workspace}}:${{github.workspace}}
200206

@@ -218,7 +224,7 @@ jobs:
218224
# TODO: Extend if we decide to enable for windows or build natively on another target
219225
runs-on: cp-ubuntu-24.04
220226
container:
221-
image: ghcr.io/intel/llvm/ubuntu2204_base:latest
227+
image: 'ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest'
222228
volumes:
223229
- ${{github.workspace}}:${{github.workspace}}
224230

.github/workflows/planned_testing_caller.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Run planned testing
33
on:
44
# Note: use pull_request: for localized testing only
5-
#pull_request:
5+
# pull_request:
66
# paths:
77
# - '.github/workflows/planned_testing.yml'
88
# - '.github/workflows/planned_testing_caller.yml'
@@ -23,11 +23,12 @@ jobs:
2323
if: github.repository == 'uxlfoundation/oneapi-construction-kit' || github.event_name != 'schedule'
2424
uses: ./.github/workflows/planned_testing.yml
2525
with:
26-
target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]'
26+
# target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]'
27+
target_list: '["host_x86_64_linux"]'
2728
ock: true
28-
test_tornado: true
29-
test_sycl_cts: true
30-
test_opencl_cts: true
29+
test_tornado: false
30+
test_sycl_cts: false
31+
test_opencl_cts: false
3132
# Have a pull request setting which can be used to test the flow as best as possible
3233
# in a reasonable time
3334
pull_request: ${{ github.event_name == 'pull_request' }}

.github/workflows/run_pr_tests.yml

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@ on:
2323
required: false
2424
type: bool
2525
default: true
26-
permissions: {}
26+
27+
permissions:
28+
packages: read
2729

2830
jobs:
2931

3032
# build and run host x86_64, execute UnitCL and lit tests and build and run offline
3133
run_host_x86_64:
3234
runs-on: ubuntu-22.04
33-
35+
container:
36+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
37+
volumes:
38+
- ${{github.workspace}}:${{github.workspace}}
3439
steps:
3540
- name: Checkout repo
3641
uses: actions/checkout@v4.1.0
@@ -75,7 +80,10 @@ jobs:
7580
run_riscv_m1:
7681

7782
runs-on: ubuntu-22.04
78-
83+
container:
84+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
85+
volumes:
86+
- ${{github.workspace}}:${{github.workspace}}
7987
steps:
8088
- name: Checkout repo
8189
uses: actions/checkout@v4.1.0
@@ -103,7 +111,10 @@ jobs:
103111
run_clang_tidy_changes:
104112

105113
runs-on: ubuntu-22.04
106-
114+
container:
115+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
116+
volumes:
117+
- ${{github.workspace}}:${{github.workspace}}
107118
steps:
108119
- name: Checkout repo
109120
uses: actions/checkout@v4.1.0
@@ -232,6 +243,10 @@ jobs:
232243
# Based on: mr-ubuntu-gcc-x86_64-riscv-fp16-cl3.0-unitcl_vecz
233244
run_ubuntu_gcc_x86_64_riscv_fp16_cl3_0_unitcl_vecz:
234245
runs-on: ubuntu-22.04
246+
container:
247+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
248+
volumes:
249+
- ${{github.workspace}}:${{github.workspace}}
235250
timeout-minutes: 60
236251
steps:
237252
- name: Checkout repo
@@ -261,6 +276,10 @@ jobs:
261276
# Based on: mr-ubuntu-clang-x86-llvm-previous-cl3-0-offline
262277
run-ubuntu-clang-x86-llvm-latest-cl3-0-offline:
263278
runs-on: ubuntu-22.04
279+
container:
280+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
281+
volumes:
282+
- ${{github.workspace}}:${{github.workspace}}
264283
timeout-minutes: 90 # offline needs longer timeout
265284
steps:
266285
- name: Checkout repo
@@ -300,6 +319,10 @@ jobs:
300319
# Based on: mr-ubuntu-gcc-x86_64-riscv-fp16-cl3-0
301320
run-ubuntu-gcc-x86_64-riscv-fp16-cl3-0:
302321
runs-on: ubuntu-22.04
322+
container:
323+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
324+
volumes:
325+
- ${{github.workspace}}:${{github.workspace}}
303326
timeout-minutes: 60
304327
steps:
305328
- name: Checkout repo
@@ -331,6 +354,10 @@ jobs:
331354
# Based on: mr-ubuntu-gcc-x86-llvm-latest-x86_64-images-cl3-0-release
332355
run-ubuntu-gcc-x86-llvm-latest-x86_64-images-cl3-0-release:
333356
runs-on: ubuntu-22.04
357+
container:
358+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
359+
volumes:
360+
- ${{github.workspace}}:${{github.workspace}}
334361
timeout-minutes: 60
335362
steps:
336363
- name: Checkout repo
@@ -356,7 +383,7 @@ jobs:
356383
run-ubuntu-gcc-aarch64-llvm-latest-cl3-0-fp16:
357384
runs-on: cp-ubuntu-24.04
358385
container:
359-
image: ghcr.io/intel/llvm/ubuntu2204_base:latest
386+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
360387
volumes:
361388
- ${{github.workspace}}:${{github.workspace}}
362389
timeout-minutes: 90 # aarch64 needs longer timeout
@@ -371,7 +398,7 @@ jobs:
371398
save: ${{ inputs.update_cache }}
372399
cross_arch: aarch64
373400
- run: echo WORKSPACE is $GITHUB_WORKSPACE && echo PWD is `pwd` && ls -al
374-
- name: build ock
401+
- name: build UnitCargo
375402
uses: ./.github/actions/do_build_ock
376403
with:
377404
build_targets: check-ock-cross
@@ -381,12 +408,16 @@ jobs:
381408
builtin_kernel: ON
382409
enable_api: ""
383410
toolchain_file: "scripts/../platform/arm-linux/aarch64-toolchain.cmake"
384-
extra_flags: -DCA_BUILTINS_TOOLS_DIR=${{ github.workspace }}/llvm_install_native/bin
411+
extra_flags: -DCA_BUILTINS_TOOLS_DIR=${{ github.workspace }}/llvm_install_native/bin
385412

386413
# Based on a combination of: mr-ubuntu-gcc-x86_64-clik
387414
# and: mr-ubuntu-gcc-x86_64-clik-refsi
388415
run-ubuntu-gcc-x86_64-clik-refsi:
389416
runs-on: ubuntu-22.04
417+
container:
418+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
419+
volumes:
420+
- ${{github.workspace}}:${{github.workspace}}
390421
timeout-minutes: 60
391422
steps:
392423
- name: Checkout repo
@@ -403,10 +434,14 @@ jobs:
403434
cmake -Bbuild_clik_refsi -GNinja -DCMAKE_INSTALL_PREFIX=install_refsi -DCLIK_HAL_NAME=refsi -DHAL_REFSI_SOC=M1 -DCLIK_EXTERNAL_HAL_DIR=${{ github.workspace }}/examples/refsi/hal_refsi clik
404435
LD_PRELOAD=/lib/x86_64-linux-gnu/libpthread.so.0 ninja -Cbuild_clik_refsi check
405436
406-
# Based on: mr-ubuntu-gcc-x86_64-refsi-g1-wi-cl3-0
437+
Based on: mr-ubuntu-gcc-x86_64-refsi-g1-wi-cl3-0
407438
run-ubuntu-gcc-x86_64-refsi-g1-wi-cl3-0:
408439
if: ${{ !inputs.is_pull_request }} # do not run as PR job for now to avoid flooding the concurrency
409440
runs-on: ubuntu-22.04
441+
container:
442+
image: ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest
443+
volumes:
444+
- ${{github.workspace}}:${{github.workspace}}
410445
timeout-minutes: 60
411446
steps:
412447
- name: Checkout repo

.github/workflows/run_pr_tests_caller.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ on:
1010
- 'cmake/**'
1111
- 'hal/**'
1212
- '.github/actions/do_build_ock/**'
13-
- '.github/actions/setup_build/**'
13+
# - '.github/actions/setup_build/**'
1414
- '.github/workflows/run_pr_tests.yml'
15-
- '.github/workflows/run_pr_tests_caller.yml'
15+
# - '.github/workflows/run_pr_tests_caller.yml'
1616
- 'CMakeLists.txt'
1717
schedule:
1818
# Run Mon-Fri at 7pm

0 commit comments

Comments
 (0)