Skip to content

Commit 5705c2a

Browse files
committed
Update CI for dockers
I added a new Docker image for Ubuntu 24.04 and updated the others. I also created two new workflows that check for changes in the Docker files. If any changes are detected, the relevant Docker image will be rebuilt and pushed (unless it's a pull request). The rebuilt images will be available after the merge.
1 parent c66beee commit 5705c2a

10 files changed

+310
-94
lines changed
Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

55
#
66
# Dockerfile - a 'recipe' for Docker to build an image of ubuntu-based
7-
# environment for building the Unified Memory Framework project.
7+
# environment for building the Unified Memory Framework project.
88
#
99

1010
# Pull base image ("20.04")
@@ -22,43 +22,50 @@ ARG BASE_DEPS="\
2222
cmake \
2323
git"
2424

25-
# UMF's dependencies
26-
ARG UMF_DEPS="\
27-
libhwloc-dev \
28-
libtbb-dev"
25+
# Hwloc installation dependencies
26+
ARG HWLOC_DEPS="\
27+
libtool"
2928

3029
# Dependencies for tests (optional)
3130
ARG TEST_DEPS="\
32-
libnuma-dev"
31+
libnuma-dev \
32+
libtbb-dev \
33+
valgrind"
3334

3435
# Miscellaneous for our builds/CI (optional)
3536
ARG MISC_DEPS="\
3637
automake \
3738
clang \
3839
g++-7 \
40+
lcov \
3941
python3-pip \
4042
sudo \
4143
whois"
4244

45+
# libhwloc-dev is required - installed via script because hwloc version is too old on this OS
46+
COPY .github/scripts/install_hwloc.sh /opt/umf/install_hwloc.sh
47+
4348
# Update and install required packages
4449
RUN apt-get update \
4550
&& apt-get install -y --no-install-recommends \
4651
${BASE_DEPS} \
47-
${UMF_DEPS} \
4852
${TEST_DEPS} \
4953
${MISC_DEPS} \
54+
${HWLOC_DEPS} \
55+
&& /opt/umf/install_hwloc.sh \
5056
&& rm -rf /var/lib/apt/lists/* \
5157
&& apt-get clean all
5258

5359
# Prepare a dir (accessible by anyone)
54-
RUN mkdir --mode 777 /opt/umf/
60+
RUN mkdir -p --mode 777 /opt/umf/
5561

5662
# Additional dependencies (installed via pip)
63+
# It's actively used and tested only on selected distros. Be aware
64+
# they may not work, because pip packages list differ from OS to OS.
5765
COPY third_party/requirements.txt /opt/umf/requirements.txt
58-
RUN pip3 install --no-cache-dir -r /opt/umf/requirements.txt
5966

6067
# Add a new (non-root) 'test_user'
6168
ENV USER test_user
6269
ENV USERPASS pass
63-
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
70+
RUN useradd -m -u 1001 "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
6471
USER test_user

.github/docker/ubuntu-22.04.Dockerfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
33
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44

@@ -17,24 +17,30 @@ ENV NOTTY 1
1717
ENV DEBIAN_FRONTEND noninteractive
1818

1919
# Base development packages
20+
# It seems that libtool is not directly needed
21+
# but it is still required when Building UMF
2022
ARG BASE_DEPS="\
2123
build-essential \
2224
cmake \
23-
git"
25+
git \
26+
libtool \
27+
wget"
2428

2529
# UMF's dependencies
2630
ARG UMF_DEPS="\
27-
libhwloc-dev \
28-
libtbb-dev"
31+
libhwloc-dev"
2932

3033
# Dependencies for tests (optional)
3134
ARG TEST_DEPS="\
32-
libnuma-dev"
35+
libnuma-dev \
36+
libtbb-dev \
37+
valgrind"
3338

3439
# Miscellaneous for our builds/CI (optional)
3540
ARG MISC_DEPS="\
3641
automake \
3742
clang \
43+
lcov \
3844
python3-pip \
3945
sudo \
4046
whois"
@@ -43,14 +49,14 @@ ARG MISC_DEPS="\
4349
RUN apt-get update \
4450
&& apt-get install -y --no-install-recommends \
4551
${BASE_DEPS} \
46-
${UMF_DEPS} \
4752
${TEST_DEPS} \
4853
${MISC_DEPS} \
54+
${UMF_DEPS} \
4955
&& rm -rf /var/lib/apt/lists/* \
5056
&& apt-get clean all
5157

5258
# Prepare a dir (accessible by anyone)
53-
RUN mkdir --mode 777 /opt/umf/
59+
RUN mkdir -p --mode 777 /opt/umf/
5460

5561
# Additional dependencies (installed via pip)
5662
COPY third_party/requirements.txt /opt/umf/requirements.txt
@@ -59,5 +65,5 @@ RUN pip3 install --no-cache-dir -r /opt/umf/requirements.txt
5965
# Add a new (non-root) 'test_user'
6066
ENV USER test_user
6167
ENV USERPASS pass
62-
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
68+
RUN useradd -m -u 1001 "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
6369
USER test_user
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright (C) 2025 Intel Corporation
2+
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
#
6+
# Dockerfile - a 'recipe' for Docker to build an image of ubuntu-based
7+
# environment for building the Unified Memory Framework project.
8+
#
9+
10+
# Pull base image ("24.04")
11+
FROM registry.hub.docker.com/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782
12+
13+
# Set environment variables
14+
ENV OS ubuntu
15+
ENV OS_VER 24.04
16+
ENV NOTTY 1
17+
ENV DEBIAN_FRONTEND noninteractive
18+
19+
# Base development packages
20+
ARG BASE_DEPS="\
21+
build-essential \
22+
cmake \
23+
git \
24+
wget"
25+
26+
# UMF's dependencies
27+
ARG UMF_DEPS="\
28+
libhwloc-dev"
29+
30+
# Dependencies for tests (optional)
31+
ARG TEST_DEPS="\
32+
libnuma-dev \
33+
libtbb-dev \
34+
valgrind"
35+
36+
# Miscellaneous for our builds/CI (optional)
37+
ARG MISC_DEPS="\
38+
automake \
39+
clang \
40+
lcov \
41+
python3-pip \
42+
sudo \
43+
whois"
44+
45+
# Update and install required packages
46+
RUN apt-get update \
47+
&& apt-get install -y --no-install-recommends \
48+
${BASE_DEPS} \
49+
${TEST_DEPS} \
50+
${MISC_DEPS} \
51+
${UMF_DEPS} \
52+
&& rm -rf /var/lib/apt/lists/* \
53+
&& apt-get clean all
54+
55+
# Prepare a dir (accessible by anyone)
56+
RUN mkdir -p --mode 777 /opt/umf/
57+
58+
# Additional dependencies (installed via pip)
59+
COPY third_party/requirements.txt /opt/umf/requirements.txt
60+
RUN pip3 install --no-cache-dir --break-system-packages -r /opt/umf/requirements.txt
61+
62+
# Add a new (non-root) 'test_user'
63+
ENV USER test_user
64+
ENV USERPASS pass
65+
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
66+
USER test_user

.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/detect_changes.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: DetectChanges
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/docker/*.Dockerfile'
7+
push:
8+
paths:
9+
- '.github/docker/*.Dockerfile'
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
DetectChanges:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Get changed files
26+
id: changed-files
27+
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c #v46.0.5
28+
29+
- name: List all changed files
30+
env:
31+
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
32+
run: |
33+
echo "Changed files: $ALL_CHANGED_FILES"
34+
35+
BuildDocker:
36+
needs: DetectChanges
37+
if: ${{ contains(join(needs.DetectChanges.outputs.changed_files, ' '), '.github/docker/') }}
38+
uses: ./.github/workflows/reusable_dockers_build.yml
39+
permissions:
40+
contents: read
41+
packages: write
42+
secrets: inherit

.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:

0 commit comments

Comments
 (0)