Skip to content

Commit 8dd135f

Browse files
authored
Merge pull request #1329 from rbanka1/dockersUMF
Update CI to use Docker
2 parents 862a4fd + ae4add5 commit 8dd135f

File tree

4 files changed

+123
-71
lines changed

4 files changed

+123
-71
lines changed

.github/scripts/install_oneAPI.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Copyright (C) 2025 Intel Corporation
3+
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
# install_oneAPI.sh - Script for installing Intel oneAPI from the official repository
7+
8+
apt-get update
9+
apt-get install -y gpg-agent gnupg
10+
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg
11+
echo 'deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main' > /etc/apt/sources.list.d/oneAPI.list
12+
apt-get update
13+
apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp

.github/workflows/pr_push.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ concurrency:
1414

1515
permissions:
1616
contents: read
17+
packages: read
1718

1819
jobs:
1920
CodeChecks:

.github/workflows/reusable_basic.yml

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: workflow_call
55

66
permissions:
77
contents: read
8+
packages: read
89

910
env:
1011
BUILD_DIR : "${{github.workspace}}/build"
@@ -14,6 +15,12 @@ env:
1415

1516
jobs:
1617
ubuntu-build:
18+
runs-on: ubuntu-latest
19+
container:
20+
image: ghcr.io/bb-ur/umf-${{ matrix.os }}:latest
21+
options: --user test_user --cap-add=SYS_NICE --cap-add=SYS_PTRACE
22+
volumes:
23+
- ${{ github.workspace }}:${{ github.workspace }}
1724
strategy:
1825
matrix:
1926
os: ['ubuntu-22.04', 'ubuntu-24.04']
@@ -27,7 +34,7 @@ jobs:
2734
link_hwloc_statically: ['OFF']
2835
cmake_ver: ['default']
2936
include:
30-
- os: 'ubuntu-22.04'
37+
- os: ubuntu-22.04
3138
build_type: Release
3239
compiler: {c: clang, cxx: clang++}
3340
shared_library: 'OFF'
@@ -38,7 +45,7 @@ jobs:
3845
link_hwloc_statically: 'OFF'
3946
# check minimum supported cmake version
4047
cmake_ver: '3.14.0'
41-
- os: 'ubuntu-22.04'
48+
- os: ubuntu-22.04
4249
build_type: Release
4350
compiler: {c: gcc, cxx: g++}
4451
shared_library: 'ON'
@@ -48,7 +55,7 @@ jobs:
4855
disable_hwloc: 'OFF'
4956
link_hwloc_statically: 'OFF'
5057
cmake_ver: '3.28.0'
51-
- os: 'ubuntu-24.04'
58+
- os: ubuntu-24.04
5259
build_type: Debug
5360
compiler: {c: gcc, cxx: g++}
5461
shared_library: 'ON'
@@ -59,7 +66,7 @@ jobs:
5966
link_hwloc_statically: 'OFF'
6067
cmake_ver: 'default'
6168
# test level_zero_provider='OFF' and cuda_provider='OFF'
62-
- os: 'ubuntu-22.04'
69+
- os: ubuntu-22.04
6370
build_type: Release
6471
compiler: {c: gcc, cxx: g++}
6572
shared_library: 'OFF'
@@ -70,7 +77,7 @@ jobs:
7077
link_hwloc_statically: 'OFF'
7178
cmake_ver: 'default'
7279
# test icx compiler
73-
- os: 'ubuntu-22.04'
80+
- os: ubuntu-22.04
7481
build_type: Release
7582
compiler: {c: icx, cxx: icpx}
7683
shared_library: 'ON'
@@ -81,7 +88,7 @@ jobs:
8188
link_hwloc_statically: 'OFF'
8289
cmake_ver: 'default'
8390
# test lld linker
84-
- os: 'ubuntu-24.04'
91+
- os: ubuntu-24.04
8592
build_type: Release
8693
compiler: {c: icx, cxx: icpx}
8794
shared_library: 'ON'
@@ -92,8 +99,8 @@ jobs:
9299
link_hwloc_statically: 'OFF'
93100
llvm_linker: '-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld"'
94101
cmake_ver: 'default'
95-
# test without installing TBB
96-
- os: 'ubuntu-22.04'
102+
# test without installing TBB
103+
- os: ubuntu-22.04
97104
build_type: Release
98105
compiler: {c: gcc, cxx: g++}
99106
shared_library: 'ON'
@@ -103,7 +110,7 @@ jobs:
103110
disable_hwloc: 'OFF'
104111
link_hwloc_statically: 'OFF'
105112
cmake_ver: 'default'
106-
- os: 'ubuntu-22.04'
113+
- os: ubuntu-22.04
107114
build_type: Debug
108115
compiler: {c: gcc, cxx: g++}
109116
shared_library: 'ON'
@@ -113,7 +120,7 @@ jobs:
113120
disable_hwloc: 'ON'
114121
link_hwloc_statically: 'OFF'
115122
cmake_ver: 'default'
116-
- os: 'ubuntu-22.04'
123+
- os: ubuntu-22.04
117124
build_type: Release
118125
compiler: {c: gcc, cxx: g++}
119126
shared_library: 'ON'
@@ -124,52 +131,41 @@ jobs:
124131
link_hwloc_statically: 'ON'
125132
cmake_ver: 'default'
126133
name: Basic (${{matrix.os}}, build_type=${{matrix.build_type}}, compilers=${{matrix.compiler.c}}/${{matrix.compiler.cxx}}, shared_library=${{matrix.shared_library}}, level_zero_provider=${{matrix.level_zero_provider}}, cuda_provider=${{matrix.cuda_provider}}, install_tbb=${{matrix.install_tbb}}, disable_hwloc=${{matrix.disable_hwloc}}, link_hwloc_statically=${{matrix.link_hwloc_statically}}, cmake_ver=${{matrix.cmake_ver}})
127-
runs-on: ${{matrix.os}}
128134

