Skip to content

Commit

Permalink
run dr shp-tests in a docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
haichangsi committed Jun 7, 2024
1 parent e3f28c0 commit 46dc5dd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
6 changes: 2 additions & 4 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# docker build -t oneapi-gcc13 .
# docker run -ti --rm oneapi-gcc13
FROM intel/oneapi:latest
RUN apt update
RUN apt update --allow-insecure-repositories
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt install -y g++-13
RUN apt install -y libgtest-dev
Expand All @@ -13,4 +11,4 @@ RUN tar -xzvf cmake-3.29.2.tar.gz && cd cmake-3.29.2 && ./bootstrap && make -j12

RUN apt install -y libfmt-dev

CMD /bin/bash
CMD /bin/bash
26 changes: 21 additions & 5 deletions .github/workflows/ci.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,29 @@ jobs:
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DONEDPL_DEVICE_TYPE=${{ matrix.device_type }} ..
make VERBOSE=1 -j${BUILD_CONCURRENCY} ${make_targets}
ctest --timeout ${TEST_TIMEOUT} --output-on-failure ${ctest_flags}
- name: Distributed Ranges testing
dr-testing:
name: Run DR shp-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build docker image
run: docker build . -t dr-test -f .github/Dockerfile
- name: Run tests
run: |
cd ..
docker build . -t dr-test -f .github/Dockerfile
docker run --name dr-test -d -v $(pwd):/repo dr-test sh -c "cd repo & cmake --build build --target run-dr-tests"
set -e
docker run --name dr-test -d -v $(pwd):/repo dr-test sh -c "
cd repo &&
mkdir build &&
cd build &&
cmake -DCMAKE_CXX_STANDARD=23 -DCMAKE_CXX_COMPILER=icpx -DONEDPL_BACKEND=dpcpp -DCMAKE_BUILD_TYPE=Release .. &&
cmake --build . --target shp-all-tests -j${nproc} &&
ctest --test-dir . -L SHP -j 4"
docker logs -f dr-test
docker wait dr-test
exit_code=$(docker inspect dr-test --format='{{.State.ExitCode}}')
docker rm -f dr-test
exit $exit_code
linux-pstl-offload-testing:
name: PSTL offload ${{ matrix.device_type }},bknd=dpcpp,cmplr=${{ matrix.cxx_compiler }},${{ matrix.os }},std=с++${{ matrix.std }},cfg=${{ matrix.build_type }}
Expand Down
11 changes: 4 additions & 7 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,9 @@ endif()
add_custom_target(build-onedpl-tests
COMMENT "Build all oneDPL tests")

if (ONEDPL_USE_DR)
# shp-tests and shp-tests-3 are built in docker - removed from here for now
set(run-onedpl-tests-depends build-onedpl-tests)
else()
set(run-onedpl-tests-depends build-onedpl-tests)
endif()
set(run-onedpl-tests-depends build-onedpl-tests)

option(DR_DOCKER "Build shp DR tests with Docker" OFF)

add_custom_target(run-onedpl-tests
COMMAND "${CMAKE_CTEST_COMMAND}" --output-on-failure
Expand Down Expand Up @@ -254,7 +251,7 @@ foreach (_file IN LISTS UNIT_TESTS)

endforeach()

if (ONEDPL_USE_DR)
if (ONEDPL_USE_DR AND DR_DOCKER)
add_custom_target(build-dr-tests COMMENT "Build dr tests" DEPENDS shp-tests shp-tests-3)
# run in docker
add_custom_target(run-dr-tests COMMENT "Run dr tests" DEPENDS build-dr-tests COMMAND ./distributed-ranges/shp/shp-tests ./distributed-ranges/shp/shp-tests-3)
Expand Down

0 comments on commit 46dc5dd

Please sign in to comment.