Skip to content
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

Docker workflow #1105

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 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
34 changes: 22 additions & 12 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,14 +22,12 @@ ARG BASE_DEPS="\
cmake \
git"

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

# Dependencies for tests (optional)
ARG TEST_DEPS="\
libnuma-dev"
libnuma-dev \
libhwloc-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.

libhwloc and libtbb are already included in UMF_DEPS - in all Dockerfiles

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you have right, I will remove it

Copy link
Contributor

Choose a reason for hiding this comment

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

heh, nope - you should not remove the UMF_DEPS. These ARGs are not only to list all dependencies, this is also to show which ones are required for using the library, and which are required e.g. for testing.

I believe tbb is not required to compile UMF, but it's required for tests. hwloc is required for UMF, so could be removed from test deps.

Okay that's said - there's another issue that's connected.
libhwloc-dev should be installed only on newer Ubuntu, here on Ubuntu-20.04 we should not install it and only install it via our script.
So in this OS, pls move HWLOC_DEPS up, add no UMF_DEPS, but please make a comment that hwloc is required as UMF dependency.
On other OSes, please remove the hwloc script and HWLOC_DEPS, and use UMF_DEPS equal to libhwloc-dev.

valgrind"

# Miscellaneous for our builds/CI (optional)
ARG MISC_DEPS="\
Expand All @@ -38,24 +36,36 @@ ARG MISC_DEPS="\
g++-7 \
python3-pip \
sudo \
whois"
whois \
lcov"

# Hwloc installation dependencies
ARG HWLOC_DEPS="\
dos2unix \
libtool"

# Copy hwloc
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} \
&& bash /opt/umf/install_hwloc.sh \
&& ldconfig \
&& 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
Expand Down
30 changes: 20 additions & 10 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 @@ -22,35 +22,45 @@ ARG BASE_DEPS="\
cmake \
git"

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

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

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

# Hwloc installation dependencies
ARG HWLOC_DEPS="\
dos2unix \
libtool"

# Copy hwloc
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} \
&& bash /opt/umf/install_hwloc.sh \
&& ldconfig \
&& 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 Down
73 changes: 73 additions & 0 deletions .github/docker/ubuntu-24.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 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"

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

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

# Hwloc installation dependencies
ARG HWLOC_DEPS="\
dos2unix \
libtool"

# Copy hwloc
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} \
${TEST_DEPS} \
${MISC_DEPS} \
${HWLOC_DEPS} \
&& bash /opt/umf/install_hwloc.sh \
&& ldconfig \
&& 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
45 changes: 42 additions & 3 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,87 @@ concurrency:

permissions:
contents: read
packages: read

jobs:
CodeChecks:
uses: ./.github/workflows/reusable_checks.yml
DocsBuild:
uses: ./.github/workflows/reusable_docs_build.yml
DetectChanges:
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 }}"
BuildDockers:
Copy link
Contributor

Choose a reason for hiding this comment

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

pls verify if detectChanges works properly when we merge a PR - pls test scenarios when you merged PR with and without any docker changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm tbh I'm not sure what has been tested here...? these were not a "test PRs" being merged into main, right? I was thinking - you push your new workflow (with building docker) into your main, then open 2 PRs on your fork and see if they are working properly (on PR). Later, test if after merging they are still working properly.

// for testing purpose I feel like you have to use different actor and set token in secrets

if: ${{ contains(join(needs.DetectChanges.outputs.changed_files, ' '), '.github/docker/') }}
needs: [DetectChanges]
permissions:
contents: read
packages: write
secrets: inherit
uses: ./.github/workflows/reusable_dockers_build.yml
FastBuild:
name: Fast builds
needs: [CodeChecks, DocsBuild]
if: always() && (needs.BuildDockers.result == 'skipped' || needs.BuildDockers.result == 'success')
needs: [ CodeChecks, DocsBuild, BuildDockers]
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 +107,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
Loading
Loading