129135
steps:
130136
- name: Checkout
131137
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
132138
with:
133139
fetch-depth: 0
134140

135-
- name: Install apt packages
136-
run: |
137-
sudo apt-get update
138-
sudo apt-get install -y clang libnuma-dev lcov
139-
140141
- name: Install cmake (non-default version)
141142
if: matrix.cmake_ver != 'default'
142143
run: |
143-
sudo apt-get remove --purge -y cmake
144+
echo ${USERPASS} | sudo -Sk apt-get remove --purge -y cmake
144145
wget https://github.com/Kitware/CMake/releases/download/v${{matrix.cmake_ver}}/cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh
145146
chmod +x cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh
146-
sudo ./cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh --skip-license --prefix=/usr/local
147+
echo ${USERPASS} | sudo -Sk ./cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh --skip-license --prefix=/usr/local
147148
148-
- name: Install hwloc
149-
if: matrix.disable_hwloc == 'OFF'
149+
- name: Uninstall hwloc
150+
if: matrix.disable_hwloc == 'ON'
150151
run: |
151-
sudo apt-get install -y libhwloc-dev
152+
echo ${USERPASS} | sudo -Sk apt-get remove --purge -y '*hwloc*'
153+
echo ${USERPASS} | sudo -Sk apt-get autoremove -y
152154
153-
- name: Install TBB apt package
154-
if: matrix.install_tbb == 'ON'
155+
- name: Uninstall TBB apt package
156+
if: matrix.install_tbb == 'OFF'
155157
run: |
156-
sudo apt-get install -y libtbb-dev
158+
echo ${USERPASS} | sudo -Sk apt-get remove --purge -y '*tbb*'
159+
echo ${USERPASS} | sudo -Sk apt-get autoremove -y
157160
158161
- name: Install oneAPI basekit
159162
if: matrix.compiler.cxx == 'icpx'
160163
run: |
161-
sudo apt-get install -y gpg-agent wget
162-
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
163-
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
164-
sudo apt-get update
165-
sudo apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp
166-
167-
- name: Install g++-7
168-
if: matrix.compiler.cxx == 'g++-7'
169-
run: sudo apt-get install -y ${{matrix.compiler.cxx}}
164+
echo "${USERPASS}" | sudo -Sk ./.github/scripts/install_oneAPI.sh
170165
171166
- name: Get UMF version
172167
run: |
168+
git config --global --add safe.directory $GITHUB_WORKSPACE
173169
VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+')
174170
echo "UMF_VERSION=$VERSION" >> $GITHUB_ENV
175171

.github/workflows/reusable_fast.yml

Lines changed: 80 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,106 @@
1-
# Fast builds
1+
# Fast build linux part is working in dockers, Windows is not
22
name: FastBuild
33

44
on: workflow_call
55

66
permissions:
77
contents: read
8+
packages: read
89

910
env:
1011
BUILD_DIR : "${{github.workspace}}/build"
1112
INSTL_DIR : "${{github.workspace}}/install-dir"
1213

1314
jobs:
14-
FastBuild:
15-
env:
16-
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
15+
ubuntu-build:
16+
runs-on: ubuntu-latest
17+
container:
18+
image: ghcr.io/bb-ur/umf-${{ matrix.os }}:latest
19+
options: --user test_user --cap-add=SYS_NICE --cap-add=SYS_PTRACE
20+
volumes:
21+
- ${{ github.workspace }}:${{ github.workspace }}
1722
strategy:
1823
matrix:
1924
include:
20-
- os: windows-latest
25+
- os: ubuntu-24.04
2126
build_tests: 'ON'
27+
extra_build_options: ' -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON'
2228
simple_cmake: 'OFF'
23-
# pure C build (Windows)
24-
- os: windows-latest
29+
# pure C build
30+
- os: ubuntu-24.04
2531
# Tests' building is off for a pure C build
2632
build_tests: 'OFF'
33+
extra_build_options: '-DUMF_BUILD_BENCHMARKS=ON'
2734
simple_cmake: 'OFF'
28-
- os: ubuntu-latest
35+
# simplest CMake on Ubuntu 22.04, 24.04
36+
- os: ubuntu-24.04
2937
build_tests: 'ON'
30-
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
31-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON'
32-
simple_cmake: 'OFF'
33-
# pure C build (Linux)
34-
- os: ubuntu-latest
35-
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
36-
# Tests' building is off for a pure C build
37-
build_tests: 'OFF'
38-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON'
39-
simple_cmake: 'OFF'
40-
# simplest CMake on ubuntu-latest
41-
- os: ubuntu-latest
42-
build_tests: 'ON'
43-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release'
4438
simple_cmake: 'ON'
45-
# simplest CMake ubuntu-22.04
4639
- os: ubuntu-22.04
4740
build_tests: 'ON'
48-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release'
4941
simple_cmake: 'ON'
50-
name: Fast builds (${{matrix.os}}, build_tests=${{matrix.build_tests}}, simple_cmake=${{matrix.simple_cmake}}, extra_build_options=${{matrix.extra_build_options}})
51-
runs-on: ${{ (matrix.os == 'ubuntu-latest' && github.repository_owner == 'oneapi-src') && 'intel-ubuntu-22.04' || matrix.os }}
42+
name: Fast (${{matrix.os}}, build_tests=${{matrix.build_tests}}, simple_cmake=${{matrix.simple_cmake}}, extra_build_options=${{matrix.extra_build_options}})
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
fetch-depth: 0
49+
50+
- name: Configure CMake
51+
if: matrix.simple_cmake == 'OFF'
52+
run: >
53+
cmake
54+
-B ${{env.BUILD_DIR}}
55+
-DCMAKE_BUILD_TYPE=Release
56+
-DUMF_FORMAT_CODE_STYLE=OFF
57+
-DUMF_DEVELOPER_MODE=ON
58+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
59+
-DUMF_BUILD_TESTS=${{matrix.build_tests}}
60+
-DUMF_BUILD_EXAMPLES=ON
61+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
62+
-DUMF_BUILD_CUDA_PROVIDER=ON
63+
-DUMF_TESTS_FAIL_ON_SKIP=ON
64+
-DUMF_BUILD_SHARED_LIBRARY=ON
65+
${{matrix.extra_build_options}}
66+
67+
- name: Configure CMake (simple)
68+
if: matrix.simple_cmake == 'ON'
69+
run: >
70+
cmake
71+
-B ${{env.BUILD_DIR}}
72+
-DCMAKE_BUILD_TYPE=Release
73+
-DUMF_BUILD_SHARED_LIBRARY=ON
74+
-DUMF_TESTS_FAIL_ON_SKIP=ON
75+
${{matrix.extra_build_options}}
76+
77+
- name: Build
78+
run: cmake --build ${{env.BUILD_DIR}} --config Release -j $(nproc)
79+
80+
- name: Run examples
81+
working-directory: ${{env.BUILD_DIR}}
82+
run: ctest --output-on-failure --test-dir examples -C Release
83+
84+
- name: Run tests
85+
if: matrix.build_tests == 'ON'
86+
working-directory: ${{env.BUILD_DIR}}
87+
run: ctest --output-on-failure --test-dir test -C Release
88+
89+
# TODO: use dockers
90+
windows-build:
91+
runs-on: windows-latest
92+
env:
93+
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
94+
strategy:
95+
matrix:
96+
include:
97+
- build_tests: 'ON'
98+
simple_cmake: 'OFF'
99+
- build_tests: 'OFF'
100+
simple_cmake: 'OFF'
101+
- build_tests: 'OFF'
102+
simple_cmake: 'ON'
103+
name: Fast (windows-latest, build_tests=${{matrix.build_tests}}, simple_cmake=${{matrix.simple_cmake}})
52104

