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 Morpheus to Use SRF 22.06 #152

Merged
27 commits merged into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
880c390
Pre-commit with reformatting changes
mdemoret-nv May 31, 2022
0ffd658
Compilation blocked by missing Tensor class
mdemoret-nv May 31, 2022
1c89d12
Merge branch 'branch-22.06' into mdd_neo-ryan_staging
mdemoret-nv May 31, 2022
8f77809
Run slow not working but all other tests are.
mdemoret-nv May 31, 2022
5217d0f
Test configuration
mdemoret-nv Jun 2, 2022
bfe4ed5
Neo->SRF rename
mdemoret-nv Jun 8, 2022
2873fce
Remove the neos and neom imports
mdemoret-nv Jun 8, 2022
caf218f
Style cleanup
mdemoret-nv Jun 8, 2022
7e791e6
Allowing SRF to be built from Git again
mdemoret-nv Jun 8, 2022
cd018d0
Removing remaining code to build SRF conda packages which is now unne…
mdemoret-nv Jun 13, 2022
20e9328
Merge branch 'branch-22.06' into mdd_use-srf-22.06
mdemoret-nv Jun 13, 2022
fe009e0
Merge branch 'branch-22.06' into mdd_use-srf-22.06
mdemoret-nv Jun 13, 2022
be7049b
Chaning SRF git url to https
mdemoret-nv Jun 14, 2022
c3062a9
Updating package versions to match SRF
mdemoret-nv Jun 14, 2022
35eefb1
Added the Morpheus repo, not SRF
mdemoret-nv Jun 14, 2022
4f2e2b4
Fixing some merges that still referenced neo
mdemoret-nv Jun 14, 2022
b955bb3
Style cleanup.
mdemoret-nv Jun 14, 2022
26684de
Merge branch 'branch-22.06' into mdd_use-srf-22.06
pdmack Jun 15, 2022
05c5782
Incorporating feedback
mdemoret-nv Jun 17, 2022
66ba20e
Renaming all `srf.Builder` to `builder`
mdemoret-nv Jun 17, 2022
d8465a9
Renaming all `srf.Observable` to `obs` and all `srf.Subscriber` to `sub`
mdemoret-nv Jun 17, 2022
d663206
Missed renames
mdemoret-nv Jun 17, 2022
811eb9d
Cleaning up docs and style
mdemoret-nv Jun 17, 2022
9685b59
Update the test_build_single to get coverage over the _build_single f…
dagardner-nv Jun 17, 2022
e8c5ef6
Merge pull request #1 from dagardner-nv/mdd_use-srf-22.06
mdemoret-nv Jun 17, 2022
5e381fe
Merge branch 'branch-22.06' into mdd_use-srf-22.06
mdemoret-nv Jun 21, 2022
6b4015f
Changing `create_consumer` to use `RdKafka::RebalanceCb` to avoid the…
mdemoret-nv Jun 21, 2022
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 .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Checks: -*,readability-identifier-naming,modernize-*,-modernize-use-trailing-return-type,-modernize-use-nodiscard,google-readability-todo

#WarningsAsErrors: '*'
HeaderFilterRegex: '.*\/include\/trtlab\/neo\/.*'
HeaderFilterRegex: '.*\/include\/morpheus\/.*'
AnalyzeTemporaryDtors: false
FormatStyle: file
CheckOptions:
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-allow-list=neo,morpheus._lib
extension-pkg-allow-list=srf,morpheus._lib

# Specify a score threshold to be exceeded before program exits with error.
fail-under=10
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,4 @@ Ex:

