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

Update packages (pybind11 and catch2) and do not use nvidia-docker command #618

Merged
merged 5 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
7 changes: 4 additions & 3 deletions cpp/cmake/deps/catch2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::catch2)
FetchContent_Declare(
deps-catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.1
GIT_TAG v3.4.0
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(deps-catch2)
Expand All @@ -29,8 +29,9 @@ if (NOT TARGET deps::catch2)

add_subdirectory(${deps-catch2_SOURCE_DIR} ${deps-catch2_BINARY_DIR} EXCLUDE_FROM_ALL)

# Include Append catch2's cmake module path so that we can use `include(ParseAndAddCatchTests)`.
list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/contrib")
# Include Append catch2's cmake module path so that we can use `include(Catch)`.
# https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake
list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/extras")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE)

add_library(deps::catch2 INTERFACE IMPORTED GLOBAL)
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake/deps/pybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::pybind11)
FetchContent_Declare(
deps-pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.10.3
GIT_TAG v2.11.1
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(deps-pybind11)
Expand Down
7 changes: 4 additions & 3 deletions cpp/plugins/cucim.kit.cumed/cmake/deps/catch2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::catch2)
FetchContent_Declare(
deps-catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.1
GIT_TAG v3.4.0
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(deps-catch2)
Expand All @@ -29,8 +29,9 @@ if (NOT TARGET deps::catch2)

add_subdirectory(${deps-catch2_SOURCE_DIR} ${deps-catch2_BINARY_DIR} EXCLUDE_FROM_ALL)

# Include Append catch2's cmake module path so that we can use `include(ParseAndAddCatchTests)`.
list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/contrib")
# Include Append catch2's cmake module path so that we can use `include(Catch)`.
# https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake
list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/extras")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE)

add_library(deps::catch2 INTERFACE IMPORTED GLOBAL)
Expand Down
6 changes: 3 additions & 3 deletions cpp/plugins/cucim.kit.cumed/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ target_include_directories(cumed_tests
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../src>
)

include(ParseAndAddCatchTests)
# See https://github.com/catchorg/Catch2/blob/master/docs/cmake-integration.md#parseandaddcatchtestscmake for other options
ParseAndAddCatchTests(cumed_tests)
include(Catch)
# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options
catch_discover_tests(cumed_tests)
7 changes: 4 additions & 3 deletions cpp/plugins/cucim.kit.cumed/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
* limitations under the License.
*/

//#define CATCH_CONFIG_MAIN
//#include <catch2/catch.hpp>
// #define CATCH_CONFIG_MAIN
// #include <catch2/catch_test_macros.hpp>

// Implement main explicitly to handle additional parameters.
#define CATCH_CONFIG_RUNNER
#include "config.h"
#include "cucim/core/framework.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_session.hpp>
#include <string>
#include <fmt/format.h>

Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cumed/tests/test_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "config.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <chrono>

TEST_CASE("Verify file", "[test_basic.cpp]")
Expand Down
7 changes: 4 additions & 3 deletions cpp/plugins/cucim.kit.cuslide/cmake/deps/catch2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::catch2)
FetchContent_Declare(
deps-catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.1
GIT_TAG v3.4.0
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(deps-catch2)
Expand All @@ -29,8 +29,9 @@ if (NOT TARGET deps::catch2)

add_subdirectory(${deps-catch2_SOURCE_DIR} ${deps-catch2_BINARY_DIR} EXCLUDE_FROM_ALL)

# Include Append catch2's cmake module path so that we can use `include(ParseAndAddCatchTests)`.
list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/contrib")
# Include Append catch2's cmake module path so that we can use `include(Catch)`.
# https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake
list(APPEND CMAKE_MODULE_PATH "${deps-catch2_SOURCE_DIR}/extras")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE)

add_library(deps::catch2 INTERFACE IMPORTED GLOBAL)
Expand Down
6 changes: 3 additions & 3 deletions cpp/plugins/cucim.kit.cuslide/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ target_include_directories(cuslide_tests
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../src>
)

include(ParseAndAddCatchTests)
# See https://github.com/catchorg/Catch2/blob/master/docs/cmake-integration.md#parseandaddcatchtestscmake for other options
ParseAndAddCatchTests(cuslide_tests)
include(Catch)
# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options
catch_discover_tests(cuslide_tests)
7 changes: 4 additions & 3 deletions cpp/plugins/cucim.kit.cuslide/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
* limitations under the License.
*/

//#define CATCH_CONFIG_MAIN
//#include <catch2/catch.hpp>
// #define CATCH_CONFIG_MAIN
// #include <catch2/catch_test_macros.hpp>

// Implement main explicitly to handle additional parameters.
#define CATCH_CONFIG_RUNNER
#include "config.h"
#include "cucim/core/framework.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_session.hpp>
#include <string>
#include <fmt/format.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "cuslide/tiff/tiff.h"
#include "config.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <chrono>

