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

[WIP] Docker in the nightly testing #1033

Draft
wants to merge 29 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
143f4a2
Docker in the nightly testing
rbanka1 Jan 13, 2025
46b60fb
Try to fix bad substitution error
rbanka1 Jan 14, 2025
726fd23
Merge branch 'main' into addDocker
rbanka1 Jan 14, 2025
81abd42
Try to fix bad substitution error V2
rbanka1 Jan 14, 2025
0d602d9
Try to fix bad substitution error V2.2
rbanka1 Jan 14, 2025
bfb7e5e
Merge branch 'oneapi-src:main' into addDocker
rbanka1 Jan 14, 2025
ede9ec5
install hwloc
rbanka1 Jan 15, 2025
b565cd3
,
rbanka1 Jan 15, 2025
69bde86
Merge branch 'main' into addDocker
rbanka1 Jan 15, 2025
888c185
working docker
rbanka1 Jan 15, 2025
b610766
add valgrind
rbanka1 Jan 15, 2025
8d27aea
..
rbanka1 Jan 16, 2025
3207e4c
Add FindVALGRIND.cmake
rbanka1 Jan 16, 2025
6f9ed9b
build-docker-BasicBuilds
rbanka1 Jan 23, 2025
c7053bf
build-docker-BasicBuilds
rbanka1 Jan 23, 2025
ae630ec
build-docker-BasicBuilds V2
rbanka1 Jan 23, 2025
a15b792
build-docker-BasicBuilds V2.2
rbanka1 Jan 23, 2025
10ab5cf
dockerHub test
rbanka1 Jan 28, 2025
cd042a6
dockerHub test
rbanka1 Jan 28, 2025
84f5db8
dockerHub test
rbanka1 Jan 28, 2025
5d68917
dockerHub test
rbanka1 Jan 28, 2025
233a67d
dockerHub test
rbanka1 Jan 28, 2025
1dc7cca
dockerHub test L&Win
rbanka1 Jan 28, 2025
8fd1ab1
Merge branch 'main' into addDocker
rbanka1 Jan 28, 2025
6fc641a
dockerHub test L&Win
rbanka1 Jan 28, 2025
e298464
dockerHub test L&Win
rbanka1 Jan 28, 2025
eef0189
dockerHub test L&Win
rbanka1 Jan 28, 2025
6246020
dockerHub test L&Win
rbanka1 Jan 28, 2025
75afc7b
dockerHub test L&Win
rbanka1 Jan 28, 2025
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
15 changes: 14 additions & 1 deletion .github/docker/ubuntu-20.04.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,21 @@ 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

# 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
104 changes: 56 additions & 48 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
name: Nightly

# This job is run at 00:00 UTC every day or on demand.
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
on: workflow_call
# workflow_dispatch:
# schedule:
# - cron: '0 0 * * *'

permissions:
contents: read
Expand All @@ -27,28 +27,32 @@ jobs:
with:
fetch-depth: 0

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev

- name: Configure CMake
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
-DUMF_TESTS_FAIL_ON_SKIP=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_FUZZTESTS=ON
# - name: Build Docker image
# run: |
# docker build -f .github/docker/ubuntu-20.04.Dockerfile -t umf-ubuntu-20.04 .

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --verbose -j$(nproc)

- name: Fuzz long test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{matrix.build_type}} --output-on-failure --verbose -L "fuzz-long"
- name: Fuzz long test in Docker container
Copy link
Contributor

Choose a reason for hiding this comment

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

ok, at the beginning you can run more simple tests (like BasicBuilds or FastBuilds). Let's say Valgrind and Fuzz tests are a little more complicated and can be added separately.

Also, you don't have to update existing jobs to use dockers, as discussed - for the starters we can add one extra job running on dockers in nightly build

run: |
docker run --rm \
-v ${{github.workspace}}:/workspace \
-w /workspace \
--env BUILD_TYPE=${{matrix.build_type}} \
--user root \
umf-ubuntu-20.04 \
bash -c "
export VALGRIND_LIB=/usr/lib/valgrind/ &&
apt-get update &&
apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev &&
cmake -B /workspace/build \
-DCMAKE_BUILD_TYPE=\$BUILD_TYPE \
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} \
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} \
-DUMF_TESTS_FAIL_ON_SKIP=ON \
-DUMF_DEVELOPER_MODE=ON \
-DUMF_BUILD_FUZZTESTS=ON &&
cmake --build /workspace/build --config \$BUILD_TYPE --verbose -j$(nproc) &&
ctest -C \$BUILD_TYPE --output-on-failure --verbose -L "fuzz-long"
"

valgrind:
name: Valgrind
Expand All @@ -64,30 +68,34 @@ jobs:
with:
fetch-depth: 0

- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev valgrind

- name: Configure CMake
run: >
cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=Debug
-DUMF_FORMAT_CODE_STYLE=OFF
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_USE_VALGRIND=1
-DUMF_TESTS_FAIL_ON_SKIP=ON
# - name: Build Docker image
# run: |
# docker build -f .github/docker/ubuntu-20.04.Dockerfile -t umf-ubuntu-20.04 .

- name: Build
run: cmake --build ${{github.workspace}}/build --config Debug -j$(nproc)

- name: Run tests under valgrind
run: ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{github.workspace}}/build ${{matrix.tool}}
- name: Run tests under valgrind in Docker
run: |
docker run --rm \
-v ${{github.workspace}}:/workspace \
-w /workspace \
--env TOOL=${{ matrix.tool }} \
--user root \
umf-ubuntu-20.04 \
bash -c "\
apt-get update &&
apt-get install -y cmake hwloc libhwloc-dev libnuma-dev libtbb-dev valgrind &&
cmake -B /workspace/build \
-DCMAKE_BUILD_TYPE=Debug \
-DUMF_FORMAT_CODE_STYLE=OFF \
-DUMF_DEVELOPER_MODE=ON \
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON \
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON \
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF \
-DUMF_BUILD_CUDA_PROVIDER=OFF \
-DUMF_USE_VALGRIND=1 \
-DUMF_TESTS_FAIL_ON_SKIP=ON &&
cmake --build /workspace/build --config Debug -j$(nproc) &&
/workspace/test/test_valgrind.sh /workspace /workspace/build \$TOOL
"

# TODO fix #843
#icx:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
uses: ./.github/workflows/reusable_checks.yml
DocsBuild:
uses: ./.github/workflows/reusable_docs_build.yml
Nightly:
uses: ./.github/workflows/nightly.yml
FastBuild:
name: Fast builds
needs: [CodeChecks, DocsBuild]
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
find_package(PkgConfig)

find_package(Valgrind REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

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

if(Valgrind_FOUND)
message(STATUS "Found Valgrind!")
else()
message(FATAL_ERROR "Valgrind not found!")
endif()

# Define a list to store the names of all options
set(UMF_OPTIONS_LIST "")
list(APPEND UMF_OPTIONS_LIST CMAKE_BUILD_TYPE)
Expand Down
22 changes: 22 additions & 0 deletions cmake/FindVALGRIND.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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

if(NOT VALGRIND_ROOT AND DEFINED ENV{VALGRIND_ROOT})
set(VALGRIND_ROOT "$ENV{VALGRIND_ROOT}" CACHE PATH "Valgrind base directory location (optional, used for nonstandard installation paths)")
mark_as_advanced(VALGRIND_ROOT)
endif()

# Search path for nonstandard locations
if(VALGRIND_ROOT)
set(Valgrind_INCLUDE_PATH PATHS "${VALGRIND_ROOT}/include" "${VALGRIND_ROOT}/valgrind/current/usr/include" NO_DEFAULT_PATH)
set(Valgrind_BINARY_PATH PATHS "${VALGRIND_ROOT}/bin" NO_DEFAULT_PATH)
endif()

find_path(Valgrind_INCLUDE_DIR valgrind/memcheck.h HINTS ${Valgrind_INCLUDE_PATH})
find_program(Valgrind_EXECUTABLE NAMES valgrind PATH ${Valgrind_BINARY_PATH})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Valgrind DEFAULT_MSG Valgrind_INCLUDE_DIR Valgrind_EXECUTABLE)

mark_as_advanced(Valgrind_INCLUDE_DIR Valgrind_EXECUTABLE)
16 changes: 8 additions & 8 deletions third_party/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ black==24.3.0
# Tests
packaging==24.2
# Generating HTML documentation
pygments==2.19.1
sphinxcontrib_applehelp==2.0.0
sphinxcontrib_devhelp==2.0.0
sphinxcontrib_htmlhelp==2.1.0
sphinxcontrib_serializinghtml==2.0.0
sphinxcontrib_qthelp==2.0.0
pygments==2.18.0
Copy link
Contributor

Choose a reason for hiding this comment

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

we should rather not downgrade packages, rather move them up

sphinxcontrib_applehelp==1.0.0
sphinxcontrib_devhelp==1.0.0
sphinxcontrib_htmlhelp==2.0.1
sphinxcontrib_serializinghtml==1.1.5
sphinxcontrib_qthelp==1.0.3
breathe==4.35.0
sphinx==8.1.3
sphinx_book_theme==1.1.3
sphinx==7.1.2
sphinx_book_theme==1.0.1
# Spelling check in documentation
pyenchant==3.2.2
sphinxcontrib-spelling==8.0.0
Loading