-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #646 from nv-morpheus/branch-23.01
[RELEASE] Morpheus v23.01
- Loading branch information
Showing
610 changed files
with
49,180 additions
and
10,124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# 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. | ||
|
||
FROM nvidia/cuda:11.5.1-devel-ubuntu20.04 AS base | ||
|
||
RUN apt-get update && \ | ||
apt-get install --no-install-recommends --yes \ | ||
wget git-lfs gdb iputils-ping | ||
|
||
ENV CONDA_DIR=/opt/conda | ||
|
||
RUN wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" && \ | ||
bash Mambaforge-$(uname)-$(uname -m).sh -b -p ${CONDA_DIR} && \ | ||
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> /etc/skel/.bashrc && \ | ||
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> ~/.bashrc | ||
|
||
ENV PATH="${CONDA_DIR}/bin:${PATH}" | ||
|
||
ENV MAMBA_NO_BANNER=1 | ||
ENV PATH="${PATH}:/workspaces/morpheus/.devcontainer/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
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. | ||
--> | ||
|
||
# Morpheus Devcontainer | ||
|
||
The Morpheus devcontainer is provided as a quick-to-set-up development and exploration environment for use with [Visual Studio Code](https://code.visualstudio.com) (Code). The devcontainer is a lightweight container which mounts-in a conda environment with cached packages, alleviating long conda download times on subsequent launches. It provides a simple framework for adding developer-centric [scripts](#scripts), and incorperates some helpful Code plugins, such as clangd and cmake support. | ||
|
||
More information about devcontainers can be found at [containers.dev](https://containers.dev/). | ||
|
||
## Getting Started | ||
|
||
To get started, simply open the morpheus repository root folder within Code. A window should appear at the bottom-right corner of the editor asking if you would like to reopen the workspace inside of the dev container. After clicking the confirmation dialog, the container will first build, then launch, then remote-attach. | ||
|
||
If the window does not appear, or you would like to rebuild the container, click ctrl-shift-p and search for `Dev Containers: Rebuild and Reopen in Container`. Hit enter, and the container will first build, then launch, then remote-attach. | ||
|
||
Once remoted in to the devcontainer within code, the `setup-morpheus-env` script will begin to run and solve a morpheus conda environment (this conda environment is local to the morpheus repository and dev container and will not override any host environments). You should see the script executing in one of Code's integrated terminal. Once the script has completed, we're ready to start development or exploration of Morpheus. By default, each _new_ integrated terminal will automatically conda activate the morpheus environment. | ||
|
||
## Development Scripts | ||
Several convienient scripts are available in the devcontainer's `PATH` (`.devcontainer/bin`) for starting, stopping, and interacting with Triton and Kafka. More scripts can be added as needed. | ||
|
||
### Interacting with Triton | ||
To start Triton and connect it to the devcontainer network, the `dev-triton-start` script can be used. The following example starts _or restarts_ Triton with the `abp-pcap-xgb` model loaded. | ||
``` | ||
dev-triton-start abp-pcap-xgb | ||
``` | ||
Triton should now be started and DNS resolvable as `triton`. | ||
``` | ||
ping triton | ||
``` | ||
To load a different model, simply call `dev-triton-start` with a different model name. Multiple models can be loaded simultaneously by adding more model names to the command. | ||
``` | ||
dev-triton-start model-1 model-2 ... model-n | ||
``` | ||
To stop Triton, call `dev-triton-stop`. This may take several seconds as the Triton server shuts down gracefully. | ||
``` | ||
dev-triton-stop | ||
``` | ||
### Interacting with Kafka | ||
To start Kafka and connect it to the devcontainer network, the `dev-kafka-start` script can be used. The following example starts _or restarts_ Kafka and Zookeeper. | ||
``` | ||
dev-kafka-start | ||
``` | ||
Kafka should now be started and DNS resolveable as `kafka`. | ||
``` | ||
ping kafka | ||
``` | ||
It can be extremely useful to interact directly with Kafka to produce test data to a specific topic. To do this, the `dev-kafka-produce` script can be used. This script opens a connect to the Kafka server and starts `kafka-console-producer.sh`. In this case with a specific topic. Once started, a prompt will appear in which new-line delimited messages can be entered in to the console. | ||
``` | ||
dev-kafka-produce test-topic | ||
> | ||
``` | ||
It can also be useful to produce messages from a file. For this, the `dev-kafka-produce` script can be used with two arguments. The first argument is the topic name, and the second argument is the file to be forwarded to the console producer. | ||
``` | ||
dev-kafka-produce test-topic $MORPHEUS_ROOT/examples/data/pcap_dump.jsonlines | ||
``` | ||
To retrieve the logs from Kafka and Zookeeper, use the `dev-kafka-logs` script. | ||
``` | ||
dev-kafka-logs | ||
``` | ||
To stop Kafka and Zookeeper, use the `dev-kafka-stop` script. | ||
``` | ||
dev-kafka-stop | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# 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. | ||
|
||
COMPOSE_FILE="${MORPHEUS_ROOT}/.devcontainer/docker-compose.yml" | ||
|
||
docker compose -f $COMPOSE_FILE up -d zookeeper kafka | ||
export ZOOKEEPER_HOST=$(docker compose -f $COMPOSE_FILE exec zookeper hostname -i) | ||
export KAFKA_HOST=$(docker compose -f $COMPOSE_FILE exec kafka hostname -i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# 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. | ||
|
||
args="" | ||
|
||
if [ $# -gt 0 ] ; then | ||
args="$args --model-control-mode=explicit" | ||
fi | ||
|
||
for model in $@ ; do | ||
args="$args --load-model=$model" | ||
done | ||
|
||
export TRITON_MODEL_ARGS="$args" | ||
|
||
COMPOSE_FILE="${MORPHEUS_ROOT}/.devcontainer/docker-compose.yml" | ||
|
||
docker compose -f $COMPOSE_FILE up -d triton | ||
export TRITON_HOST=$(docker compose -f $COMPOSE_FILE exec triton hostname -i) | ||
sleep 1 # wait for triton to load models | ||
docker compose -f $COMPOSE_FILE logs triton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# 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. | ||
|
||
docker compose -f ${MORPHEUS_ROOT}/.devcontainer/docker-compose.yml stop triton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
# SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# 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. | ||
|
||
# Ensure our ~/.config directory has the correct permissions. If ~/.config did | ||
# not exist, and you mount ~/.config/gh from the host, then ~/.config will be | ||
# created with root permissions which can break things | ||
sudo mkdir -p ~/.config | ||
sudo chown ${USER}:${USER} ~/.config | ||
|
||
conda_env_find(){ | ||
conda env list | grep "${@}" >/dev/null 2>/dev/null | ||
} | ||
|
||
ENV_NAME=${ENV_NAME:-morpheus} | ||
|
||
sed -ri "s/conda activate base/conda activate $ENV_NAME/g" ~/.bashrc; | ||
|
||
if conda_env_find "${ENV_NAME}" ; \ | ||
then mamba env update --name ${ENV_NAME} -f ${MORPHEUS_ROOT}/docker/conda/environments/cuda11.5_dev.yml; \ | ||
else mamba env create --name ${ENV_NAME} -f ${MORPHEUS_ROOT}/docker/conda/environments/cuda11.5_dev.yml; \ | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// !/bin/bash | ||
// SPDX-FileCopyrightText: Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// 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. | ||
{ | ||
"name": "Morpheus", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
|
||
"hostRequirements": { | ||
"gpu": true | ||
}, | ||
|
||
"capAdd":[ | ||
"SYS_NICE", | ||
"SYS_PTRACE" | ||
], | ||
|
||
"securityOpt": [ | ||
"seccomp=unconfined" | ||
], | ||
|
||
"runArgs": [ | ||
"--network=morpheus" | ||
], | ||
|
||
"containerEnv": { | ||
"HOST_MORPHEUS_ROOT": "${localWorkspaceFolder}", | ||
"MORPHEUS_ROOT": "${containerWorkspaceFolder}" | ||
}, | ||
|
||
"postStartCommand": "${containerWorkspaceFolder}/.devcontainer/bin/setup-morpheus-env", | ||
|
||
"initializeCommand": [ "./.devcontainer/init.sh" ], | ||
|
||
"remoteUser": "coder", | ||
|
||
"mounts": [ | ||
{"type":"bind", "source": "/var/run/docker.sock", "target": "/var/run/docker.sock"}, | ||
{"type":"bind", "source": "${localWorkspaceFolder}/.cache/conda", "target": "/home/coder/.conda"}, | ||
{"type":"bind", "source": "${localEnv:HOME}/.config/gh", "target": "/home/coder/.config/gh"} | ||
], | ||
|
||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:1": { | ||
"uid": "1000", | ||
"gid": "1000", | ||
"username": "coder" | ||
}, | ||
"ghcr.io/devcontainers/features/docker-from-docker": {}, | ||
"ghcr.io/devcontainers/features/github-cli": {} | ||
}, | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"eamodio.gitlens", | ||
"llvm-vs-code-extensions.vscode-clangd", | ||
"ms-python.python", | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cmake-tools", | ||
"nvidia.nsight-vscode-edition", | ||
"twxs.cmake", | ||
"xaver.clang-format" | ||
] | ||
} | ||
}, | ||
"settings": { | ||
"C_Cpp.intelliSenseEngine": "disabled", | ||
"python.terminal.activateEnvironment": false | ||
} | ||
} |
Oops, something went wrong.