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

Morpheus changes related to utility consolidation #531

Merged
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
b2a976f
Start new update branch
drobison00 Dec 2, 2022
22d63fb
Checkpoint
drobison00 Dec 2, 2022
3aead15
Checkpoint
drobison00 Dec 2, 2022
da9cf59
Checkpoint
drobison00 Dec 2, 2022
3cfe2b9
Baseline conversion to utilities lib works
drobison00 Dec 2, 2022
99048ea
Checkpoint - transitioning morpheus _libs
drobison00 Dec 2, 2022
71493e2
More file consolidation
drobison00 Dec 2, 2022
12f0033
SRF->MRC changes compiling -- still some python errors
drobison00 Dec 6, 2022
4e034ac
Additional SRF->MRC conversions
drobison00 Dec 6, 2022
6d5e221
Add MRC config -- currently working if we install mrc directly and bu…
drobison00 Dec 7, 2022
81afaa0
Merge utilities updates
drobison00 Dec 7, 2022
6ee23e6
Update to use submodules
drobison00 Dec 8, 2022
d59e28d
Remove local cmake Configure
drobison00 Dec 8, 2022
a983414
Fix modules path
drobison00 Dec 8, 2022
bf953f4
Merge branch 'branch-23.01' into devin_issue_496_mrc_refactor
drobison00 Dec 9, 2022
d4dc62b
Build updates
drobison00 Dec 12, 2022
31fe7a5
Merge MRC migration base
drobison00 Dec 12, 2022
edfdea1
Update utilities repo tag, cleanup cmakelists
drobison00 Dec 12, 2022
1c55054
Consolidate scripts
drobison00 Dec 13, 2022
6e93745
Migrate more common scripts to utilities
drobison00 Dec 13, 2022
dabb100
Updates for final merge PR
drobison00 Dec 13, 2022
b91165e
Updates for final merge PR
drobison00 Dec 13, 2022
e60f5b9
Updates for final merge PR
drobison00 Dec 13, 2022
1cd0f04
Merge branch 'branch-23.01' into devin_issue_496_mrc_refactor
drobison00 Dec 13, 2022
1168775
Merge with mrc migration branch
drobison00 Dec 13, 2022
a6c885f
Update utilities
drobison00 Dec 13, 2022
b38058f
Formatting fixes
drobison00 Dec 13, 2022
c40ac86
Merge branch 'devin_issue_496_mrc_refactor' into devin_issue_87_mrc_r…
drobison00 Dec 13, 2022
7597924
Merge with branch-23.01
drobison00 Dec 13, 2022
918b5ab
Merge branch 'devin_issue_496_mrc_refactor' into devin_issue_87_mrc_r…
drobison00 Dec 13, 2022
d088828
Update external utils
drobison00 Dec 13, 2022
c419486
Update formatting
drobison00 Dec 13, 2022
e48d745
Merge branch 'devin_issue_496_mrc_refactor' into devin_issue_87_mrc_r…
drobison00 Dec 13, 2022
9293171
Formatting fixes
drobison00 Dec 14, 2022
ecdb6b7
Merge branch 'branch-23.01' into devin_issue_496_mrc_refactor
drobison00 Dec 14, 2022
88df477
Merge branch 'devin_issue_496_mrc_refactor' into devin_issue_87_mrc_r…
drobison00 Dec 14, 2022
a3f25f8
Bump utilities repo, add cmake debugging flags
drobison00 Dec 14, 2022
3dba9fb
Bump utilities version
drobison00 Dec 14, 2022
de12859
Syncing MRC and Morpheus .clang-format
mdemoret-nv Dec 14, 2022
649daec
Update CONTRIBUTING.md
drobison00 Dec 14, 2022
181ce01
Merge latest 23.01
drobison00 Dec 16, 2022
66514f5
Bump utilities repo version
drobison00 Dec 16, 2022
99196c6
Update CMakeLists.txt
drobison00 Dec 17, 2022
77703a0
PR feedback updates, utilitis repo bump
drobison00 Dec 17, 2022
ad4c3f4
Migrate a few more files to utilities, bump utils repo version
drobison00 Dec 19, 2022
e826167
Docs update
drobison00 Dec 19, 2022
690cb0d
Roll back Sphinx deps as default cuda11.5 environment deps
drobison00 Dec 20, 2022
e0760cb
Update morpheus to use new package creation code, bump utilities version
drobison00 Dec 20, 2022
4694c12
Update git modules versions
drobison00 Dec 20, 2022
8665f04
Bump utils repo version
drobison00 Dec 20, 2022
758426e
Merge branch 'branch-23.01' into devin_issue_87_mrc_rebase_branch
drobison00 Jan 6, 2023
6b13a4b
Merge with branch-23.01, bump utilities version
drobison00 Jan 6, 2023
498b85c
Roll to utilities branch 23.01
drobison00 Jan 6, 2023
7ddd8e6
Formatting fixes
drobison00 Jan 6, 2023
2de7319
Merge 23.01
drobison00 Jan 17, 2023
82e71bd
Update build scripts to update and initialize sub-repos
drobison00 Jan 17, 2023
80dbc8e
Update setup.py to ignore flake8 E402 errors
drobison00 Jan 17, 2023
ac0b506
Build fix
drobison00 Jan 17, 2023
31cf9c8
Formatting fix
drobison00 Jan 17, 2023
ba1fe2b
Update CI to default to cuda arch all
drobison00 Jan 17, 2023
396c06e
Add subset of compute caps to build for in CI
drobison00 Jan 17, 2023
9a236e2
CI tweak
drobison00 Jan 17, 2023
b8c0943
Merge branch-23.01
drobison00 Jan 23, 2023
94f0a54
Update utilities for build_wheel fix, and add Morpheus option for CI …
drobison00 Jan 24, 2023
77633ad
more dist updates
drobison00 Jan 24, 2023
dec6d6c
Merge branch 'branch-23.01' into devin_issue_87_mrc_rebase_branch
drobison00 Jan 24, 2023
dfc1933
Tweak CI morpheus wheel installation
drobison00 Jan 24, 2023
27d0bac
Fix python install to include morpheus testing data
drobison00 Jan 24, 2023
a528e02
Update submodule url to be portable across forks
drobison00 Jan 24, 2023
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ body:
id: env-printout
attributes:
label: Full env printout
description: Please run and paste the output of the `./scripts/print_env.sh` script here, to gather any other relevant environment details
description: Please run and paste the output of the `./external/utilities/scripts/print_env.sh` script here, to gather any other relevant environment details
render: shell