53105
steps:
54106
- name: Checkout repository
@@ -57,24 +109,16 @@ jobs:
57109
fetch-depth: 0
58110

59111
- name: Initialize vcpkg
60-
if: matrix.os == 'windows-latest'
61112
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
62113
with:
63114
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
64115
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
65116
vcpkgJsonGlob: '**/vcpkg.json'
66117

67-
- name: Install dependencies (windows-latest)
68-
if: matrix.os == 'windows-latest'
118+
- name: Install dependencies
69119
run: vcpkg install --triplet x64-windows
70120
shell: pwsh # Specifies PowerShell as the shell for running the script.
71121

72-
- name: Install dependencies
73-
if: matrix.os != 'windows-latest'
74-
run: |
75-
sudo apt-get update
76-
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libtbb-dev
77-
78122
- name: Configure CMake
79123
if: matrix.simple_cmake == 'OFF'
80124
run: >
@@ -91,17 +135,16 @@ jobs:
91135
-DUMF_BUILD_CUDA_PROVIDER=ON
92136
-DUMF_TESTS_FAIL_ON_SKIP=ON
93137
-DUMF_BUILD_SHARED_LIBRARY=ON
94-
${{matrix.extra_build_options}}
95138
96139
- name: Configure CMake (simple)
97140
if: matrix.simple_cmake == 'ON'
98141
run: >
99142
cmake
100143
-B ${{env.BUILD_DIR}}
101144
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
145+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
102146
-DUMF_BUILD_SHARED_LIBRARY=ON
103147
-DUMF_TESTS_FAIL_ON_SKIP=ON
104-
${{matrix.extra_build_options}}
105148
106149
- name: Build
107150
run: cmake --build ${{env.BUILD_DIR}} --config Release -j
@@ -118,7 +161,6 @@ jobs:
118161
# TODO: We could add some script to verify metadata of dll's (selected fields, perhaps)
119162
# ref. https://superuser.com/questions/381276/what-are-some-nice-command-line-ways-to-inspect-dll-exe-details
120163
- name: Print metadata of our dll's
121-
if: matrix.os == 'windows-latest'
122164
run: |
123165
get-command ${{github.workspace}}/build/bin/Release/umf.dll | format-list
124166
get-command ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll | format-list

0 commit comments

Comments
 (0)