Skip to content

Commit

Permalink
Merge branch 'fix-log-parsing-example-pipeline-null-output-issue' of …
Browse files Browse the repository at this point in the history
…github.com:yczhang-nv/Morpheus into fix-log-parsing-example-pipeline-null-output-issue
  • Loading branch information
yczhang-nv committed Oct 31, 2024
2 parents a00eeca + 345ad55 commit afcc813
Show file tree
Hide file tree
Showing 23 changed files with 359 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
triton:
container_name: morpheus-triton
runtime: nvidia
image: nvcr.io/nvidia/tritonserver:23.06-py3
image: nvcr.io/nvidia/tritonserver:24.09-py3
command: tritonserver --model-repository=/models/triton-model-repo --exit-on-error=false ${TRITON_MODEL_ARGS}
ports:
- 8000:8000
Expand Down
2 changes: 1 addition & 1 deletion ci/iwyu/mappings.imp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
{ "include": [ "<google/protobuf/repeated_ptr_field.h>", private, "<google/protobuf/repeated_field.h>", "public" ] },

# pybind11
{ "include": [ "<pybind11/detail/common.h>", "private", "<pybind11/pytypes.h>", "public" ] },
{ "include": [ "@<pybind11/detail/.*>", "private", "<pybind11/pybind11.h>", "public" ] },
{ "include": [ "<pybind11/cast.h>", "private", "<pybind11/pybind11.h>", "public" ] },

# rxcpp
Expand Down
23 changes: 23 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,18 @@ files:
- morpheus_core_pip
- morpheus_llm_pip

# dfp example conda dependencies
dfp_example:
output: conda
matrix:
cuda: ["12.5"]
arch: [x86_64]
output: conda
conda_dir: examples/digital_fingerprinting/production/conda/environments
includes:
- example-dfp-container
- example-dfp-prod

channels:
- conda-forge
- huggingface
Expand Down Expand Up @@ -437,6 +449,17 @@ dependencies:
- pip:
- python-logging-loki

# packages needed in the DFP example container
example-dfp-container:
common:
- output_types: [conda]
packages:
- morpheus-dfp=24.10
- tini=0.19
- pip:
- --extra-index-url https://download.pytorch.org/whl/cu124
- torch==2.4.0+cu124

example-gnn:
common:
- output_types: [conda]
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conda_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ conda config --env --add channels conda-forge &&\

