Deploy
To deploy this solution, you must first set up the Project
directory.
Define an environment variable for your main project directory.
export PROJECT_DIR=~/morpheus_fraud_detection
mkdir -p $PROJECT_DIR
cd $PROJECT_DIR
Terminal 1: Run the Morpheus Pipeline
This command starts the Morpheus Pipeline (Docker Container) swimlane.
The pipeline will initialize and then wait, listening for data to arrive on the
Kafka Topic:
Input
.cd $PROJECT_DIR/Morpheus
docker run --rm -it --net=host --cap-add=sys_nice \ --runtime=nvidia --gpus=all \ -v $(pwd):/morpheus \ nvcr.io/nvidia/morpheus/morpheus:25.02-runtime bash
# --- INSIDE THE CONTAINER ---
cd /morpheus
conda env update --solver=libmamba -n ${CONDA_DEFAULT_ENV} --file ./conda/environments/examples_cuda-125_arch-$(arch).yaml python examples/gnn_fraud_detection_pipeline/run.py
Expected Output: You will see logs from Morpheus as it builds the
pipeline. It will then appear to hang, which is the correct behavior as it is now
actively listening for messages.
Terminal 2: Run the Kafka Consumer
This command starts the Python Consumer in the host environment swimlane.
It subscribes to the Kafka Topic: Output
and will display any
results published by the Morpheus pipeline.
cd $PROJECT_DIR
source kafka_env/bin/activate
python3 consumer.py
Expected Output: You will see the message
"Listening for
fraud detection results..."
and the terminal will wait.
Terminal 3: Run the Kafka Producer
This command starts the Python Producer, which reads from the Transaction Data
file.
It begins the Input Stream
into the Kafka Topic:
Input
. This action triggers the entire end-to-end flow.
cd $PROJECT_DIR
source kafka_env/bin/activate
python3 producer.py
Expected Output: You will see a series of
"Sent
transaction index..."
messages as data is published. Simultaneously, you
will see the Morpheus pipeline in Terminal 1 start processing data, and the final fraud
alerts will appear in Terminal 2.