-
Notifications
You must be signed in to change notification settings - Fork 35
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
Docker workflow #1105
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" | ||
|
||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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 | ||
|
||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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 | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: BuildCIContainer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so also pls rename the file to |
||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
jobs: | ||
build-ci-container: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this job shall be limited to upstream only:
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 }} | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 . | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
docker push ghcr.io/${{ github.actor }}/umf2-ubuntu-${{ matrix.ubuntu-version }}:latest |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,50 +14,84 @@ concurrency: | |
|
||
permissions: | ||
contents: read | ||
packages: write | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
jobs: | ||
CodeChecks: | ||
uses: ./.github/workflows/reusable_checks.yml | ||
DocsBuild: | ||
uses: ./.github/workflows/reusable_docs_build.yml | ||
PrintModifiedFiles: | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}" | ||
BuildCIContainer: | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if: ${{ contains(join(needs.PrintModifiedFiles.outputs.changed_files, ' '), '.github/docker/') }} | ||
needs: [PrintModifiedFiles] | ||
secrets: inherit | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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') | ||
PatKamin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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: | ||
|
@@ -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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: workflow_call | |
|
||
permissions: | ||
contents: read | ||
packages: read | ||
|
||
env: | ||
BUILD_DIR : "${{github.workspace}}/build" | ||
|
@@ -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 | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still missing tbb removal for |
||
- name: Install apt packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y clang cmake libnuma-dev lcov | ||
|
||
- name: Install TBB apt package | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if: matrix.install_tbb == 'ON' | ||
run: | | ||
sudo apt-get install -y libtbb-dev | ||
|
||
- name: Install oneAPI basekit | ||
if: matrix.compiler.cxx == 'icpx' | ||
run: | | ||
|
@@ -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 | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+') | ||
echo "UMF_VERSION=$VERSION" >> $GITHUB_ENV | ||
|
||
- name: Configure build | ||
run: > | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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... There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Uh oh!
There was an error while loading. Please reload this page.