### Install the `morpheus-core` Library
```bash
conda install -c nvidia morpheus-core=24.10.00a
conda install -c nvidia morpheus-core=24.10
```
The `morpheus-core` Conda package installs the `morpheus` Python package. It also pulls down all the necessary Conda runtime dependencies for the core stages including [`mrc`](https://anaconda.org/nvidia/mrc) and [`libmrc`](https://anaconda.org/nvidia/libmrc).

Expand Down Expand Up @@ -80,7 +80,7 @@ conda config --env --add channels conda-forge &&\

### Install the `morpheus-dfp` Library
```bash
conda install -c nvidia morpheus-dfp=24.10.00a
conda install -c nvidia morpheus-dfp=24.10
```
The `morpheus-dfp` Conda package installs the `morpheus_dfp` Python package. It also pulls down all the necessary Conda runtime dependencies including [`morpheus-core`](https://anaconda.org/nvidia/morpheus-core).
### Install Additional PyPI dependencies
Expand Down Expand Up @@ -112,7 +112,7 @@ conda config --env --add channels conda-forge &&\

### Install the `morpheus-llm` Library
```bash
conda install -c nvidia morpheus-llm=24.10.00a
conda install -c nvidia morpheus-llm=24.10
```
The `morpheus-llm` Conda package installs the `morpheus_llm` python package. It also pulls down all the necessary Conda packages including [`morpheus-core`](https://anaconda.org/nvidia/morpheus-core).

Expand Down
4 changes: 2 additions & 2 deletions docs/source/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ More advanced users, or those who are interested in using the latest pre-release
- [CUDA 12.5](https://developer.nvidia.com/cuda-12-5-0-download-archive)
- [Docker](https://docs.docker.com/get-docker/)
- [The NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installation)
- [NVIDIA Triton Inference Server](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tritonserver) `23.06` or higher
- [NVIDIA Triton Inference Server](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tritonserver) `24.09` or higher

> **Note about Docker:**
>
Expand Down Expand Up @@ -197,7 +197,7 @@ Alternately, for users who have checked out the Morpheus git repository, launchi
```bash
docker run --rm -ti --gpus=all -p8000:8000 -p8001:8001 -p8002:8002 \
-v $PWD/models:/models \
nvcr.io/nvidia/tritonserver:23.06-py3 \
nvcr.io/nvidia/tritonserver:24.09-py3 \
tritonserver --model-repository=/models/triton-model-repo \
--exit-on-error=false \
--log-info=true \
Expand Down
42 changes: 27 additions & 15 deletions examples/digital_fingerprinting/production/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,47 @@
# See the License for the specific language governing permissions and
# limitations under the License.

ARG MORPHEUS_CONTAINER=nvcr.io/nvidia/morpheus/morpheus
ARG MORPHEUS_CONTAINER_VERSION=v24.10.00-runtime
ARG BASE_IMG=nvcr.io/nvidia/cuda
ARG BASE_IMG_TAG=12.5.1-base-ubuntu22.04

FROM ${MORPHEUS_CONTAINER}:${MORPHEUS_CONTAINER_VERSION} as base
FROM ${BASE_IMG}:${BASE_IMG_TAG} as base

# # Fix the entrypoint to work with different WORKDIR
ENTRYPOINT [ "/opt/conda/bin/tini", "--", "/workspace/docker/entrypoint.sh" ]
# Install necessary dependencies using apt-get
RUN apt-get update && apt-get install -y \
git \
git-lfs \
wget \
&& apt-get clean

SHELL ["/bin/bash", "-c"]
# Install miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh \
&& bash /tmp/miniconda.sh -b -p /opt/conda \
&& rm /tmp/miniconda.sh

# Set the workdir to the DFP base folder
WORKDIR /workspace/examples/digital_fingerprinting/
# Add conda to the PATH
ENV PATH=/opt/conda/bin:$PATH

# Install DFP dependencies
RUN source activate morpheus \
&& /opt/conda/bin/conda env update --solver=libmamba -n morpheus --file /workspace/conda/environments/examples_cuda-125_arch-x86_64.yaml
SHELL ["/bin/bash", "-c"]

# Set the tracking URI for mlflow
ENV MLFLOW_TRACKING_URI="http://mlflow:5000"

# This will get used by pipelines for the --s3_cache option
# ENV DFP_S3_CACHE="/work/examples/dfp_workflow/morpheus/.s3_cache"

# If any changes have been made from the base image, recopy the sources
COPY . /workspace/examples/digital_fingerprinting/

# Set the workdir to be the production folder
WORKDIR /workspace/examples/digital_fingerprinting/production

# If any changes have been made from the base image, recopy the sources
COPY . /workspace/examples/digital_fingerprinting/production/

# Create a conda env with morpheus-dfp and any additional dependencies needed to run the examples
RUN conda env create --solver=libmamba -y --name morpheus-dfp --file ./conda/environments/dfp_example_cuda-125_arch-x86_64.yaml

ENTRYPOINT [ "/opt/conda/envs/morpheus-dfp/bin/tini", "--", "/workspace/examples/digital_fingerprinting/production/docker/entrypoint.sh" ]

SHELL ["/bin/bash", "-c"]

# ===== Setup for running unattended =====
FROM base as runtime

Expand All @@ -52,7 +64,7 @@ CMD ["./launch.sh"]
FROM base as jupyter

# Install the jupyter specific requirements
RUN source activate morpheus &&\
RUN source activate morpheus-dfp &&\
/opt/conda/bin/conda install --solver=libmamba -y -c conda-forge \
ipywidgets \
jupyter_contrib_nbextensions \
Expand Down
7 changes: 0 additions & 7 deletions examples/digital_fingerprinting/production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,10 @@ Key Features:
* Can be deployed to Kubernetes using provided Helm charts
* Uses many customized stages to maximize performance.

## Build the Morpheus container
This is necessary to get the latest changes needed for DFP. From the root of the Morpheus repo:
```bash
./docker/build_container_release.sh
```

## Building and Running via `docker compose`
### Build
```bash
cd examples/digital_fingerprinting/production
export MORPHEUS_CONTAINER_VERSION="$(git describe --tags --abbrev=0)-runtime"
docker compose build
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is generated by `rapids-dependency-file-generator`.
# To make changes, edit ../../../../../dependencies.yaml and run `rapids-dependency-file-generator`.
channels:
- conda-forge
- huggingface
- rapidsai
- rapidsai-nightly
- nvidia
- nvidia/label/dev
- pytorch
dependencies:
- boto3
- kfp
- morpheus-dfp=24.10
- nodejs=18.*
- papermill=2.4.0
- pip
- s3fs
- tini=0.19
- pip:
- --extra-index-url https://download.pytorch.org/whl/cu124
- python-logging-loki
- torch==2.4.0+cu124
name: dfp_example_cuda-125_arch-x86_64
6 changes: 0 additions & 6 deletions examples/digital_fingerprinting/production/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ services:
context: ./
dockerfile: ./Dockerfile
target: jupyter
args:
- MORPHEUS_CONTAINER=${MORPHEUS_CONTAINER:-nvcr.io/nvidia/morpheus/morpheus}
- MORPHEUS_CONTAINER_VERSION=${MORPHEUS_CONTAINER_VERSION:-v24.10.00-runtime}
deploy:
resources:
reservations:
Expand Down Expand Up @@ -104,9 +101,6 @@ services:
context: ./
dockerfile: ./Dockerfile
target: runtime
args:
- MORPHEUS_CONTAINER=${MORPHEUS_CONTAINER:-nvcr.io/nvidia/morpheus/morpheus}
- MORPHEUS_CONTAINER_VERSION=${MORPHEUS_CONTAINER_VERSION:-v24.10.00-runtime}
image: dfp_morpheus
container_name: morpheus_pipeline
deploy:
Expand Down
27 changes: 27 additions & 0 deletions examples/digital_fingerprinting/production/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash --login
# SPDX-FileCopyrightText: Copyright (c) 2021-2024, 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.


# Activate the `morpheus` conda environment.
. /opt/conda/etc/profile.d/conda.sh
conda activate morpheus-dfp

# Source "source" file if it exists
SRC_FILE="/opt/docker/bin/entrypoint_source"
[ -f "${SRC_FILE}" ] && source "${SRC_FILE}"

# Run whatever the user wants.
exec "$@"
2 changes: 1 addition & 1 deletion models/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

ARG FROM_IMAGE="nvcr.io/nvidia/tritonserver"
ARG FROM_IMAGE_TAG="23.06-py3"
ARG FROM_IMAGE_TAG="24.09-py3"
FROM ${FROM_IMAGE}:${FROM_IMAGE_TAG} AS base

WORKDIR /
Expand Down
2 changes: 1 addition & 1 deletion models/docker/build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SHORT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}

# Build args
FROM_IMAGE=${FROM_IMAGE:-"nvcr.io/nvidia/tritonserver"}
FROM_IMAGE_TAG=${FROM_IMAGE_TAG:-"23.06-py3"}
FROM_IMAGE_TAG=${FROM_IMAGE_TAG:-"24.09-py3"}

DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME:-"nvcr.io/nvidia/morpheus/morpheus-tritonserver-models"}
DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG:-"${SHORT_VERSION}"}
Expand Down
Binary file modified models/ransomware-models/ransomw-model-short-rf/checkpoint.tl
Binary file not shown.
2 changes: 1 addition & 1 deletion models/triton-model-repo/log-parsing-onnx/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ output [
{
name: "output"
data_type: TYPE_FP32
dims: [ -1, 23 ]
dims: [ 256, 23 ]
}
]

Expand Down
3 changes: 1 addition & 2 deletions python/morpheus/morpheus/_lib/messages/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
* limitations under the License.
*/

#include "pymrc/utilities/object_wrappers.hpp"

#include "morpheus/io/data_loader_registry.hpp"
#include "morpheus/messages/control.hpp"
#include "morpheus/messages/memory/inference_memory.hpp"
Expand All @@ -43,6 +41,7 @@
#include <pybind11/stl.h> // IWYU pragma: keep
#include <pymrc/node.hpp> // IWYU pragma: keep
#include <pymrc/port_builders.hpp>
#include <pymrc/utilities/object_wrappers.hpp>
#include <pymrc/utils.hpp> // for pymrc::import
#include <rxcpp/rx.hpp>

Expand Down
5 changes: 2 additions & 3 deletions python/morpheus/morpheus/_lib/src/stages/file_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

#include "morpheus/stages/file_source.hpp"

#include "mrc/segment/object.hpp"
#include "pymrc/node.hpp"

#include "morpheus/io/deserializers.hpp"
#include "morpheus/objects/file_types.hpp"
#include "morpheus/objects/table_info.hpp"
Expand All @@ -29,10 +26,12 @@
#include <cudf/types.hpp>
#include <glog/logging.h>
#include <mrc/segment/builder.hpp>
#include <mrc/segment/object.hpp>
#include <pybind11/cast.h> // IWYU pragma: keep
#include <pybind11/gil.h>
#include <pybind11/pybind11.h> // for str_attr_accessor
#include <pybind11/pytypes.h> // for pybind11::int_
#include <pymrc/node.hpp>

#include <filesystem>
#include <memory>
Expand Down
5 changes: 2 additions & 3 deletions python/morpheus/morpheus/_lib/src/stages/kafka_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

#include "morpheus/stages/kafka_source.hpp"

#include "mrc/segment/object.hpp"
#include "pymrc/utilities/function_wrappers.hpp" // for PyFuncWrapper

#include "morpheus/messages/meta.hpp"
#include "morpheus/utilities/stage_util.hpp"
#include "morpheus/utilities/string_util.hpp"
Expand All @@ -31,11 +28,13 @@
#include <librdkafka/rdkafkacpp.h>
#include <mrc/runnable/context.hpp>
#include <mrc/segment/builder.hpp>
#include <mrc/segment/object.hpp>
#include <mrc/types.hpp> // for SharedFuture
#include <nlohmann/json.hpp>
#include <pybind11/pybind11.h>
#include <pybind11/pytypes.h>
#include <pymrc/node.hpp>
#include <pymrc/utilities/function_wrappers.hpp> // for PyFuncWrapper

#include <algorithm> // for find, min, transform
#include <chrono>
Expand Down
8 changes: 4 additions & 4 deletions python/morpheus/morpheus/_lib/src/stages/write_to_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

#include "morpheus/stages/write_to_file.hpp" // IWYU pragma: associated

#include "mrc/segment/builder.hpp"
#include "mrc/segment/object.hpp"
#include "pymrc/node.hpp"

#include "morpheus/io/serializers.hpp"
#include "morpheus/utilities/string_util.hpp"

#include <mrc/segment/builder.hpp>
#include <mrc/segment/object.hpp>
#include <pymrc/node.hpp>

#include <exception>
#include <memory>
#include <sstream>
Expand Down
2 changes: 2 additions & 0 deletions python/morpheus/morpheus/_lib/stages/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
#include <mrc/segment/object.hpp> // for Object, ObjectProperties
#include <mrc/utils/string_utils.hpp> // for MRC_CONCAT_STR
#include <pybind11/attr.h> // for multiple_inheritance
#include <pybind11/functional.h> // IWYU pragma: keep
#include <pybind11/pybind11.h> // for arg, init, class_, module_, overload_cast, overload_...
#include <pybind11/pytypes.h> // for none, dict, str_attr
#include <pybind11/stl.h> // IWYU pragma: keep
#include <pybind11/stl/filesystem.h> // IWYU pragma: keep
#include <pymrc/utils.hpp> // for from_import, import
#include <rxcpp/rx.hpp> // for trace_activity, decay_t
Expand Down
Loading

0 comments on commit afcc813

Please sign in to comment.