Skip to content

Docker workflow #1105

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
25 changes: 21 additions & 4 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 Down Expand Up @@ -50,12 +50,29 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean all

# Install hwloc
COPY .github/scripts/install_hwloc.sh /opt/umf/install_hwloc.sh
RUN apt-get update \
&& apt-get install -y dos2unix libtool \
&& dos2unix /opt/umf/install_hwloc.sh \
&& bash -x /opt/umf/install_hwloc.sh \
&& ldconfig \
&& rm -f /opt/umf/install_hwloc.sh

# Install valgrind
RUN apt-get update && \
apt-get install -y valgrind cmake hwloc libhwloc-dev libnuma-dev libtbb-dev

# Install lcov
RUN apt-get update && \
apt-get install lcov -y

# 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
RUN pip3 install --no-cache-dir -r /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
Expand Down
21 changes: 19 additions & 2 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 Down Expand Up @@ -49,8 +49,25 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean all

# Install hwloc
COPY .github/scripts/install_hwloc.sh /opt/umf/install_hwloc.sh
RUN apt-get update \
&& apt-get install -y dos2unix libtool \
&& dos2unix /opt/umf/install_hwloc.sh \
&& bash -x /opt/umf/install_hwloc.sh \
&& ldconfig \
&& rm -f /opt/umf/install_hwloc.sh

# Install valgrind
RUN apt-get update && \
apt-get install -y valgrind cmake hwloc libhwloc-dev libnuma-dev libtbb-dev

# Install lcov
RUN apt-get update && \
apt-get install lcov -y

# 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 Down
80 changes: 80 additions & 0 deletions .github/docker/ubuntu-24.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# 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"

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

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

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

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

# Install hwloc
COPY .github/scripts/install_hwloc.sh /opt/umf/install_hwloc.sh
RUN apt-get update \
&& apt-get install -y dos2unix libtool \
&& dos2unix /opt/umf/install_hwloc.sh \
&& bash -x /opt/umf/install_hwloc.sh \
&& ldconfig \
&& rm -f /opt/umf/install_hwloc.sh

# Install valgrind
RUN apt-get update && \
apt-get install -y valgrind clang cmake hwloc libhwloc-dev libnuma-dev libtbb-dev

# Install lcov
RUN apt-get update && \
apt-get install lcov -y

# 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
38 changes: 38 additions & 0 deletions .github/workflows/build_ci_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: BuildCIContainer
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps Build Dockers, plus a short description on top of the file

Copy link
Contributor

Choose a reason for hiding this comment

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

so also pls rename the file to build_dockers.yml


on:
workflow_call:
workflow_dispatch:

permissions:
packages: write
contents: read

jobs:
build-ci-container:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this job shall be limited to upstream only:

    if: github.repository == 'oneapi-src/unified-memory-framework'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure for that. As we were talking, I left it untouched

Copy link
Contributor

Choose a reason for hiding this comment

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

could you try and add that, pls? I think it should work just fine; at least we should test it.

Of course as long as you're testing you can omit adding it 😉

runs-on: ubuntu-latest
strategy:
matrix:
ubuntu-version: [20.04, 22.04, 24.04]
outputs:
status: ${{ job.status }}
env:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ env.GHCR_TOKEN }}

- name: Build and push ubuntu-${{ matrix.ubuntu-version }} Docker image
run: |
docker build -f .github/docker/ubuntu-${{ matrix.ubuntu-version }}.Dockerfile -t ghcr.io/${{ github.actor }}/umf2-ubuntu-${{ matrix.ubuntu-version }}:latest .
docker push ghcr.io/${{ github.actor }}/umf2-ubuntu-${{ matrix.ubuntu-version }}:latest
42 changes: 39 additions & 3 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,84 @@ concurrency:

permissions:
contents: read
packages: write

jobs:
CodeChecks:
uses: ./.github/workflows/reusable_checks.yml
DocsBuild:
uses: ./.github/workflows/reusable_docs_build.yml
PrintModifiedFiles:
runs-on: ubuntu-latest
outputs:
changed_files: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]

- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
BuildCIContainer:
if: ${{ contains(join(needs.PrintModifiedFiles.outputs.changed_files, ' '), '.github/docker/') }}
needs: [PrintModifiedFiles]
secrets: inherit
uses: ./.github/workflows/build_ci_container.yml
FastBuild:
name: Fast builds
needs: [CodeChecks, DocsBuild]
if: always() && (needs.BuildCIContainer.result == 'skipped' || needs.BuildCIContainer.result == 'success')
needs: [CodeChecks, DocsBuild, BuildCIContainer]
uses: ./.github/workflows/reusable_fast.yml
Build:
name: Basic builds
if: always() && (needs.FastBuild.result == 'success')
needs: [FastBuild]
uses: ./.github/workflows/reusable_basic.yml
DevDax:
if: always() && (needs.FastBuild.result == 'success')
needs: [FastBuild]
uses: ./.github/workflows/reusable_dax.yml
MultiNuma:
if: always() && (needs.FastBuild.result == 'success')
needs: [FastBuild]
uses: ./.github/workflows/reusable_multi_numa.yml
L0:
if: always() && (needs.Build.result == 'success')
needs: [Build]
uses: ./.github/workflows/reusable_gpu.yml
with:
name: "LEVEL_ZERO"
shared_lib: "['ON']"
CUDA:
if: always() && (needs.Build.result == 'success')
needs: [Build]
uses: ./.github/workflows/reusable_gpu.yml
with:
name: "CUDA"
shared_lib: "['ON']"
Sanitizers:
if: always() && (needs.FastBuild.result == 'success')
needs: [FastBuild]
uses: ./.github/workflows/reusable_sanitizers.yml
QEMU:
if: always() && (needs.FastBuild.result == 'success')
needs: [FastBuild]
uses: ./.github/workflows/reusable_qemu.yml
with:
short_run: true
ProxyLib:
if: always() && (needs.Build.result == 'success')
needs: [Build]
uses: ./.github/workflows/reusable_proxy_lib.yml
Valgrind:
if: always() && (needs.Build.result == 'success')
needs: [Build]
uses: ./.github/workflows/reusable_valgrind.yml
Coverage:
Expand All @@ -70,16 +104,18 @@ jobs:
trigger: "${{github.event_name}}"
Coverage_partial:
# partial coverage (on forks)
if: github.repository != 'oneapi-src/unified-memory-framework'
if: github.repository != 'oneapi-src/unified-memory-framework' && always() && (needs.Build.result == 'success')
needs: [Build, QEMU, ProxyLib]
uses: ./.github/workflows/reusable_coverage.yml
CodeQL:
if: always() && (needs.Build.result == 'success')
needs: [Build]
permissions:
contents: read
security-events: write
uses: ./.github/workflows/reusable_codeql.yml
Trivy:
if: always() && (needs.Build.result == 'success')
needs: [Build]
permissions:
contents: read
Expand Down
49 changes: 16 additions & 33 deletions .github/workflows/reusable_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on: workflow_call

permissions:
contents: read
packages: read

env:
BUILD_DIR : "${{github.workspace}}/build"
Expand Down Expand Up @@ -112,23 +113,17 @@ jobs:
disable_hwloc: 'OFF'
link_hwloc_statically: 'ON'
runs-on: ${{matrix.os}}

container:
image: ${{ matrix.os == 'ubuntu-20.04' && 'ghcr.io/rbanka1/umf2-ubuntu-20.04:latest' || matrix.os == 'ubuntu-22.04' && 'ghcr.io/rbanka1/umf2-ubuntu-22.04:latest' || matrix.os == 'ubuntu-24.04' && 'ghcr.io/rbanka1/umf2-ubuntu-24.04:latest'}}
options: --user root --privileged
volumes:
- /home/runner/work/unified-memory-framework/unified-memory-framework:/home/runner/work/unified-memory-framework/unified-memory-framework
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

Copy link
Contributor

Choose a reason for hiding this comment

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

still missing tbb removal for matrix.install_tbb == 'OFF'

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y clang cmake libnuma-dev lcov

- name: Install TBB apt package
if: matrix.install_tbb == 'ON'
run: |
sudo apt-get install -y libtbb-dev

- name: Install oneAPI basekit
if: matrix.compiler.cxx == 'icpx'
run: |
Expand All @@ -137,18 +132,6 @@ jobs:
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
sudo apt-get update
sudo apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp

- name: Install g++-7
if: matrix.compiler.cxx == 'g++-7'
run: sudo apt-get install -y ${{matrix.compiler.cxx}}

- name: Install libhwloc
run: .github/scripts/install_hwloc.sh

- name: Get UMF version
run: |
VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+')
echo "UMF_VERSION=$VERSION" >> $GITHUB_ENV

- name: Configure build
run: >
Expand Down Expand Up @@ -200,16 +183,16 @@ jobs:
- name: Remove the installation directory
run: rm -rf ${{env.INSTL_DIR}}

- name: Test UMF installation and uninstallation
# The '--shared-library' parameter is added to the installation test when the UMF is built as a shared library
run: >
python3 ${{github.workspace}}/test/test_installation.py
--build-dir ${{env.BUILD_DIR}}
--install-dir ${{env.INSTL_DIR}}
--build-type ${{matrix.build_type}}
${{ matrix.install_tbb == 'ON' && matrix.disable_hwloc != 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
--umf-version ${{env.UMF_VERSION}}
${{ matrix.shared_library == 'ON' && '--shared-library' || '' }}
# - name: Test UMF installation and uninstallation
Copy link
Contributor

Choose a reason for hiding this comment

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

later on, when you're done with all updates we can debug together, why this didn't work...

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

# # The '--shared-library' parameter is added to the installation test when the UMF is built as a shared library
# run: >
# python3 ${{github.workspace}}/test/test_installation.py
# --build-dir ${{env.BUILD_DIR}}
# --install-dir ${{env.INSTL_DIR}}
# --build-type ${{matrix.build_type}}
# ${{ matrix.install_tbb == 'ON' && matrix.disable_hwloc != 'ON' && matrix.shared_library == 'ON' && '--proxy' || '' }}
# --umf-version ${{env.UMF_VERSION}}
# ${{ matrix.shared_library == 'ON' && '--shared-library' || '' }}

windows-build:
name: Windows
Expand Down
Loading
Loading