Skip to content

Add dockers to Fast and Basic Builds #1298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions .github/docker/ubuntu-20.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#
# Dockerfile - a 'recipe' for Docker to build an image of ubuntu-based
# environment for building the Unified Memory Framework project.
# environment for building the Unified Memory Framework project.
#

# Pull base image ("20.04")
Expand All @@ -22,43 +22,50 @@ ARG BASE_DEPS="\
cmake \
git"

# UMF's dependencies
ARG UMF_DEPS="\
libhwloc-dev \
libtbb-dev"
# Hwloc installation dependencies
ARG HWLOC_DEPS="\
libtool"

# Dependencies for tests (optional)
ARG TEST_DEPS="\
libnuma-dev"
libnuma-dev \
libtbb-dev \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's requirement for OS memory provider, according to README.md

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the readme, it's for testing :)

While I agree with you that for runtime this is a requirement, it is not the hard requirement. As long as you don't use that provider it's not really required, hence we only mark this as "for testing" (or, in the user's case - for the application that uses the provider).

I'd personally leave libnuma as test deps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

valgrind"

# Miscellaneous for our builds/CI (optional)
ARG MISC_DEPS="\
automake \
clang \
g++-7 \
lcov \
python3-pip \
sudo \
whois"

# libhwloc-dev is required - installed via script because hwloc version is too old on this OS
COPY .github/scripts/install_hwloc.sh /opt/umf/install_hwloc.sh

# Update and install required packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
${BASE_DEPS} \
${UMF_DEPS} \
${TEST_DEPS} \
${MISC_DEPS} \
${HWLOC_DEPS} \
&& /opt/umf/install_hwloc.sh \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean all

# Prepare a dir (accessible by anyone)
RUN mkdir --mode 777 /opt/umf/
RUN mkdir -p --mode 777 /opt/umf/

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

# Add a new (non-root) 'test_user'
ENV USER test_user
ENV USERPASS pass
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
RUN useradd -m -u 1001 "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
USER test_user
22 changes: 14 additions & 8 deletions .github/docker/ubuntu-22.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2024 Intel Corporation
# Copyright (C) 2024-2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

Expand All @@ -17,24 +17,30 @@ ENV NOTTY 1
ENV DEBIAN_FRONTEND noninteractive

# Base development packages
# It seems that libtool is not directly needed
# but it is still required when Building UMF
ARG BASE_DEPS="\
build-essential \
cmake \
git"
git \
libtool \
wget"

# UMF's dependencies
ARG UMF_DEPS="\
libhwloc-dev \
libtbb-dev"
libhwloc-dev"

# Dependencies for tests (optional)
ARG TEST_DEPS="\
libnuma-dev"
libnuma-dev \
libtbb-dev \
valgrind"

# Miscellaneous for our builds/CI (optional)
ARG MISC_DEPS="\
automake \
clang \
lcov \
python3-pip \
sudo \
whois"
Expand All @@ -43,14 +49,14 @@ ARG MISC_DEPS="\
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
${BASE_DEPS} \
${UMF_DEPS} \
${TEST_DEPS} \
${MISC_DEPS} \
${UMF_DEPS} \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean all

# Prepare a dir (accessible by anyone)
RUN mkdir --mode 777 /opt/umf/
RUN mkdir -p --mode 777 /opt/umf/

# Additional dependencies (installed via pip)
COPY third_party/requirements.txt /opt/umf/requirements.txt
Expand All @@ -59,5 +65,5 @@ RUN pip3 install --no-cache-dir -r /opt/umf/requirements.txt
# Add a new (non-root) 'test_user'
ENV USER test_user
ENV USERPASS pass
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
RUN useradd -m -u 1001 "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
USER test_user
66 changes: 66 additions & 0 deletions .github/docker/ubuntu-24.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright (C) 2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#
# Dockerfile - a 'recipe' for Docker to build an image of ubuntu-based
# environment for building the Unified Memory Framework project.
#

# Pull base image ("24.04")
FROM registry.hub.docker.com/library/ubuntu@sha256:72297848456d5d37d1262630108ab308d3e9ec7ed1c3286a32fe09856619a782

# Set environment variables
ENV OS ubuntu
ENV OS_VER 24.04
ENV NOTTY 1
ENV DEBIAN_FRONTEND noninteractive

# Base development packages
ARG BASE_DEPS="\
build-essential \
cmake \
git \
wget"

# UMF's dependencies
ARG UMF_DEPS="\
libhwloc-dev"

# Dependencies for tests (optional)
ARG TEST_DEPS="\
libnuma-dev \
libtbb-dev \
valgrind"

# Miscellaneous for our builds/CI (optional)
ARG MISC_DEPS="\
automake \
clang \
lcov \
python3-pip \
sudo \
whois"

# Update and install required packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
${BASE_DEPS} \
${TEST_DEPS} \
${MISC_DEPS} \
${UMF_DEPS} \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean all

# Prepare a dir (accessible by anyone)
RUN mkdir -p --mode 777 /opt/umf/

# Additional dependencies (installed via pip)
COPY third_party/requirements.txt /opt/umf/requirements.txt
RUN pip3 install --no-cache-dir --break-system-packages -r /opt/umf/requirements.txt

# Add a new (non-root) 'test_user'
ENV USER test_user
ENV USERPASS pass
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
USER test_user
13 changes: 13 additions & 0 deletions .github/scripts/install_oneAPI.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Copyright (C) 2025 Intel Corporation
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# install_oneAPI.sh - Script for installing Intel oneAPI from the official repository

apt-get update
apt-get install -y gpg-agent gnupg
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
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
apt-get update
apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp
42 changes: 42 additions & 0 deletions .github/workflows/detect_changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: DetectChanges

on:
pull_request:
paths:
- '.github/docker/*.Dockerfile'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.github/scripts dir should be added as well

push:
paths:
- '.github/docker/*.Dockerfile'

permissions:
contents: read

jobs:
DetectChanges:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c #v46.0.5

- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Changed files: $ALL_CHANGED_FILES"

BuildDocker:
needs: DetectChanges
if: ${{ contains(join(needs.DetectChanges.outputs.changed_files, ' '), '.github/docker/') }}
uses: ./.github/workflows/reusable_dockers_build.yml
permissions:
contents: read
packages: write
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:

permissions:
contents: read
packages: read

jobs:
CodeChecks:
Expand Down
Loading
Loading