Skip to content

Commit

Permalink
Use llvm's ci-ubuntu-22.04 docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
coldav committed Jan 15, 2025
1 parent ad0d899 commit 6822181
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 64 deletions.
102 changes: 53 additions & 49 deletions .github/actions/setup_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,57 @@ runs:
# We don't want a new docker just a list of steps, so mark as composite
using: "composite"
steps:
- name: set llvm key
id: set_llvm_key
shell: bash
run: |
KEY_VERSION="${{ inputs.ubuntu_version }}"
if [ "${{ inputs.os }}" = "windows" ]; then
KEY_VERSION="${{ inputs.windows_version }}"
fi
echo "key_version=$KEY_VERSION" >> "$GITHUB_OUTPUT"
KEY_ARCH="x86_64"
KEY_NATIVE_ARCH="x86_64"
if [ "${{ runner.arch }}" = "ARM64" ]; then
KEY_ARCH="aarch64" ;
KEY_NATIVE_ARCH="aarch64"
fi
if [ "${{ inputs.cross_arch }}" != "none" ]; then
KEY_ARCH="${{ inputs.cross_arch }}"
fi
echo "key_arch=$KEY_ARCH" >> "$GITHUB_OUTPUT"
echo "key_native_arch=$KEY_NATIVE_ARCH" >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
- name: load llvm native
if: inputs.cross_arch != 'none'
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_native_arch }}-v${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
fail-on-cache-miss: true
enableCrossOsArchive: true
- shell: bash
if: inputs.cross_arch != 'none'
run: mv llvm_install llvm_install_native

- name: load llvm
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
enableCrossOsArchive: true

# 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@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
max-size: 200M
key: ccache-build
variant: ccache
save: ${{ inputs.save }}

- name: Install ubuntu prerequisites
if: ${{ inputs.os == 'ubuntu' }}
shell: bash
Expand All @@ -43,7 +94,8 @@ runs:
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
# required due to using non docker to build llvm
# If we switch to always using docker we can drop.
sudo apt-get install --yes lib32ncurses-dev
sudo apt-get install --yes lib32ncurses-dev
sudo apt-get install --yes wget
if [ "${{ inputs.cross_arch }}" = "x86" ]; then sudo dpkg --add-architecture i386 ; fi
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
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
Expand Down Expand Up @@ -92,51 +144,3 @@ runs:
- name: Install Ninja
uses: llvm/actions/install-ninja@a1ea791b03c8e61f53a0e66f2f73db283aa0f01e # main branch

- name: set llvm key
id: set_llvm_key
shell: bash
run: |
KEY_VERSION="${{ inputs.ubuntu_version }}"
if [ "${{ inputs.os }}" = "windows" ]; then
KEY_VERSION="${{ inputs.windows_version }}"
fi
echo "key_version=$KEY_VERSION" >> "$GITHUB_OUTPUT"
KEY_ARCH="x86_64"
KEY_NATIVE_ARCH="x86_64"
if [ "${{ runner.arch }}" = "ARM64" ]; then
KEY_ARCH="aarch64" ;
KEY_NATIVE_ARCH="aarch64"
fi
if [ "${{ inputs.cross_arch }}" != "none" ]; then
KEY_ARCH="${{ inputs.cross_arch }}"
fi
echo "key_arch=$KEY_ARCH" >> "$GITHUB_OUTPUT"
echo "key_native_arch=$KEY_NATIVE_ARCH" >> "$GITHUB_OUTPUT"
cat $GITHUB_OUTPUT
- name: load llvm native
if: inputs.cross_arch != 'none'
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_native_arch }}-v${{ inputs.llvm_version }}-${{ inputs.llvm_build_type }}
fail-on-cache-miss: true
- shell: bash
if: inputs.cross_arch != 'none'
run: mv llvm_install llvm_install_native

- name: load llvm
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