## Attribution
Portions adopted from https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md \
Portions adopted from https://github.com/dask/dask/blob/master/docs/source/develop.rst
Portions adopted from https://github.com/dask/dask/blob/master/docs/source/develop.rst
4 changes: 2 additions & 2 deletions ci/conda/recipes/morpheus/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ outputs:
- cudf {{ rapids_version }}
- cython >=0.29,<0.30
- librdkafka=1.6.1
- neo {{ minor_version }}.*
- srf {{ minor_version }}.*
- ninja
- pip
- python {{ python }}
Expand Down Expand Up @@ -89,7 +89,7 @@ outputs:
- cudf {{ rapids_version }}
- cython >=0.29,<0.30
- librdkafka=1.6.1
- neo {{ minor_version }}
- srf {{ minor_version }}
- pip
- pybind11-stubgen
- python {{ python }}
Expand Down
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 @@ -23,7 +23,7 @@ CMAKE_ARGS=${CMAKE_ARGS:-""}
export CCACHE_BASEDIR=$(realpath ${SRC_DIR}/..)
export USE_SCCACHE=${USE_SCCACHE:-""}

# Check for some neo environment variables. Append to front of args to allow users to overwrite them
# Check for some srf environment variables. Append to front of args to allow users to overwrite them
if [[ -n "${MORPHEUS_CACHE_DIR}" ]]; then
# Set the cache variable, then set the Staging prefix to allow for host searching
CMAKE_ARGS="-DMORPHEUS_CACHE_DIR=${MORPHEUS_CACHE_DIR} ${CMAKE_ARGS}"
Expand Down
39 changes: 1 addition & 38 deletions ci/conda/recipes/run_conda_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ export CONDA_COMMAND=${CONDA_COMMAND:-"mambabuild"}
# Get the path to the morpheus git folder
export MORPHEUS_ROOT=${MORPHEUS_ROOT:-$(git rev-parse --show-toplevel)}

# Set the tag for the neo commit to use
export NEO_GIT_TAG=${NEO_GIT_TAG:-"5b55e37c6320c1a5747311a1e29e7ebb049d12bc"}

# Set CONDA_CHANNEL_ALIAS to mimic the conda config channel_alias property during the build
CONDA_CHANNEL_ALIAS=${CONDA_CHANNEL_ALIAS:-""}
export USE_SCCACHE=${USE_SCCACHE:-""}
Expand All @@ -46,7 +43,6 @@ export PYTHON_VER="$(python -c "import sys; print('.'.join(map(str, sys.version_
export CUDA=11.4.1
echo "CUDA : ${CUDA}"
echo "PYTHON_VER : ${PYTHON_VER}"
echo "NEO_GIT_TAG : ${NEO_GIT_TAG}"
echo ""

export CMAKE_GENERATOR="Ninja"
Expand Down Expand Up @@ -94,42 +90,9 @@ CONDA_ARGS_ARRAY+=("-c" "${CONDA_CHANNEL_ALIAS:+"${CONDA_CHANNEL_ALIAS%/}/"}nvid
CONDA_ARGS_ARRAY+=("-c" "${CONDA_CHANNEL_ALIAS:+"${CONDA_CHANNEL_ALIAS%/}/"}nvidia/label/dev")
CONDA_ARGS_ARRAY+=("-c" "conda-forge")

if hasArg libneo; then

export NEO_ROOT="${MORPHEUS_CACHE_DIR}/src_cache/libneo"
export NEO_CACHE_DIR=${MORPHEUS_CACHE_DIR}

# First need to download the repo into the cache
if [[ ! -d "${NEO_ROOT}" ]]; then
git clone ${NEO_GIT_URL:?"Cannot build libneo. Must set NEO_GIT_URL to git repo location to allow checkout of neo repository"} ${NEO_ROOT}
fi

pushd ${NEO_ROOT}

# Ensure we have the latest checkout
git fetch
git checkout ${NEO_GIT_TAG}

if [[ "$(git branch --show-current | wc -l)" == "1" ]]; then
git pull
fi

# Set GIT_VERSION to set the project version inside of meta.yaml
export GIT_VERSION="$(get_version)"

echo "Running conda-build for libneo..."
set -x
conda ${CONDA_COMMAND} "${CONDA_ARGS_ARRAY[@]}" ${CONDA_ARGS} ci/conda/recipes/libneo
set +x

unset GIT_DESCRIBE_TAG

popd
fi

if hasArg morpheus; then
# Set GIT_VERSION to set the project version inside of meta.yaml
# Do this after neo in case they are different
# Do this after srf in case they are different
export GIT_VERSION="$(get_version)"

echo "Running conda-build for morpheus..."
Expand Down
14 changes: 7 additions & 7 deletions ci/iwyu/mappings.imp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[

## Include mappings
# neo protos
{ "include": [ "\"neo/protos/architect.pb.h\"", private, "<neo/protos/architect.pb.h>", "public" ] },
{ "include": [ "\"neo/protos/codable.pb.h\"", private, "<neo/protos/codable.pb.h>", "public" ] },
{ "include": [ "\"neo/protos/remote_descriptor.pb.h\"", private, "<neo/protos/remote_descriptor.pb.h>", "public" ] },
{ "include": [ "\"neo/protos/tensor_meta_data.pb.h\"", private, "<neo/protos/tensor_meta_data.pb.h>", "public" ] },
# srf protos
{ "include": [ "\"srf/protos/architect.pb.h\"", private, "<srf/protos/architect.pb.h>", "public" ] },
{ "include": [ "\"srf/protos/codable.pb.h\"", private, "<srf/protos/codable.pb.h>", "public" ] },
{ "include": [ "\"srf/protos/remote_descriptor.pb.h\"", private, "<srf/protos/remote_descriptor.pb.h>", "public" ] },
{ "include": [ "\"srf/protos/tensor_meta_data.pb.h\"", private, "<srf/protos/tensor_meta_data.pb.h>", "public" ] },

# stdlib
{ "include": [ "<bits/cxxabi_forced.h>", private, "<mutex>", "public" ] },
Expand Down Expand Up @@ -87,7 +87,7 @@
# xtensor
{ "symbol": ["xt::no_ownership", "private", "<xtensor/xadapt.hpp>", "public"] },

# neo
{ "symbol": ["std::__decay_and_strip<std::shared_ptr<neo::TraceStatistics> &>::__type" , "private", "<neo/benchmarking/trace_statistics.hpp>", "public"] },
# srf
{ "symbol": ["std::__decay_and_strip<std::shared_ptr<srf::TraceStatistics> &>::__type" , "private", "<srf/benchmarking/trace_statistics.hpp>", "public"] },

]
6 changes: 3 additions & 3 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ include(deps/Configure_pybind11)
set(RDKAFKA_VERSION 1.6.2)
include(deps/Configure_rdkafka)

# NEO (Should come after all third party but before NVIDIA repos)
# SRF (Should come after all third party but before NVIDIA repos)
# =====
set(NEO_VERSION 22.04 CACHE STRING "Which version of Neo to use")
include(deps/Configure_neo)
set(SRF_VERSION 22.06 CACHE STRING "Which version of SRF to use")
include(deps/Configure_srf)

# CuDF
# =====
Expand Down
89 changes: 0 additions & 89 deletions cmake/deps/Configure_neo.cmake

This file was deleted.

75 changes: 75 additions & 0 deletions cmake/deps/Configure_srf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#=============================================================================
# Copyright (c) 2020-2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================

function(find_and_configure_srf version)

list(APPEND CMAKE_MESSAGE_CONTEXT "srf")

rapids_cpm_find(srf ${version}
GLOBAL_TARGETS
srf::srf srf::pysrf
BUILD_EXPORT_SET
${PROJECT_NAME}-exports
INSTALL_EXPORT_SET
${PROJECT_NAME}-exports
CPM_ARGS
GIT_REPOSITORY https://github.com/nv-morpheus/SRF.git
GIT_TAG branch-${version}
GIT_SHALLOW TRUE
OPTIONS "SRF_BUILD_EXAMPLES OFF"
"SRF_BUILD_TESTS OFF"
"SRF_BUILD_BENCHMARKS OFF"
"SRF_BUILD_PYTHON ON"
"SRF_ENABLE_XTENSOR ON"
"SRF_ENABLE_MATX ON"
"SRF_USE_CONDA ${MORPHEUS_USE_CONDA}"
"SRF_USE_CCACHE ${MORPHEUS_USE_CCACHE}"
"SRF_USE_CLANG_TIDY ${MORPHEUS_USE_CLANG_TIDY}"
"SRF_PYTHON_INPLACE_BUILD ${MORPHEUS_PYTHON_INPLACE_BUILD}"
"RMM_VERSION ${RAPIDS_VERSION}"
)

if(srf_ADDED)

# Now ensure its installed
find_package(Python3 COMPONENTS Interpreter REQUIRED)

# detect virtualenv and set Pip args accordingly
if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX})
set(_pip_args)
else()
set(_pip_args "--user")
endif()

if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
list(APPEND _pip_args "-e")
endif()

add_custom_command(
OUTPUT ${srf_BINARY_DIR}/python/srf.egg-info/PKG-INFO
COMMAND ${Python3_EXECUTABLE} -m pip install ${_pip_args} ${srf_BINARY_DIR}/python
DEPENDS srf_python_rebuild
COMMENT "Installing srf python package"
)

add_custom_target(
install_srf_python ALL
DEPENDS ${srf_BINARY_DIR}/python/srf.egg-info/PKG-INFO
)
endif()
endfunction()

find_and_configure_srf(${SRF_VERSION})
32 changes: 0 additions & 32 deletions docker/build_conda_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,6 @@ CONDA_ARGS+=("--skip-existing")

DOCKER_EXTRA_ARGS=()

if hasArg libneo; then
# If libneo is specified, you must set NEO_GIT_URL
DOCKER_EXTRA_ARGS+=("--env" "NEO_GIT_URL=${NEO_GIT_URL:?"Cannot build libneo. Must set NEO_GIT_URL to git repo location to allow checkout of neo repository"}")

url=${NEO_GIT_URL}

# Remove the http/https/ssh
url="${url#http://}"
url="${url#https://}"
url="${url#ssh://}"

# Remove git@
url="${url#git@}"

# Remove username/password
url="${url#*:*@}"
url="${url#*@}"

# Remove remaining
url=${url%%/*}

port=${url##*:}
url=${url%%:*}

# Add the command to auto accept this url/port combo
if [[ -n "${port}" ]]; then
BUILD_SCRIPT="${BUILD_SCRIPT:+${BUILD_SCRIPT}\n}mkdir -p \$HOME/.ssh && ssh-keyscan -t rsa -p ${port} ${url} > ~/.ssh/known_hosts"
else
BUILD_SCRIPT="${BUILD_SCRIPT:+${BUILD_SCRIPT}\n}mkdir -p \$HOME/.ssh && ssh-keyscan -t rsa ${url} > ~/.ssh/known_hosts"
fi
fi

# Build the script to execute inside of the container (needed to set multiple statements in CONDA_ARGS)
BUILD_SCRIPT="${BUILD_SCRIPT}
export CONDA_ARGS=\"${CONDA_ARGS[@]}\"
Expand Down
10 changes: 5 additions & 5 deletions docker/conda/environments/cuda11.5_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: morpheus
channels:
- rapidsai
- nvidia
- nvidia/label/dev # For pre-releases of Neo. Should still default to full releases if available
- nvidia/label/dev # For pre-releases of SRF. Should still default to full releases if available
- nvidia/label/cuda-11.5.2 # For cuda-nvml-dev=11.5, which is not published under nvidia channel yet.
- conda-forge
dependencies:
Expand All @@ -42,21 +42,21 @@ dependencies:
- gcc_linux-64=9.4
- gflags=2.2
- git>=2.35.3 # Needed for wildcards on safe.directory
- glog=0.5
- glog=0.6
- gmock=1.10
- grpc-cpp>=1.43
- gtest=1.10
- gxx_linux-64=9.4
- isort
- mlflow>=1.23
- myst-parser==0.17
- neo 22.04.*
- srf 22.06.*
- ninja=1.10
- nodejs=17.4.0
- pandas=1.3
- pip
- pkg-config # for neo cmake
- protobuf=3.19
- pkg-config # for srf cmake
- protobuf=3.20
- pybind11-stubgen
- pydot
- pytest
Expand Down
Loading