-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: main
Are you sure you want to change the base?
Docker workflow #1105
Changes from 5 commits
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,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" | ||
|
||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 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++ \ | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
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 | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
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 }}" | ||
BuildDockers: | ||
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. pls verify if detectChanges works properly when we merge a PR - pls test scenarios when you merged PR with and without any docker changes 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. 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. 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 | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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] | ||
lukaszstolarczuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 +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 | ||
|
There was a problem hiding this comment.
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 DockerfilesThere was a problem hiding this comment.
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
There was a problem hiding this comment.
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.