# Kubernetes utilities for Dynamo Benchmarking and Profiling
This directory contains small utilities and manifests used by benchmarking and profiling flows.
This directory contains utilities and manifests for Dynamo benchmarking and profiling workflows.
## Prerequisites
**Before using these utilities, you must first set up Dynamo Cloud following the main installation guide:**
👉 **[Follow the Dynamo Cloud installation guide](../../guides/dynamo_deploy/installation_guide.md) to install the Dynamo Kubernetes Platform first.**
This includes:
1. Installing the Dynamo CRDs
2. Installing the Dynamo Platform (operator, etcd, NATS)
3. Setting up your target namespace
## Contents
## Contents
-`setup_k8s_namespace.sh` — **fully encapsulated deployment setup** that provides one-time per Kubernetes namespace setup. Creates namespace (if missing), applies common manifests, installs CRDs, and deploys the Dynamo operator. If `DOCKER_SERVER`/`IMAGE_TAG` are provided, it installs your custom operator image; otherwise it installs the default published image. If your registry is private, provide `DOCKER_USERNAME`/`DOCKER_PASSWORD` or respond to the prompt to create an image pull secret.
-`setup_benchmarking_resources.sh` — Sets up benchmarking and profiling resources in your existing Dynamo namespace
-`pvc.yaml` — PVC `dynamo-pvc` for storing profiler results and configurations
-`pvc-access-pod.yaml` — short‑lived pod for copying profiler results from the PVC
-`pvc-access-pod.yaml` — short‑lived pod for copying profiler results from the PVC
-`kubernetes.py` — helper used by tooling to apply/read resources (e.g., access pod for PVC downloads).
-`kubernetes.py` — helper used by tooling to apply/read resources (e.g., access pod for PVC downloads)
-`inject_manifest.py` — utility for injecting deployment configurations into the PVC for profiling
-`download_pvc_results.py` — utility for downloading benchmark/profiling results from the PVC
-`dynamo_deployment.py` — utilities for working with DynamoGraphDeployment resources
-`requirements.txt` — Python dependencies for benchmarking utilities
## Quick start
## Quick start
### Kubernetes Setup (one-time per namespace)
### Benchmarking Resource Setup
Use the helper script to prepare a Kubernetes namespace with the common manifests and install the operator. This provides a **fully encapsulated deployment setup**.
After setting up Dynamo Cloud, use this script to prepare your namespace with the additional resources needed for benchmarking and profiling workflows:
This script creates a Kubernetes namespace with the given name if it does not yet exist. It then applies common manifests (serviceaccount, role, rolebinding, pvc), installs CRDs, creates secrets, and deploys the Dynamo Cloud Operator to your namespace.
If your namespace is already set up, you can skip this step.
```bash
```bash
export HF_TOKEN=<HF_TOKEN>
export NAMESPACE=your-dynamo-namespace
export DOCKER_SERVER=<YOUR_DOCKER_SERVER>
export HF_TOKEN=<HF_TOKEN> # Optional: for HuggingFace model access
If `DOCKER_SERVER` and `IMAGE_TAG` are not both provided, the script deploys the operator using the default published image `nvcr.io/nvidia/ai-dynamo/kubernetes-operator:0.4.0`.
If `HF_TOKEN` is provided, it also creates a secret for HuggingFace model access.
To build/push and use a new image instead, pass both `DOCKER_SERVER` and `IMAGE_TAG`.
This script also installs the Dynamo CRDs if not present.
If the registry is private, either pass credentials or respond to the prompt:
```bash
After running the setup script, verify the resources by checking:
NAMESPACE=benchmarking \
DOCKER_SERVER=my-registry.example.com \
IMAGE_TAG=latest \
DOCKER_USERNAME="$oauthtoken"\
DOCKER_PASSWORD=<token> \
deploy/utils/setup_k8s_namespace.sh
```
If `DOCKER_SERVER`/`IMAGE_TAG` are omitted, the script installs the default operator image `nvcr.io/nvidia/ai-dynamo/kubernetes-operator:0.4.0`.
After running the setup script, verify the installation by checking the pods:
For complete benchmarking and profiling workflows:
-**Benchmarking Guide**: See [docs/benchmarks/benchmarking.md](../../docs/benchmarks/benchmarking.md) for comparing DynamoGraphDeployments and external endpoints
-**Benchmarking Guide**: See [docs/benchmarks/benchmarking.md](../../docs/benchmarks/benchmarking.md) for comparing DynamoGraphDeployments and external endpoints
-**Pre-Deployment Profiling**: See [docs/benchmarks/pre_deployment_profiling.md](../../docs/benchmarks/pre_deployment_profiling.md) for optimizing configurations before deployment
-**Pre-Deployment Profiling**: See [docs/benchmarks/pre_deployment_profiling.md](../../docs/benchmarks/pre_deployment_profiling.md) for optimizing configurations before deployment
## Notes
## Notes
-Benchmarking scripts (`benchmarks/benchmark.sh`, `benchmarks/deploy_benchmark.sh`) call this setup automatically when present.
-Profiling job manifest remains in `benchmarks/profiler/deploy/profile_sla_job.yaml` and relies on the ServiceAccount/PVC created by the setup script.
-Profiling job manifest remains in `benchmarks/profiler/deploy/profile_sla_job.yaml` and now relies on the common ServiceAccount/PVC here.
-This setup is focused on benchmarking and profiling resources only - the main Dynamo platform must be installed separately.
@@ -37,9 +37,15 @@ The framework is a wrapper around `genai-perf` that:
...
@@ -37,9 +37,15 @@ The framework is a wrapper around `genai-perf` that:
## Prerequisites
## Prerequisites
1.**Kubernetes cluster with NVIDIA GPUs and Dynamo namespace setup** - You need a Kubernetes cluster with eligible NVIDIA GPUs and a properly configured namespace for Dynamo benchmarking. See the [deploy/utils/README](../../deploy/utils/README.md)for complete setup instructions.
1.**Kubernetes cluster with NVIDIA GPUs and Dynamo Cloud platform** - You need a Kubernetes cluster with eligible NVIDIA GPUs and the Dynamo Cloud platform installed. First follow the [installation guide](../../guides/dynamo_deploy/installation_guide.md) to install Dynamo Cloud, then use [deploy/utils/README](../../deploy/utils/README.md)to setup benchmarking resources.
2.**kubectl access** - You need `kubectl` installed and configured to access your Kubernetes cluster. All other required tools (GenAI-Perf, Python, etc.) are included in the Dynamo containers. If you are not working within a Dynamo container, you can install the necessary requirements using `deploy/utils/requirements.txt`. *Note: if you are on Ubuntu 22.04 or lower, you will also need to build perf_analyzer [from source](https://github.com/triton-inference-server/perf_analyzer/blob/main/docs/install.md#build-from-source).*
2.**kubectl access** - You need `kubectl` installed and configured to access your Kubernetes cluster.
3.**Benchmark dependencies** - Since benchmarks run locally, you need to install the required Python dependencies. Install them using:
```bash
pip install-r deploy/utils/requirements.txt
```
*Note: if you are on Ubuntu 22.04 or lower, you will also need to build perf_analyzer [from source](https://github.com/triton-inference-server/perf_analyzer/blob/main/docs/install.md#build-from-source).*
@@ -89,7 +89,7 @@ SLA planner can work with any interpolation data that follows the above format.
...
@@ -89,7 +89,7 @@ SLA planner can work with any interpolation data that follows the above format.
## Running the Profiling Script in Kubernetes
## Running the Profiling Script in Kubernetes
Set up your Kubernetes namespace (one-time per namespace). Follow the instructions [here](../../deploy/utils/README.md#kubernetes-setup-one-time-per-namespace). If your namespace is already set up, skip this step.
Set up your Kubernetes namespace for profiling (one-time per namespace). First ensure Dynamo Cloud platform is installed by following the [main installation guide](../../deploy/README.md), then setup profiling resources using [deploy/utils/README](../../deploy/utils/README.md). If your namespace is already set up, skip this step.
**Prerequisites**: Ensure all dependencies are installed. If you ran the setup script above, dependencies are already installed. Otherwise, install them manually:
**Prerequisites**: Ensure all dependencies are installed. If you ran the setup script above, dependencies are already installed. Otherwise, install them manually: