Skip to content

Configure CI on self-hosted runner #17

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

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
ead088f
Compiled cuBool and run tests with CUDA 12.6
mitya-y Oct 22, 2024
443d78d
Temporary removed python package support for compiling rpq algorithm
mitya-y Oct 22, 2024
f429420
Fixed cubool tests
mitya-y Nov 5, 2024
e434bb1
Implemented applying inverted mask
mitya-y Nov 5, 2024
2f5daac
Fixed mistake in matrix ewise add
mitya-y Nov 24, 2024
99f1d8e
Fixed errors in cmake: incorrect compile options for NVCC
mitya-y Feb 16, 2025
b404863
Added option for using matrix addition optimization from nsparse
mitya-y Feb 18, 2025
f81ccea
Updated gtest version to last release for compability with last cmake…
mitya-y Apr 19, 2025
da6be34
Restored python package build
mitya-y May 3, 2025
69d38a6
Removed temporary solutions for preparing PR
mitya-y May 3, 2025
f304b58
ci: run on self-hosted platform
sevenbunu Mar 12, 2025
fb6867b
ci: update versions of packages
sevenbunu Mar 12, 2025
21de87c
ci: comment unnecessary python installation
sevenbunu Mar 12, 2025
4d5e940
ci: left only the installation step
sevenbunu Mar 17, 2025
0c28baf
feat(install_cuda): update the installation script
sevenbunu Mar 17, 2025
444fac7
ci: add source command for installation script startup
sevenbunu Mar 17, 2025
7172915
fix(install_cuda): add correct url
sevenbunu Mar 17, 2025
b95f94c
ci: add gcc and g++ installation
sevenbunu Mar 17, 2025
4eb72e7
ci: add cmake config
sevenbunu Mar 17, 2025
93d3c08
fix: add correct version of gcc
sevenbunu Mar 17, 2025
6143a65
fix: correct env variables export
sevenbunu Mar 17, 2025
7e57342
fix: add cudacxx flag to cmake
sevenbunu Mar 17, 2025
1bc1811
fix: add cuda architecture flag in cmake
sevenbunu Mar 17, 2025
db88a3f
fix: add cudacxx env variable
sevenbunu Mar 17, 2025
6680369
ci: delete cuda architecture flag
sevenbunu Mar 20, 2025
2cd33f1
ci: add unit and regression tests
sevenbunu Mar 20, 2025
86e5067
ci: change working directory
sevenbunu Mar 20, 2025
ea77980
ci: change the way of running scripts
sevenbunu Mar 20, 2025
300a36a
ci: add python working directory toregression tests
sevenbunu Mar 20, 2025
850ab4a
ci: call tests from build directory
sevenbunu Mar 20, 2025
934aa5c
ci: turn on the flag with tests
sevenbunu Mar 20, 2025
749cde1
ci: comment build stage
sevenbunu Mar 20, 2025
8130fed
fix(cmake): uncomment test build
sevenbunu Mar 20, 2025
ce82e3c
ci: add job with test in pipeline
sevenbunu Apr 10, 2025
76cebaa
fix: change python version
sevenbunu Apr 10, 2025
d7c0088
ci: add cudacxx env variable
sevenbunu Apr 10, 2025
aa64a88
ci: add separate pipeline for self-hosted
sevenbunu Apr 21, 2025
b4167d9
ci: add correct platform
sevenbunu Apr 21, 2025
071309e
ci: add environment variables in test stage
sevenbunu Apr 21, 2025
fc4296d
fix: delete extra quotes
sevenbunu Apr 21, 2025
f98ea6c
ci: add error status of pipeline
sevenbunu Apr 21, 2025
374e060
ci: add test script start up
sevenbunu Apr 23, 2025
176bf18
fix: change working directory
sevenbunu Apr 23, 2025
1660aab
ci: change way of test start up
sevenbunu Apr 24, 2025
1e156a8
ci: change tests run
sevenbunu Apr 24, 2025
0101c7e
ci: add check for failed tests
sevenbunu Apr 24, 2025
e0ce1cb
ci: add newlines in output
sevenbunu Apr 24, 2025
e3416cc
fix: add minimal version of gcc in ubuntu
sevenbunu Apr 24, 2025
faf132d
fix: change tty
sevenbunu Apr 24, 2025
fbab403
ci: use tee to generate pipeline
sevenbunu Apr 24, 2025
7431fb5
ci: add double brackets
sevenbunu Apr 24, 2025
d80229c
test: add test print
sevenbunu Apr 25, 2025
78a1ab7
ci: delete unnecessary print
sevenbunu Apr 25, 2025
2320e78
ci: add tests result artifact
sevenbunu Apr 25, 2025
7d9a039
ci: add check for result as separate step
sevenbunu Apr 25, 2025
c547aa0
test: check for workspace variable
sevenbunu May 3, 2025
66dead9
ci: add clean up of repo
sevenbunu May 3, 2025
63e2384
ci: add tests on cpu
sevenbunu May 4, 2025
3a7049f
ci: delete run on test branches
sevenbunu May 4, 2025
36a4776
ci: delete run on self-hosted branch
sevenbunu May 4, 2025
3ea12e7
ci: delete cpu pipeline
sevenbunu May 5, 2025
033366a
test: cleanup in failed pipeline
sevenbunu May 5, 2025
d85d41a
ci: add needs in clean job
sevenbunu May 5, 2025
5b0b33e
ci: uncomment test pipeline
sevenbunu May 5, 2025
a82a791
test: check cpu version of github runner
sevenbunu May 6, 2025
aec5bb9
ci: add tests for cpu use case
sevenbunu May 6, 2025
412f0a6
ci: delete shell from steps
sevenbunu May 6, 2025
6ab461b
ci: add artifact download
sevenbunu May 6, 2025
f782c5f
ci: add cpu and gpu tests run
sevenbunu May 6, 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
112 changes: 112 additions & 0 deletions .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Self-Hosted

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

env:
build_dir: "build"

jobs:
build:
name: Build ${{ matrix.os }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }}
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
cuda: "12.8"
gcc: 13
env:
config: "Release"

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set environment variables
run: |
echo "CUDA_PATH=/usr/local/cuda-12.8" >> $GITHUB_ENV
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CUDACXX=/usr/local/cuda-${{ matrix.cuda }}/bin/nvcc" >> $GITHUB_ENV

- name: Configure CMake build
run: |
cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=ON

- name: Build library sources
working-directory: ${{ env.build_dir }}
run: |
cmake --build . --target all --verbose -j `nproc`

test:
name: Test GPU ${{ matrix.gpu }} CUDA ${{ matrix.cuda }}
needs: build
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
include:
- gpu: NVIDIA-GeForce-GT-1030
cuda: "12.9"
env:
unit-test-file: gpu_test_all.log
regression-test-file: gpu_test_regression.log

steps:
- name: Run unit-tests
working-directory: ${{ env.build_dir }}
run: |
source scripts/run_tests_all.sh | tee ${{ env.unit-test-file }}

- name: Upload unit tests resutls
uses: actions/upload-artifact@v4
with:
name: ${{ env.unit-test-file }}
path: ${{ env.build_dir }}/${{ env.unit-test-file }}

- name: Check for unit tests results
working-directory: ${{ env.build_dir }}
run: |
if grep -q "FAILED" ${{ env.unit-test-file }}; then
exit 1
fi

- name: Run regression-tests
working-directory: ${{ env.build_dir }}/python
run: |
source run_tests.sh 2>&1 | tee ${{ env.regression-test-file }}

- name: Upload regression tests resutls
uses: actions/upload-artifact@v4
with:
name: ${{ env.regression-test-file }}
path: ${{ env.build_dir }}/python/${{ env.regression-test-file }}

- name: Check for regression tests results
working-directory: ${{ env.build_dir }}/python
run: |
if grep -q "FAILED" ${{ env.regression-test-file }}; then
exit 1
fi

clean:
name: Cleanup workspace
needs: test
if: always()
runs-on: self-hosted

