Skip to content

Commit

Permalink
Make the pypi package install more bash friendly
Browse files Browse the repository at this point in the history
Signed-off-by: Anuradha Karuppiah <[email protected]>
  • Loading branch information
AnuradhaKaruppiah committed Oct 21, 2024
1 parent c2af3a1 commit 76e71c2
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions docs/source/conda_packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ To set up a Conda environment with the [`morpheus-core`](https://anaconda.org/nv
### Create a Conda environment
```bash
export CONDA_ENV_NAME=morpheus
conda create -n $CONDA_ENV_NAME python=3.10
conda activate $CONDA_ENV_NAME
conda create -n ${CONDA_ENV_NAME} python=3.10
conda activate ${CONDA_ENV_NAME}
```
### Add Conda channels
These channel are required for installing the runtime dependencies
Expand All @@ -51,21 +51,17 @@ The `morpheus-core` Conda package installs the `morpheus` python package. It als
### Install additional PyPI dependencies
Some of the stages in the core library require additional dependencies that are hosted on PyPI. These dependencies are included as a requirements file in the `morpheus` python package. The requirements files can be located and installed by running the following command:
```bash
python3 <<EOF
import importlib.resources
import subprocess
requirements_file = importlib.resources.path("morpheus", "requirements_morpheus_core.txt")
subprocess.call(f"pip install -r {requirements_file}".split())
EOF
MORPHEUS_CORE_PKG_DIR=$(dirname $(python -c "import morpheus; print(morpheus.__file__)"))
pip install -r ${MORPHEUS_CORE_PKG_DIR}/requirements_morpheus_core.txt
```

## Morpheus DFP
Digital Finger Printing (DFP) is a technique used to identify anomalous behavior and uncover potential threats in the environment​. The `morpheus-dfp` library contains stages for DFP. It is built from the source code in the `python/morpheus_dfp` directory of the Morpheus repository. To set up a Conda environment with the [`morpheus-dfp`](https://anaconda.org/nvidia/morpheus-dfp) library you can run the following commands:
### Create a Conda environment
```bash
export CONDA_ENV_NAME=morpheus-dfp
conda create -n $CONDA_ENV_NAME python=3.10
conda activate $CONDA_ENV_NAME
conda create -n ${CONDA_ENV_NAME} python=3.10
conda activate ${CONDA_ENV_NAME}
```
### Add Conda channels
These channel are required for installing the runtime dependencies
Expand All @@ -83,12 +79,8 @@ The `morpheus-dfp` Conda package installs the `morpheus_dfp` python package. It
### Install additional PyPI dependencies
Some of the DFP stages in the library require additional dependencies that are hosted on PyPI. These dependencies are included as a requirements file in the `morpheus_dfp` python package. And can be installed by running the following command:
```bash
python3 <<EOF
import importlib.resources
import subprocess
requirements_file = importlib.resources.path("morpheus_dfp", "requirements_morpheus_dfp.txt")
subprocess.call(f"pip install -r {requirements_file}".split())
EOF
MORPHEUS_DFP_PKG_DIR=$(dirname $(python -c "import morpheus_dfp; print(morpheus_dfp.__file__)"))
pip install -r ${MORPHEUS_DFP_PKG_DIR}/requirements_morpheus_dfp.txt
```

## Morpheus LLM
Expand All @@ -97,8 +89,8 @@ To set up a Conda environment with the [`morpheus-llm`](https://anaconda.org/nvi
### Create a Conda environment
```bash
export CONDA_ENV_NAME=morpheus-llm
conda create -n $CONDA_ENV_NAME python=3.10
conda activate $CONDA_ENV_NAME
conda create -n ${CONDA_ENV_NAME} python=3.10
conda activate ${CONDA_ENV_NAME}
```
### Add Conda channels
These channel are required for installing the runtime dependencies
Expand All @@ -116,12 +108,8 @@ The `morpheus-llm` Conda package installs the `morpheus_llm` python package. It
### Install additional PyPI dependencies
Some of the stages in the library require additional dependencies that are hosted on PyPI. These dependencies are included as a requirements file in the `morpheus_llm` python package. And can be installed by running the following command:
```bash
python3 <<EOF
import importlib.resources
import subprocess
requirements_file = importlib.resources.path("morpheus_llm", "requirements_morpheus_llm.txt")
subprocess.call(f"pip install -r {requirements_file}".split())
EOF
MORPHEUS_LLM_PKG_DIR=$(dirname $(python -c "import morpheus_llm; print(morpheus_llm.__file__)"))
pip install -r ${MORPHEUS_LLM_PKG_DIR}/requirements_morpheus_llm.txt
```

## Miscellaneous
Expand Down

0 comments on commit 76e71c2

Please sign in to comment.