TEST_CASE("Verify philips tiff file", "[test_philips_tiff.cpp]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "config.h"

#include <cuda_runtime.h>
#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <fmt/format.h>
#include <cucim/filesystem/cufile_driver.h>
#include <cstdlib>
Expand Down
3 changes: 2 additions & 1 deletion cpp/plugins/cucim.kit.cuslide/tests/test_read_region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

#include <chrono>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators.hpp>
#include <openslide/openslide.h>

#include <cucim/memory/memory_manager.h>
Expand Down
6 changes: 3 additions & 3 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ target_link_libraries(cucim_tests
Threads::Threads # -lpthread
)

include(ParseAndAddCatchTests)
# See https://github.com/catchorg/Catch2/blob/master/docs/cmake-integration.md#parseandaddcatchtestscmake for other options
ParseAndAddCatchTests(cucim_tests)
include(Catch)
# See https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#catchcmake-and-catchaddtestscmake for other options
catch_discover_tests(cucim_tests)
7 changes: 4 additions & 3 deletions cpp/tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
* limitations under the License.
*/

//#define CATCH_CONFIG_MAIN
//#include <catch2/catch.hpp>
// #define CATCH_CONFIG_MAIN
// #include <catch2/catch_test_macros.hpp>

// Implement main explicitly to handle additional parameters.
#define CATCH_CONFIG_RUNNER
#include "config.h"
#include "cucim/core/framework.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <catch2/catch_session.hpp>
#include <string>
#include <fmt/format.h>

Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/test_cufile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "cucim/logger/timer.h"
#include "config.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <fmt/format.h>
#include <cucim/filesystem/cufile_driver.h>
#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/test_metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "cucim/core/framework.h"
#include "cucim/io/format/image_format.h"

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <fmt/format.h>
#include <chrono>
#include <cstdlib>
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/test_read_region.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <chrono>
#include <iostream>

#include <catch2/catch.hpp>
#include <catch2/catch_test_macros.hpp>
#include <cuda_runtime.h>
#include <openslide/openslide.h>

Expand Down
2 changes: 1 addition & 1 deletion dockcross-manylinux2014-x64
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ fi
TTY_ARGS=
tty -s && [ -z "$MSYS" ] && TTY_ARGS=-ti
CONTAINER_NAME=dockcross_$RANDOM
nvidia-docker run $TTY_ARGS --name $CONTAINER_NAME \
docker run --runtime nvidia $TTY_ARGS --name $CONTAINER_NAME \
-v "$HOST_PWD":/work \
$HOST_VOLUMES \
"${USER_IDS[@]}" \
Expand Down
2 changes: 1 addition & 1 deletion notebooks/File-access_Experiments_on_TIFF.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"#include \"cuslide/tiff/tiff.h\"\n",
"#include \"config.h\"\n",
"\n",
"#include <catch2/catch.hpp>\n",
"#include <catch2/catch_test_macros.hpp>\n",
"#include <fmt/format.h>\n",
"#include <cucim/filesystem/cufile_driver.h>\n",
"#include <cstdlib>\n",
Expand Down
2 changes: 1 addition & 1 deletion python/cmake/deps/pybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (NOT TARGET deps::pybind11)
FetchContent_Declare(
deps-pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.10.3
GIT_TAG v2.11.1
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(deps-pybind11)
Expand Down
2 changes: 1 addition & 1 deletion python/cucim/docs/getting_started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ After executing the command, type a password for the instance and open a web bro
```bash
...
Port 10001 would be used...(http://172.26.120.129:10001)
2021-02-13 01:12:44 $ nvidia-docker run --gpus all -it --rm -v /home/repo/cucim/notebooks:/notebooks -p 10001:10001 cucim-jupyter -c echo -n 'Enter New Password: '; jupyter lab --ServerApp.password="$(python3 -u -c "from jupyter_server.auth import passwd;pw=input();print(passwd(pw));" | egrep 'sha|argon')" --ServerApp.root_dir=/notebooks --allow-root --port=10001 --ip=0.0.0.0 --no-browser
2021-02-13 01:12:44 $ docker run --runtime nvidia --gpus all -it --rm -v /home/repo/cucim/notebooks:/notebooks -p 10001:10001 cucim-jupyter -c echo -n 'Enter New Password: '; jupyter lab --ServerApp.password="$(python3 -u -c "from jupyter_server.auth import passwd;pw=input();print(passwd(pw));" | egrep 'sha|argon')" --ServerApp.root_dir=/notebooks --allow-root --port=10001 --ip=0.0.0.0 --no-browser
Enter New Password: <password>
[I 2021-02-13 01:12:47.981 ServerApp] dask_labextension | extension was successfully linked.
[I 2021-02-13 01:12:47.981 ServerApp] jupyter_server_proxy | extension was successfully linked.
Expand Down
4 changes: 2 additions & 2 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -984,14 +984,14 @@ launch_notebooks() {

run_command cp ${TOP}/dist/*.whl ${TOP}/notebooks

run_command nvidia-docker build -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix}-dev ${TOP}
run_command docker build --runtime nvidia -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix}-dev ${TOP}

[ $? -ne 0 ] && return 1

c_echo W "Port " G "$port" W " would be used...(" B "http://$(hostname -I | cut -d' ' -f 1):${port}" W ")"

if [ -z "${gds_postfix}" ]; then
run_command nvidia-docker run --gpus all -it --rm \
run_command docker run --runtime nvidia --gpus all -it --rm \
-v ${TOP}/notebooks:/notebooks \
-p ${port}:${port} \
cucim-jupyter \
Expand Down
4 changes: 2 additions & 2 deletions scripts/run-dist
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,14 @@ launch_notebooks() {

run_command cp ${TOP}/*.whl ${TOP}/notebooks

run_command nvidia-docker build -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix} ${TOP}
run_command docker build --runtime nvidia -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix} ${TOP}

[ $? -ne 0 ] && return 1

c_echo W "Port " G "$port" W " would be used...(" B "http://$(hostname -I | cut -d' ' -f 1):${port}" W ")"

if [ -z "${gds_postfix}" ]; then
run_command nvidia-docker run --gpus all -it --rm \
run_command docker run --runtime nvidia --gpus all -it --rm \
-v ${TOP}/notebooks:/notebooks \
-p ${port}:${port} \
cucim-jupyter \
Expand Down