steps:
- name: Cleanup workspace
run: |
rm -rf ${{ github.workspace }}/*
rm -rf ${{ github.workspace }}/.*
120 changes: 73 additions & 47 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Original script from https://github.com/ptheywood/cuda-cmake-github-actions

name: Ubuntu

on:
Expand All @@ -9,74 +7,102 @@ on:
branches: [ master ]
workflow_dispatch:

env:
build_dir: "build"
artifact: "cubool-ubuntu-build.tar.xz"

jobs:
build:
name: Build ${{ matrix.os }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }}
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
cuda: "10.1"
gcc: 8
- os: ubuntu-22.04
env:
build_dir: "build"
config: "Release"
artifact: "cubool-ubuntu-build.tar.xz"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Install CUDA
env:
cuda: ${{ matrix.cuda }}
- name: Configure CMake build
run: |
source ./scripts/install_cuda_ubuntu.sh
if [[ $? -eq 0 ]]; then
# Set paths for subsequent steps, using ${CUDA_PATH}
echo "Adding CUDA to CUDA_PATH, PATH and LD_LIBRARY_PATH"
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
fi
shell: bash
cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=ON -DCUBOOL_WITH_CUDA=OFF

- name: Install and configure GCC and GXX
- name: Build library sources
working-directory: ${{ env.build_dir }}
run: |
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
echo "СС=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
cmake --build . --target all --verbose -j `nproc`

- name: Configure CMake build
run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=YES
- name: Prepare upload binary
run: |
tar cfz ${{ env.artifact }} ${{ env.build_dir }}

- name: Build library sources
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact }}
path: ${{ env.artifact }}

test:
name: Test CPU ${{ matrix.cpu }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
cpu: AMD-EPYC-7763
env:
unit-test-file: cpu_test_all.log
regression-test-file: cpu_test_regression.log

steps:
- uses: actions/download-artifact@v4
with:
name: ${{ env.artifact }}

- name: Unarchive artifact
run: |
tar xzf ${{ env.artifact }}
rm ${{ env.artifact }}

- name: Run unit-tests
working-directory: ${{ env.build_dir }}
run: cmake --build . --target all --verbose -j `nproc`
run: |
source scripts/run_tests_all.sh | tee ${{ env.unit-test-file }}

- name: Run unit-tests (sequential backend)
- name: Upload unit tests resutls
uses: actions/upload-artifact@v4
with:
name: ${{ env.unit-test-file }}
path: ${{ env.build_dir }}/${{ env.unit-test-file }}

- name: Check for unit tests results
working-directory: ${{ env.build_dir }}
run: bash scripts/run_tests_fallback.sh
shell: bash
run: |
if grep -q "FAILED" ${{ env.unit-test-file }}; then
exit 1
fi

- name: Run regression-tests (sequential backend)
- name: Run regression-tests
working-directory: ${{ env.build_dir }}/python
run: bash run_tests.sh
shell: bash

- name: Prepare upload binary
shell: bash
run: tar cfz ${{ env.artifact }} ${{ env.build_dir }}
run: |
source run_tests.sh 2>&1 | tee ${{ env.regression-test-file }}

- name: Upload binary
uses: actions/upload-artifact@v2
- name: Upload regression tests resutls
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact }}
path: ${{ env.artifact }}
name: ${{ env.regression-test-file }}
path: ${{ env.build_dir }}/python/${{ env.regression-test-file }}

- name: Check for regression tests results
working-directory: ${{ env.build_dir }}/python
run: |
if grep -q "FAILED" ${{ env.regression-test-file }}; then
exit 1
fi
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "deps/gtest"]
path = deps/gtest
url = https://github.com/google/googletest.git
[submodule "deps/cub"]
path = deps/cub
url = https://github.com/NVIDIA/cub.git
12 changes: 3 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ option(CUBOOL_WITH_NAIVE "Build library with naive and naive-shared dens
option(CUBOOL_BUILD_TESTS "Build project unit-tests with gtest" ON)
option(CUBOOL_COPY_TO_PY_PACKAGE "Copy compiled shared library into python package folder (for package use purposes)" ON)

option(CUBOOL_USE_NSPARSE_MERGE_FUNCTOR "Use nsparse optimiztion for matrix addition function" ON)

set(CUBOOL_VERSION_MAJOR 1)
set(CUBOOL_VERSION_MINOR 0)
set(CUBOOL_VERSION_SUB 0)
Expand All @@ -32,14 +34,6 @@ endif()

# Configure cuda dependencies
if (CUBOOL_WITH_CUDA)
message(STATUS "Add cub as cuda utility")
set(CUB_ENABLE_HEADER_TESTING OFF CACHE BOOL "" FORCE)
set(CUB_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
set(CUB_ENABLE_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(deps/cub)
add_library(cub INTERFACE IMPORTED)
target_link_libraries(cub INTERFACE CUB::CUB)

message(STATUS "Add nsparse library as crs matrix multiplication backend")
add_subdirectory(deps/nsparse-um)
endif()
Expand All @@ -61,4 +55,4 @@ add_subdirectory(cubool)
file(COPY scripts DESTINATION ${CMAKE_BINARY_DIR}/)

# Copy python related stuff
file(COPY python DESTINATION ${CMAKE_BINARY_DIR}/)
file(COPY python DESTINATION ${CMAKE_BINARY_DIR}/)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ $ bash ./scripts/run_tests_all.sh
By default, the following cmake options will be automatically enabled:

- `CUBOOL_WITH_CUDA` - build library with actual cuda backend
- `CUBOOL_WITH_SEQUENTIAL` - build library witt cpu based backend
- `CUBOOL_WITH_SEQUENTIAL` - build library with cpu based backend
- `CUBOOL_WITH_TESTS` - build library unit-tests collection

> Note: in order to provide correct GCC version for CUDA sources compiling,
Expand Down
14 changes: 8 additions & 6 deletions cubool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ set(CUBOOL_C_API_SOURCES
sources/cuBool_Matrix_Reduce2.cpp
sources/cuBool_Matrix_EWiseAdd.cpp
sources/cuBool_Matrix_EWiseMult.cpp
sources/cuBool_Matrix_EWiseMultInverted.cpp
sources/cuBool_Vector_New.cpp
sources/cuBool_Vector_Build.cpp
sources/cuBool_Vector_SetElement.cpp
Expand Down Expand Up @@ -125,6 +126,7 @@ if (CUBOOL_WITH_CUDA)
sources/cuda/cuda_matrix.cu
sources/cuda/cuda_matrix_ewiseadd.cu
sources/cuda/cuda_matrix_ewisemult.cu
sources/cuda/cuda_matrix_ewisemult_inverted.cu
sources/cuda/cuda_matrix_kronecker.cu
sources/cuda/cuda_matrix_multiply.cu
sources/cuda/cuda_matrix_transpose.cu
Expand All @@ -147,6 +149,7 @@ if (CUBOOL_WITH_CUDA)
sources/cuda/kernels/spgemv_t.cuh
sources/cuda/kernels/spewiseadd.cuh
sources/cuda/kernels/spewisemult.cuh
sources/cuda/kernels/spewisemultinverted.cuh
sources/cuda/kernels/sptranspose.cuh
sources/cuda/kernels/sptranspose2.cuh
sources/cuda/kernels/spkron.cuh
Expand All @@ -173,6 +176,8 @@ if (CUBOOL_WITH_SEQUENTIAL)
sources/sequential/sq_ewiseadd.hpp
sources/sequential/sq_ewisemult.cpp
sources/sequential/sq_ewisemult.hpp
sources/sequential/sq_ewisemultinverted.cpp
sources/sequential/sq_ewisemultinverted.hpp
sources/sequential/sq_spgemm.cpp
sources/sequential/sq_spgemm.hpp
sources/sequential/sq_spgemv.cpp
Expand Down Expand Up @@ -201,11 +206,9 @@ target_compile_definitions(cubool PRIVATE CUBOOL_VERSION_MAJOR=${CUBOOL_VERSION_
target_compile_definitions(cubool PRIVATE CUBOOL_VERSION_MINOR=${CUBOOL_VERSION_MINOR})
target_compile_definitions(cubool PRIVATE CUBOOL_VERSION_SUB=${CUBOOL_VERSION_SUB})

target_compile_features(cubool PUBLIC cxx_std_14)
target_compile_definitions(cubool PRIVATE CUBOOL_USE_NSPARSE_MERGE_FUNCTOR=$<BOOL:${CUBOOL_USE_NSPARSE_MERGE_FUNCTOR}>)

target_compile_options(cubool PRIVATE $<$<COMPILE_LANGUAGE:CXX>: -Wall>)
target_compile_options(cubool PRIVATE $<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:CXX>>: -O2>)
target_compile_options(cubool PRIVATE $<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:CXX>>: -O0>)
target_compile_features(cubool PUBLIC cxx_std_17)

set_target_properties(cubool PROPERTIES CXX_STANDARD 17)
set_target_properties(cubool PROPERTIES CXX_STANDARD_REQUIRED ON)
Expand All @@ -219,7 +222,6 @@ endforeach()
if (CUBOOL_WITH_CUDA)
set_target_properties(cubool PROPERTIES CUDA_STANDARD 14)
set_target_properties(cubool PROPERTIES CUDA_STANDARD_REQUIRED ON)
set_target_properties(cubool PROPERTIES CUDA_SEPARABLE_COMPILATION ON)

# Settings: https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

Expand Down Expand Up @@ -256,4 +258,4 @@ if (CUBOOL_COPY_TO_PY_PACKAGE)
"${CMAKE_BINARY_DIR}/cubool/${LIBRARY_FILE_NAME}"
"${CMAKE_BINARY_DIR}/python/pycubool"
COMMENT "Copy ${LIBRARY_FILE_NAME} compiled lib into python folder")
endif()
endif()
Loading
Loading