- type: textarea
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
path = external/morpheus-visualizations
url = https://github.com/nv-morpheus/morpheus-visualizations.git
branch = branch-22.11
[submodule "morpheus_utils"]
path = external/utilities
url = ../utilities.git
drobison00 marked this conversation as resolved.
Show resolved Hide resolved
branch = branch-23.01
151 changes: 81 additions & 70 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ option(MORPHEUS_BUILD_BENCHMARKS "Whether or not to build benchmarks" OFF)
option(MORPHEUS_BUILD_EXAMPLES "Whether or not to build examples" OFF)
option(MORPHEUS_BUILD_TESTS "Whether or not to build tests" OFF)
option(MORPHEUS_BUILD_PYTHON_STUBS "Whether or not to generated .pyi stub files for C++ Python modules. Disable to avoid requiring loading the NVIDIA GPU Driver during build" ON)
option(MORPHEUS_ENABLE_DEBUG_INFO "Enable printing debug information" OFF)
option(MORPHEUS_USE_CCACHE "Enable caching compilation results with ccache" OFF)
option(MORPHEUS_USE_CLANG_TIDY "Enable running clang-tidy as part of the build process" OFF)
option(MORPHEUS_USE_CONDA "Enables finding dependencies via conda instead of vcpkg.
Expand All @@ -33,6 +34,7 @@ option(MORPHEUS_USE_IWYU "Enable running include-what-you-use as part of the bui
option(MORPHEUS_BUILD_DOCS "Enable building of API documentation" OFF)
set(MORPHEUS_PY_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/wheel" CACHE STRING "Location to install the python directory")

set(MORPHEUS_RAPIDS_CMAKE_VERSION "22.08" CACHE STRING "Sets default versions for RAPIDS CMake.")
set(MORPHEUS_CACHE_DIR "${CMAKE_SOURCE_DIR}/.cache" CACHE PATH "Directory to contain all CPM and CCache data")
mark_as_advanced(MORPHEUS_CACHE_DIR)

Expand All @@ -46,37 +48,65 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN")

enable_testing()

# CMake path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/cmake")
if (MORPHEUS_USE_IWYU AND MORPHEUS_USE_CCACHE)
message(FATAL_ERROR "MORPHEUS_USE_IWYU and MORPHEUS_USE_CCACHE cannot be set simultaneously")
endif()

# Add the RAPIDS cmake helper scripts
include(import-rapids-cmake)
# MRC CMake path and module extensions
set(MORPHEUS_CMAKE_MODULE_PATH_EXTENSIONS
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/external/utilities/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/external/utilities/cmake/morpheus_utils/package_search"
)

set(MORPHEUS_CMAKE_PREFIX_PATH_EXTENSIONS
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)

# Prepend path and prefix updates so they take priority in this scope.
list(PREPEND CMAKE_MODULE_PATH "${MORPHEUS_CMAKE_MODULE_PATH_EXTENSIONS}")
list(PREPEND CMAKE_PREFIX_PATH "${MORPHEUS_CMAKE_PREFIX_PATH_EXTENSIONS}")

# Load morpheus utils and update CMake paths
set(MORPHEUS_UTILS_RAPIDS_CMAKE_VERSION ${MORPHEUS_RAPIDS_CMAKE_VERSION})
include(morpheus_utils/load)

# Configure project package manager
morpheus_utils_initialize_package_manager(
MORPHEUS_USE_CONDA
BUILD_SHARED_LIBS
)

# Configure CUDA architecture
include(configure_cuda_architecture)
# NOTE: This MUST occur before any 'project' calls because of rapids_cmake requirements.
if (DEFINED MORPHEUS_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES "${MORPHEUS_CUDA_ARCHITECTURES}")
endif()

morpheus_utils_initialize_cuda_arch(morpheus)

# Set a default build type if none was specified
rapids_cmake_build_type(Release)

# Toolchain selection (Conda/VCPKG/custom) and configuration
include(cmake/configure_toolchain.cmake)

# Project definition
project(morpheus LANGUAGES C CXX CUDA)
project(morpheus
VERSION 23.01.00
LANGUAGES C CXX CUDA)

rapids_cmake_write_version_file(${CMAKE_BINARY_DIR}/autogenerated/include/mrc/version.hpp)

# Ccache configuration
include(setup_cache)
include(environment/init_ccache)

# Configure all dependencies
include(cmake/dependencies.cmake)
include(dependencies)

####################################
# - Post dependencies setup --------
include(cmake/setup_compiler.cmake)
morpheus_utils_compiler_set_defaults(MORPHEUS_USE_CLANG_TIDY)

# Setup IWYU if enabled
include(cmake/setup_iwyu.cmake)
include(environment/init_iwyu)

# To make it easier for CI to find output files, set the default executable suffix to .x if not set
if("${CMAKE_EXECUTABLE_SUFFIX}" STREQUAL "")
Expand All @@ -94,8 +124,26 @@ add_custom_target(${PROJECT_NAME}_style_checks
)

# Include the main morpheus code
morpheus_utils_create_python_package(morpheus
PROJECT_DIRECTORY "${CMAKE_SOURCE_DIR}"
SOURCE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/morpheus"
)

add_subdirectory(morpheus)

# Complete the python package
set(extra_args "")

if(MORPHEUS_PYTHON_INPLACE_BUILD)
list(APPEND extra_args "IS_INPLACE")
endif()

if(MORPHEUS_PYTHON_PERFORM_INSTALL)
list(APPEND extra_args "INSTALL_WHEEL")
endif()

morpheus_utils_build_python_package(morpheus ${extra_args})

if(MORPHEUS_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
Expand All @@ -104,64 +152,27 @@ if(MORPHEUS_BUILD_DOCS)
add_subdirectory(docs)
endif()

# Get all of the python files to copy to the build directory
file(GLOB_RECURSE MORPHEUS_PYTHON_FILES
RELATIVE ${PROJECT_SOURCE_DIR}
LIST_DIRECTORIES FALSE
CONFIGURE_DEPENDS
"morpheus/*.py"
"morpheus/py.typed"
)

set(MORPHEUS_ROOT_PYTHON_FILES
"pyproject.toml"
"setup.cfg"
"setup.py"
"versioneer.py"
"MANIFEST.in"
)

# Add the root python files to the list
list(PREPEND MORPHEUS_PYTHON_FILES ${MORPHEUS_ROOT_PYTHON_FILES})

set(OUTPUT_PYTHON_FILES "")

# For each file, copy if its different
foreach(py_file ${MORPHEUS_PYTHON_FILES})

add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/${py_file}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/${py_file} ${PROJECT_BINARY_DIR}/${py_file}
DEPENDS ${PROJECT_SOURCE_DIR}/${py_file}
COMMENT "Copying ${py_file} to ${PROJECT_BINARY_DIR}/${py_file}"
if(MORPHEUS_ENABLE_DEBUG_INFO)
morpheus_utils_print_all_targets()

morpheus_utils_print_target_properties(
TARGETS
cuda_utils
morpheus
stages
messages
common
file_types
WRITE_TO_FILE
)

list(APPEND OUTPUT_PYTHON_FILES ${PROJECT_BINARY_DIR}/${py_file})

endforeach()

add_custom_target(copy_python_source ALL
DEPENDS ${OUTPUT_PYTHON_FILES}
)

# Manually install the below files. install(DIRECTORY) doesn't work well and
# makes it impossible to get these files and MORPHEUS_PYTHON_FILES in one command.
install(
FILES ${MORPHEUS_ROOT_PYTHON_FILES}
DESTINATION ${MORPHEUS_PY_INSTALL_DIR}
COMPONENT Wheel
)

# Use the install(DIRECTORY) to keep the files tructure
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/morpheus
DESTINATION ${MORPHEUS_PY_INSTALL_DIR}
COMPONENT Wheel
FILES_MATCHING
PATTERN "*.py"
PATTERN "py.typed"
PATTERN "data/*"
)
morpheus_utils_print_global_properties(
WRITE_TO_FILE
)
endif()

# Cleanup the environment after we exit this scope
list(REMOVE_ITEM CMAKE_PREFIX_PATH "${MORPHEUS_CMAKE_PREFIX_PATH_EXTENSIONS}")
list(REMOVE_ITEM CMAKE_MODULE_PATH "${MORPHEUS_CMAKE_MODULE_PATH_EXTENSIONS}")

list(POP_BACK CMAKE_MESSAGE_CONTEXT)
5 changes: 3 additions & 2 deletions ci/conda/recipes/morpheus/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
# limitations under the License.

c_compiler_version:
- 9.4
- 11.2

cxx_compiler_version:
- 9.4
- 11.2

cuda_compiler:
- nvcc
Expand All @@ -34,3 +34,4 @@ boost:

rapids_version:
- 22.08
- 22.10
2 changes: 1 addition & 1 deletion ci/conda/recipes/morpheus/morpheus_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CMAKE_ARGS="-DMORPHEUS_USE_CONDA=ON ${CMAKE_ARGS}"
CMAKE_ARGS="-DMORPHEUS_USE_CCACHE=ON ${CMAKE_ARGS}"
CMAKE_ARGS="-DMORPHEUS_BUILD_PYTHON_STUBS=${MORPHEUS_BUILD_PYTHON_STUBS=-"ON"} ${CMAKE_ARGS}"
CMAKE_ARGS="-DMORPHEUS_PYTHON_INPLACE_BUILD=ON ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES=-"ALL"} ${CMAKE_ARGS}"
CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES=-"all"} ${CMAKE_ARGS}"
CMAKE_ARGS="-DPython_EXECUTABLE=${PYTHON} ${CMAKE_ARGS}"

if [[ "${USE_SCCACHE}" == "1" ]]; then
Expand Down
8 changes: 8 additions & 0 deletions ci/conda/recipes/run_conda_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ function get_version() {
echo "$(git describe --tags | grep -o -E '^([^-]*?)')"
}

# Color variables
export b="\033[0;36m"
export g="\033[0;32m"
export r="\033[0;31m"
export e="\033[0;90m"
export y="\033[0;33m"
export x="\033[0m"

# Change this to switch between build/mambabuild/debug
export CONDA_COMMAND=${CONDA_COMMAND:-"mambabuild"}

Expand Down
43 changes: 0 additions & 43 deletions ci/runner/README.md

This file was deleted.

48 changes: 0 additions & 48 deletions ci/runner/build_and_push.sh

This file was deleted.

1 change: 1 addition & 0 deletions ci/scripts/github/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ cmake --version
ninja --version

rapids-logger "Configuring cmake for Morpheus"
git submodule update --init --recursive
cmake -B build -G Ninja ${CMAKE_BUILD_ALL_FEATURES} \
-DCCACHE_PROGRAM_PATH=$(which sccache) \
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON .
Expand Down
2 changes: 2 additions & 0 deletions ci/scripts/github/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ python ${MORPHEUS_ROOT}/ci/scripts/copyright.py --verify-apache-v2 --git-diff-co
rapids-logger "Runing Python style checks"
${MORPHEUS_ROOT}/ci/scripts/python_checks.sh

git submodule update --init --recursive

rapids-logger "Configuring cmake for Morpheus"
cmake -B build -G Ninja ${CMAKE_BUILD_ALL_FEATURES} -DCCACHE_PROGRAM_PATH=$(which sccache) .

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/github/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export SCCACHE_REGION="${AWS_DEFAULT_REGION}"
export SCCACHE_IDLE_TIMEOUT=32768
#export SCCACHE_LOG=debug

export CMAKE_BUILD_ALL_FEATURES="-DCMAKE_MESSAGE_CONTEXT_SHOW=ON -DMORPHEUS_BUILD_BENCHMARKS=ON -DMORPHEUS_BUILD_EXAMPLES=ON -DMORPHEUS_BUILD_TESTS=ON -DMORPHEUS_USE_CONDA=ON -DMORPHEUS_PYTHON_INPLACE_BUILD=OFF -DMORPHEUS_BUILD_PYTHON_STUBS=ON -DMORPHEUS_USE_CCACHE=ON"
export CMAKE_BUILD_ALL_FEATURES="-DCMAKE_MESSAGE_CONTEXT_SHOW=ON -DMORPHEUS_CUDA_ARCHITECTURES=60;70;75;80 -DMORPHEUS_BUILD_BENCHMARKS=ON -DMORPHEUS_BUILD_EXAMPLES=ON -DMORPHEUS_BUILD_TESTS=ON -DMORPHEUS_USE_CONDA=ON -DMORPHEUS_PYTHON_INPLACE_BUILD=OFF -DMORPHEUS_BUILD_PYTHON_STUBS=ON -DMORPHEUS_USE_CCACHE=ON"
drobison00 marked this conversation as resolved.
Show resolved Hide resolved

export FETCH_STATUS=0

Expand Down
2 changes: 2 additions & 0 deletions ci/scripts/github/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ ${MORPHEUS_ROOT}/scripts/fetch_data.py fetch docs examples
rapids-logger "Installing Documentation dependencies"
mamba env update -f ${MORPHEUS_ROOT}/docs/conda_docs.yml

git submodule update --init --recursive

rapids-logger "Configuring for docs"
cmake -B build -G Ninja ${CMAKE_BUILD_ALL_FEATURES} -DMORPHEUS_BUILD_DOCS=ON .

Expand Down
Loading