diff --git a/.github/docker/ubuntu-20.04.Dockerfile b/.github/docker/ubuntu-20.04.Dockerfile index a6a45a8c1..4c7dbae9e 100644 --- a/.github/docker/ubuntu-20.04.Dockerfile +++ b/.github/docker/ubuntu-20.04.Dockerfile @@ -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") @@ -22,40 +22,47 @@ 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 \ + 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 diff --git a/.github/docker/ubuntu-22.04.Dockerfile b/.github/docker/ubuntu-22.04.Dockerfile index 75c71c526..f0554fde9 100644 --- a/.github/docker/ubuntu-22.04.Dockerfile +++ b/.github/docker/ubuntu-22.04.Dockerfile @@ -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 @@ -20,21 +20,26 @@ ENV DEBIAN_FRONTEND noninteractive ARG BASE_DEPS="\ build-essential \ cmake \ - git" + git \ + gnupg \ + 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" @@ -43,14 +48,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 diff --git a/.github/docker/ubuntu-24.04.Dockerfile b/.github/docker/ubuntu-24.04.Dockerfile new file mode 100644 index 000000000..bd6e74f06 --- /dev/null +++ b/.github/docker/ubuntu-24.04.Dockerfile @@ -0,0 +1,67 @@ +# 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 \ + gnupg \ + 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 diff --git a/.github/workflows/detect_changes.yml b/.github/workflows/detect_changes.yml new file mode 100644 index 000000000..f8f73cf74 --- /dev/null +++ b/.github/workflows/detect_changes.yml @@ -0,0 +1,42 @@ +name: DetectChanges + +on: + pull_request: + paths: + - '.github/docker/*.Dockerfile' + 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" + + RunReusableDocker: + 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 diff --git a/.github/workflows/pr_push.yml b/.github/workflows/pr_push.yml index 5d6155a37..aed6443a7 100644 --- a/.github/workflows/pr_push.yml +++ b/.github/workflows/pr_push.yml @@ -14,17 +14,17 @@ concurrency: permissions: contents: read + packages: read jobs: CodeChecks: uses: ./.github/workflows/reusable_checks.yml FastBuild: - name: Fast builds - needs: [CodeChecks] + # needs: [CodeChecks] uses: ./.github/workflows/reusable_fast.yml Build: name: Basic builds - needs: [FastBuild] + # needs: [FastBuild] uses: ./.github/workflows/reusable_basic.yml DevDax: needs: [FastBuild] diff --git a/.github/workflows/reusable_basic.yml b/.github/workflows/reusable_basic.yml index ffc6c6f15..3a223604e 100644 --- a/.github/workflows/reusable_basic.yml +++ b/.github/workflows/reusable_basic.yml @@ -5,6 +5,7 @@ on: workflow_call permissions: contents: read + packages: read env: BUILD_DIR : "${{github.workspace}}/build" @@ -15,9 +16,16 @@ env: jobs: ubuntu-build: name: Ubuntu + runs-on: ubuntu-latest + container: + # image: ghcr.io/bb-ur/umf-ubuntu-${{ matrix.ubuntu_ver }}:latest + image: ghcr.io/rbanka1/umf-${{ matrix.ubuntu_ver }}:latest # test + options: --user test_user --privileged + volumes: + - ${{ github.workspace }}:${{ github.workspace }} strategy: matrix: - os: ['ubuntu-22.04', 'ubuntu-24.04'] + ubuntu_ver: ['ubuntu-22.04', 'ubuntu-24.04'] build_type: [Debug, Release] compiler: [{c: gcc, cxx: g++}] shared_library: ['OFF'] @@ -28,7 +36,7 @@ jobs: link_hwloc_statically: ['OFF'] cmake_ver: ['default'] include: - - os: 'ubuntu-22.04' + - ubuntu_ver: ubuntu-22.04 build_type: Release compiler: {c: clang, cxx: clang++} shared_library: 'OFF' @@ -39,7 +47,7 @@ jobs: link_hwloc_statically: 'OFF' # check minimum supported cmake version cmake_ver: '3.14.0' - - os: 'ubuntu-22.04' + - ubuntu_ver: ubuntu-22.04 build_type: Release compiler: {c: gcc, cxx: g++} shared_library: 'ON' @@ -49,7 +57,7 @@ jobs: disable_hwloc: 'OFF' link_hwloc_statically: 'OFF' cmake_ver: '3.28.0' - - os: 'ubuntu-24.04' + - ubuntu_ver: ubuntu-24.04 build_type: Debug compiler: {c: gcc, cxx: g++} shared_library: 'ON' @@ -60,7 +68,7 @@ jobs: link_hwloc_statically: 'OFF' cmake_ver: 'default' # test level_zero_provider='OFF' and cuda_provider='OFF' - - os: 'ubuntu-22.04' + - ubuntu_ver: ubuntu-22.04 build_type: Release compiler: {c: gcc, cxx: g++} shared_library: 'OFF' @@ -71,7 +79,7 @@ jobs: link_hwloc_statically: 'OFF' cmake_ver: 'default' # test icx compiler - - os: 'ubuntu-22.04' + - ubuntu_ver: ubuntu-22.04 build_type: Release compiler: {c: icx, cxx: icpx} shared_library: 'ON' @@ -82,7 +90,7 @@ jobs: link_hwloc_statically: 'OFF' cmake_ver: 'default' # test lld linker - - os: 'ubuntu-24.04' + - ubuntu_ver: ubuntu-24.04 build_type: Release compiler: {c: icx, cxx: icpx} shared_library: 'ON' @@ -93,8 +101,8 @@ jobs: link_hwloc_statically: 'OFF' llvm_linker: '-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld"' cmake_ver: 'default' - # test without installing TBB - - os: 'ubuntu-22.04' + # test without installing TBB + - ubuntu_ver: ubuntu-22.04 build_type: Release compiler: {c: gcc, cxx: g++} shared_library: 'ON' @@ -104,7 +112,7 @@ jobs: disable_hwloc: 'OFF' link_hwloc_statically: 'OFF' cmake_ver: 'default' - - os: 'ubuntu-22.04' + - ubuntu_ver: ubuntu-22.04 build_type: Debug compiler: {c: gcc, cxx: g++} shared_library: 'ON' @@ -114,7 +122,7 @@ jobs: disable_hwloc: 'ON' link_hwloc_statically: 'OFF' cmake_ver: 'default' - - os: 'ubuntu-22.04' + - ubuntu_ver: ubuntu-22.04 build_type: Release compiler: {c: gcc, cxx: g++} shared_library: 'ON' @@ -124,52 +132,38 @@ jobs: disable_hwloc: 'OFF' link_hwloc_statically: 'ON' cmake_ver: 'default' - runs-on: ${{matrix.os}} - steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - - name: Install apt packages - run: | - sudo apt-get update - sudo apt-get install -y clang libnuma-dev lcov - - name: Install cmake (non-default version) if: matrix.cmake_ver != 'default' run: | - sudo apt-get remove --purge -y cmake + echo ${USERPASS} | sudo -Sk apt-get remove --purge -y cmake wget https://github.com/Kitware/CMake/releases/download/v${{matrix.cmake_ver}}/cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh chmod +x cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh - sudo ./cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh --skip-license --prefix=/usr/local + ./cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh --skip-license --prefix=/usr/local - - name: Install hwloc - if: matrix.disable_hwloc == 'OFF' - run: | - sudo apt-get install -y libhwloc-dev - - - name: Install TBB apt package - if: matrix.install_tbb == 'ON' + - name: Uninstall TBB apt package + if: matrix.install_tbb == 'OFF' run: | - sudo apt-get install -y libtbb-dev + echo ${USERPASS} | sudo -Sk apt-get remove --purge -y libtbb-dev - name: Install oneAPI basekit if: matrix.compiler.cxx == 'icpx' run: | - sudo apt-get install -y gpg-agent wget - wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null - 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}} + echo ${USERPASS} | sudo -Sk apt-get update + echo ${USERPASS} | sudo -Sk apt-get install -y gpg-agent + 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 + echo ${USERPASS} | sudo -Sk apt-get update + echo ${USERPASS} | sudo -Sk apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp - name: Get UMF version run: | + git config --global --add safe.directory $GITHUB_WORKSPACE VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+') echo "UMF_VERSION=$VERSION" >> $GITHUB_ENV @@ -209,7 +203,7 @@ jobs: if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }} working-directory: ${{env.BUILD_DIR}} run: | - export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}} + export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-${{matrix.ubuntu_ver}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}} echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME" ../scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME mkdir -p ${{env.COVERAGE_DIR}} @@ -218,22 +212,22 @@ jobs: - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: ${{ matrix.build_type == 'Debug' && matrix.compiler.c == 'gcc' }} with: - name: ${{env.COVERAGE_NAME}}-${{matrix.os}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}} + name: ${{env.COVERAGE_NAME}}-${{matrix.ubuntu_ver}}-shared-${{matrix.shared_library}}-no_hwloc-${{matrix.disable_hwloc}} path: ${{env.COVERAGE_DIR}} - 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 + # # 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 diff --git a/.github/workflows/reusable_dockers_build.yml b/.github/workflows/reusable_dockers_build.yml new file mode 100644 index 000000000..afd86951e --- /dev/null +++ b/.github/workflows/reusable_dockers_build.yml @@ -0,0 +1,45 @@ +# Build and push Docker images to GHCR +name: BuildDockers + +on: + workflow_call: + workflow_dispatch: + +permissions: + packages: write + contents: read + +jobs: + build-dockers: + runs-on: ubuntu-latest + strategy: + matrix: + ubuntu-version: [20.04, 22.04, 24.04] + env: + # IMG: ghcr.io/bb-ur/umf-ubuntu-${{ matrix.ubuntu-version }}:latest + IMG: ghcr.io/${{ github.actor }}/umf-ubuntu-${{ matrix.ubuntu-version }}:latest # test + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Build ubuntu-${{ matrix.ubuntu-version }} Docker image + run: | + docker build -f .github/docker/ubuntu-${{ matrix.ubuntu-version }}.Dockerfile -t ${{ env.IMG }} . + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@30f019fb76bb54d03ec1e716054622be511a13b2 # v3.2.0 + with: + registry: ghcr.io + username: ${{ github.actor }} # test + password: ${{ secrets.GHCR_TOKEN }} # test + # username: bb-ur + # password: ${{ secrets.BB_GHCR_TOKEN }} + + - name: Push ubuntu-${{ matrix.ubuntu-version }} Docker image + # if: github.event_name != 'pull_request' + run: | + docker push ${{ env.IMG }} diff --git a/.github/workflows/reusable_fast.yml b/.github/workflows/reusable_fast.yml index 690cba072..206b49408 100644 --- a/.github/workflows/reusable_fast.yml +++ b/.github/workflows/reusable_fast.yml @@ -1,54 +1,107 @@ -# Fast builds +# Fast build linux part is working in dockers, Windows is not name: FastBuild on: workflow_call permissions: contents: read + packages: read env: BUILD_DIR : "${{github.workspace}}/build" INSTL_DIR : "${{github.workspace}}/install-dir" jobs: - FastBuild: - name: Fast builds - env: - VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows" + ubuntu-build: + name: Linux + runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-22.04' }} + container: + # image: ghcr.io/bb-ur/umf-ubuntu-${{ matrix.ubuntu_ver }}:latest + image: ghcr.io/rbanka1/umf-${{ matrix.ubuntu_ver }}:latest # test + options: --user test_user --privileged + volumes: + - ${{ github.workspace }}:${{ github.workspace }} strategy: matrix: include: - - os: windows-latest + - ubuntu_ver: ubuntu-22.04 build_tests: 'ON' + extra_build_options: ' -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON' simple_cmake: 'OFF' - # pure C build (Windows) - - os: windows-latest + # pure C build + - ubuntu_ver: ubuntu-22.04 # Tests' building is off for a pure C build build_tests: 'OFF' + extra_build_options: '-DUMF_BUILD_BENCHMARKS=ON' simple_cmake: 'OFF' - - os: ubuntu-latest + # simplest CMake on Ubuntu 22.04, 24.04 + - ubuntu_ver: ubuntu-22.04 build_tests: 'ON' - # Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command - extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON' - simple_cmake: 'OFF' - # pure C build (Linux) - - os: ubuntu-latest - # Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command - # Tests' building is off for a pure C build - build_tests: 'OFF' - extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON' - simple_cmake: 'OFF' - # simplest CMake on ubuntu-latest - - os: ubuntu-latest - build_tests: 'ON' - extra_build_options: '-DCMAKE_BUILD_TYPE=Release' simple_cmake: 'ON' - # simplest CMake ubuntu-22.04 - - os: ubuntu-22.04 + - ubuntu_ver: ubuntu-24.04 build_tests: 'ON' - extra_build_options: '-DCMAKE_BUILD_TYPE=Release' simple_cmake: 'ON' - runs-on: ${{ (matrix.os == 'ubuntu-latest' && github.repository_owner == 'oneapi-src') && 'intel-ubuntu-22.04' || matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Configure CMake + if: matrix.simple_cmake == 'OFF' + run: > + cmake + -B ${{env.BUILD_DIR}} + -DCMAKE_BUILD_TYPE=Release + -DUMF_FORMAT_CODE_STYLE=OFF + -DUMF_DEVELOPER_MODE=ON + -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON + -DUMF_BUILD_TESTS=${{matrix.build_tests}} + -DUMF_BUILD_EXAMPLES=ON + -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON + -DUMF_BUILD_CUDA_PROVIDER=ON + -DUMF_TESTS_FAIL_ON_SKIP=ON + -DUMF_BUILD_SHARED_LIBRARY=ON + ${{matrix.extra_build_options}} + + - name: Configure CMake (simple) + if: matrix.simple_cmake == 'ON' + run: > + cmake + -B ${{env.BUILD_DIR}} + -DCMAKE_BUILD_TYPE=Release + -DUMF_BUILD_SHARED_LIBRARY=ON + -DUMF_TESTS_FAIL_ON_SKIP=ON + ${{matrix.extra_build_options}} + + - name: Build + run: cmake --build ${{env.BUILD_DIR}} --config Release -j $(nproc) + + - name: Run examples + working-directory: ${{env.BUILD_DIR}} + run: ctest --output-on-failure --test-dir examples -C Release + + - name: Run tests + if: matrix.build_tests == 'ON' + working-directory: ${{env.BUILD_DIR}} + run: ctest --output-on-failure --test-dir test -C Release + + windows-build: + name: Windows + runs-on: windows-latest + + env: + VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows" + strategy: + matrix: + include: + - build_tests: 'ON' + simple_cmake: 'OFF' + - build_tests: 'OFF' + simple_cmake: 'OFF' + - build_tests: 'OFF' + simple_cmake: 'ON' steps: - name: Checkout repository @@ -57,24 +110,16 @@ jobs: fetch-depth: 0 - name: Initialize vcpkg - if: matrix.os == 'windows-latest' uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5 with: vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025 vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg vcpkgJsonGlob: '**/vcpkg.json' - - name: Install dependencies (windows-latest) - if: matrix.os == 'windows-latest' + - name: Install dependencies run: vcpkg install --triplet x64-windows shell: pwsh # Specifies PowerShell as the shell for running the script. - - name: Install dependencies - if: matrix.os != 'windows-latest' - run: | - sudo apt-get update - sudo apt-get install -y cmake libhwloc-dev libnuma-dev libtbb-dev - - name: Configure CMake if: matrix.simple_cmake == 'OFF' run: > @@ -91,7 +136,6 @@ jobs: -DUMF_BUILD_CUDA_PROVIDER=ON -DUMF_TESTS_FAIL_ON_SKIP=ON -DUMF_BUILD_SHARED_LIBRARY=ON - ${{matrix.extra_build_options}} - name: Configure CMake (simple) if: matrix.simple_cmake == 'ON' @@ -99,9 +143,9 @@ jobs: cmake -B ${{env.BUILD_DIR}} -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}" + -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}" -DUMF_BUILD_SHARED_LIBRARY=ON -DUMF_TESTS_FAIL_ON_SKIP=ON - ${{matrix.extra_build_options}} - name: Build run: cmake --build ${{env.BUILD_DIR}} --config Release -j @@ -118,7 +162,6 @@ jobs: # TODO: We could add some script to verify metadata of dll's (selected fields, perhaps) # ref. https://superuser.com/questions/381276/what-are-some-nice-command-line-ways-to-inspect-dll-exe-details - name: Print metadata of our dll's - if: matrix.os == 'windows-latest' run: | get-command ${{github.workspace}}/build/bin/Release/umf.dll | format-list get-command ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll | format-list diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a050c0ae..4c3b9f79e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,7 @@ - [Opening new issues](#opening-new-issues) - [Submitting Pull Requests](#submitting-pull-requests) - [Building and testing](#building-and-testing) + - [Building/Rebuilding Docker Images](#buildingrebuilding-docker-images) - [Code style](#code-style) - [When my PR is merged?](#when-my-pr-is-merged) - [Extending public API](#extending-public-api) @@ -67,6 +68,13 @@ To enable additional checks (including `-Werror` / `/WX` compilation flag), swit `UMF_DEVELOPER_MODE`. To read more about all available CMake options please see ["CMake standard options"](./README.md#cmake-standard-options) section in the top-level Readme. +### Building/Rebuilding Docker Images + +If you want to rebuild existing Docker images or add a new one, you must open a separate pull +request dedicated to Docker-related changes. This PR must be merged into the main branch first. + +Only after the PR is merged will the updated Docker images be available for use in workflows. + ### Code style We use `clang-format` to verify and apply code style changes to C/C++ source files. To see all rules we require, please take a look at `.clang-format` file in the