# 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@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
max-size: 200M
key: ccache-build
variant: ccache
save: ${{ inputs.save }}
13 changes: 8 additions & 5 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
# Currently this can be used to exclude all but certain targets in matrices
workflow_vars:
runs-on: ubuntu-22.04
if: flse
outputs:
matrix_only_linux_x86_64_aarch64: ${{ steps.vars.outputs.matrix_only_linux_x86_64_aarch64 }}
matrix_only_linux_x86_64: ${{ steps.vars.outputs.matrix_only_linux_x86_64 }}
Expand Down Expand Up @@ -71,18 +72,20 @@ jobs:
llvm_version: ${{ inputs.llvm_version }}

create_ock_artefacts_ubuntu:
needs: [workflow_vars]
# needs: [workflow_vars]
strategy:
fail-fast: false # let all matrix jobs complete
matrix:
target: ${{ fromJson(inputs.target_list) }}
exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}
# target: ${{ fromJson(inputs.target_list) }}
# exclude: ${{ fromJson(needs.workflow_vars.outputs.matrix_only_linux_x86_64_aarch64) }}
target: ['host_x86_64_ubuntu']

# risc-v needs ubuntu 24.04 so we get the latest qemu as well as how we
# build llvm. Otherwise we choose ubuntu-22.04 (use a container for both for consistency).
runs-on: cp-ubuntu-24.04
container:
image: ${{ contains(matrix.target, 'host_riscv') && 'ghcr.io/intel/llvm/ubuntu2404_base:latest' || 'ghcr.io/intel/llvm/ubuntu2204_base:latest' }}
# image: ${{ contains(matrix.target, 'host_riscv') && 'ubuntu:24.04' || 'ubuntu:22.04' }}
image: ubuntu:22.04
volumes:
- ${{github.workspace}}:${{github.workspace}}
if : inputs.ock && contains(inputs.target_list, 'linux')
Expand Down Expand Up @@ -159,7 +162,7 @@ jobs:
# TODO: host-x86_64-linux only - expand for other targets
runs-on: cp-ubuntu-24.04
container:
image: ${{ contains(matrix.target, 'host_riscv') && 'ghcr.io/intel/llvm/ubuntu2404_base:latest' || 'ghcr.io/intel/llvm/ubuntu2204_base:latest' }}
image: ${{ contains(matrix.target, 'host_riscv') && 'ubuntu-24.04' || 'ghcr.io/llvm/ci-ubuntu-22.04' }}
volumes:
- ${{github.workspace}}:${{github.workspace}}
steps:
Expand Down
17 changes: 9 additions & 8 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 @@ -23,11 +23,12 @@ jobs:
if: github.repository == 'uxlfoundation/oneapi-construction-kit' || github.event_name != 'schedule'
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" ]'
# target_list: '["host_x86_64_linux", "host_aarch64_linux", "host_riscv64_linux", "host_i686_linux", "host_refsi_linux", "host_x86_64_windows" ]'
target_list: '["host_x86_64_linux"]'
ock: true
test_tornado: true
test_sycl_cts: true
test_opencl_cts: true
test_tornado: false
test_sycl_cts: false
test_opencl_cts: false
# Have a pull request setting which can be used to test the flow as best as possible
# in a reasonable time
pull_request: ${{ github.event_name == 'pull_request' }}
4 changes: 2 additions & 2 deletions .github/workflows/run_pr_tests_caller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ on:
- 'cmake/**'
- 'hal/**'
- '.github/actions/do_build_ock/**'
- '.github/actions/setup_build/**'
# - '.github/actions/setup_build/**'
- '.github/workflows/run_pr_tests.yml'
- '.github/workflows/run_pr_tests_caller.yml'
# - '.github/workflows/run_pr_tests_caller.yml'
- 'CMakeLists.txt'
schedule:
# Run Mon-Fri at 7pm
Expand Down

0 comments on commit 6822181

Please sign in to comment.