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 16, 2025
1 parent ad0d899 commit 7cab849
Show file tree
Hide file tree
Showing 7 changed files with 497 additions and 454 deletions.
2 changes: 1 addition & 1 deletion .github/actions/do_build_ock/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ inputs:
default: OFF
gtest_launcher:
description: "Googletest suite launcher command (default launcher used for ubuntu)"
default: "/usr/bin/python;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"
default: "/usr/bin/python3;-u;${{ github.workspace }}/scripts/gtest-terse-runner.py"
build_32_bit:
description: "32-bit building"
default: OFF
Expand Down
16 changes: 16 additions & 0 deletions .github/actions/setup_base_docker/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: setup-base-docker
description: Installs additional things we may need if we use a simple ubuntu base docker

runs:
# We don't want a new docker just a list of steps, so mark as composite
using: "composite"
steps:
- name: install defaults
shell: bash
run: |
apt-get update && apt-get -y install sudo
sudo apt install -y zstd
sudo apt install -y gnupg
sudo apt install -y wget gcc g++ cmake ninja-build python3 git curl
sudo apt install -y python3-pip cmake
sudo apt install -y file
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 }}
20 changes: 13 additions & 7 deletions .github/workflows/planned_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ on:
type: boolean
default: false


permissions:
packages: read

jobs:

# Calculate some useful variables that can be used through the workflow
# Currently this can be used to exclude all but certain targets in matrices
workflow_vars:
runs-on: ubuntu-22.04
if: false
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 +76,19 @@ 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_linux']

# 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') && 'ghcr.io/uxlfoundation/ock_ubuntu_24.04:latest' || 'ghcr.io/uxlfoundation/ock_ubuntu_24.04:latest' }}
volumes:
- ${{github.workspace}}:${{github.workspace}}
if : inputs.ock && contains(inputs.target_list, 'linux')
Expand Down Expand Up @@ -159,7 +165,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') && 'ghcr.io/uxlfoundation/ock_ubuntu_24.04:latest' || 'ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest' }}
volumes:
- ${{github.workspace}}:${{github.workspace}}
steps:
Expand Down Expand Up @@ -194,7 +200,7 @@ jobs:
# TODO: Extend if we decide to enable for windows or build natively on another target
runs-on: cp-ubuntu-24.04
container:
image: ghcr.io/intel/llvm/ubuntu2204_base:latest
image: 'ghcr.io/uxlfoundation/ock_ubuntu_22.04:latest'
volumes:
- ${{github.workspace}}:${{github.workspace}}

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

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,7 +2,7 @@
name: Run planned testing
on:
# Note: use pull_request: for localized testing only
#pull_request:
# pull_request:
# paths:
# - '.github/workflows/planned_testing.yml'
# - '.github/workflows/planned_testing_caller.yml'
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' }}
Loading

0 comments on commit 7cab849

Please sign in to comment.