dynamo_cloud.md 11.3 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!--
SPDX-FileCopyrightText: Copyright (c) 2025 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.
-->

18
# Dynamo Cloud Kubernetes Platform (Dynamo Deploy)
19

20
The Dynamo Cloud platform is a comprehensive solution for deploying and managing Dynamo inference graphs (also referred to as pipelines) in Kubernetes environments. It provides a streamlined experience for deploying, scaling, and monitoring your inference services. You can interface with Dynamo Cloud using the `deploy` subcommand available in the Dynamo CLI (for example, `dynamo deploy`)
21

22
## Overview
23
24
25

The Dynamo cloud platform consists of several key components:

26
- **Dynamo Operator**: A Kubernetes operator that manages the lifecycle of Dynamo inference graphs from build ➡️ deploy. For more information on the operator, see [Dynamo Kubernetes Operator Documentation](../dynamo_deploy/dynamo_operator.md)
27
28
29
30
- **Custom Resources**: Kubernetes custom resources for defining and managing Dynamo services

These components work together to provide a seamless deployment experience, handling everything from containerization to scaling and monitoring.

31
![Dynamo Deploy system deployment diagram.](../../images/dynamo-deploy.png)
32

33
## Prerequisites
34
35
36
37
38
39
40
41
42
43

Before getting started with the Dynamo cloud platform, ensure you have:

- A Kubernetes cluster (version 1.24 or later)
- [Earthly](https://earthly.dev/) installed for building components
- Docker installed and running
- Access to a container registry (e.g., Docker Hub, NVIDIA NGC, etc.)
- `kubectl` configured to access your cluster
- Helm installed (version 3.0 or later)

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

> [!TIP]
> Don't have a Kubernetes cluster? Check out our [Minikube setup guide](../../../docs/guides/dynamo_deploy/minikube.md) to set up a local environment! 🏠

#### 🏗️ Build Dynamo inference runtime.

[One-time Action]
Before you could use Dynamo make sure you have setup the Inference Runtime Image.
For basic cases you could use the prebuilt image for the Dynamo Inference Runtime.
Just export the environment variable. This will be the image used by your individual components. You pick whatever dynamo version you want or use the latest (default)

```bash
export DYNAMO_IMAGE=nvcr.io/nvidia/dynamo:latest-vllm
```

For advanced examples make sure you have first built and pushed to your registry Dynamo Base Image for Dynamo inference runtime. This is a one-time operation.

```bash
# Run the script to build the default dynamo:latest-vllm image.
./container/build.sh
export IMAGE_TAG=<TAG>
# retag the image
docker tag dynamo:latest-vllm <your-registry>/dynamo:${IMAGE_TAG}
docker push <your-registry>/dynamo:${IMAGE_TAG}
68
```
69

70
## Building Docker Images for Dynamo Cloud Components
71
72
73

The Dynamo cloud platform components need to be built and pushed to a container registry before deployment. You can build these components individually or all at once.

74
### Setting Up Environment Variables
75
76
77
78

First, set the required environment variables for building and pushing images:

```bash
79
80
# Set your container registry
export DOCKER_SERVER=<CONTAINER_REGISTRY>
81
# Set the image tag (e.g., latest, 0.0.1, etc.)
82
export IMAGE_TAG=<TAG>
83
84
```

85
As a description of the placeholders:
86
- `<CONTAINER_REGISTRY>`: Your container registry (e.g., `nvcr.io`, `docker.io/<your-username>`, etc.)
87
88
89
90
- `<TAG>`: The tag you want to use for the images of the Dynamo cloud components (e.g., `latest`, `0.0.1`, etc.)
If the runtime image tag is not explicitly set, the default is the `latest`.

The tag will go into the dynamo-operator:<IMAGE_TAG> image for the Operator.  The runtime (base) image handles the inference toolchain and the sdk and built by the (`build.sh`). The tags do not have to match the runtime  image tag but the images must be compatible.
91

92
93
**Important** Make sure you're logged in to your container registry before pushing images. For example:

94
95
96
```bash
docker login <CONTAINER_REGISTRY>
```
97

98
### Building Components
99

100
You can build and push all platform components at once:
101
102

```bash
103
earthly --push +all-docker --DOCKER_SERVER=$DOCKER_SERVER --IMAGE_TAG=$IMAGE_TAG
104
105
```

106
### 🚀 Deploying the Dynamo Cloud Platform
107
108
109

Once you've built and pushed the components, you can deploy the platform to your Kubernetes cluster.

110
### Prerequisites
111

112
113
Before deploying Dynamo Cloud, ensure your Kubernetes cluster meets the following requirements:

114
115
116
117
118
119
120
121
122
123
124
125
#### 1. 🛡️ Istio Installation
Dynamo Cloud requires Istio for service mesh capabilities. Verify Istio is installed and running:

```bash
# Check if Istio is installed
kubectl get pods -n istio-system

# Expected output should show running Istio pods
# istiod-* pods should be in Running state
```

#### 2. 💾 PVC Support with Default Storage Class
126
Dynamo Cloud requires Persistent Volume Claim (PVC) support with a default storage class. Verify your cluster configuration:
127
128

```bash
129
130
# Check if default storage class exists
kubectl get storageclass
131

132
133
134
135
136
# Expected output should show at least one storage class marked as (default)
# Example:
# NAME                 PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
# standard (default)   kubernetes.io/gce-pd    Delete          Immediate              true                   1d
```
137

138
139


140
### Installation using the helper script
141
142
143

1. Set the required environment variables:
```bash
144
export PROJECT_ROOT=$(pwd)
145
146
147
148
149
export DOCKER_USERNAME=<your-docker-username>
export DOCKER_PASSWORD=<your-docker-password>
export DOCKER_SERVER=<your-docker-server>
export IMAGE_TAG=<TAG>  # Use the same tag you used when building the images
export NAMESPACE=dynamo-cloud    # change this to whatever you want!
150
export DYNAMO_INGRESS_SUFFIX=dynamo-cloud.com # change this to whatever you want!
151
152
```

153
154
155
156
``` {note}
DOCKER_USERNAME and DOCKER_PASSWORD are optional and only needed if you want to pull docker images from a private registry.
A docker image pull secret is created automatically if these variables are set. Its name is `docker-imagepullsecret` unless overridden by the `DOCKER_SECRET_NAME` environment variable.
```
157
158

The Dynamo Cloud Platform auto-generates docker images for pipelines and pushes them to a container registry.
159
By default, the platform uses the same container registry as the platform components (specified by `DOCKER_SERVER`).
160
However, you can use a different container registry for the platform components by making sure an associated kubernetes secret is present:
161
162

```bash
163
164
165
166
167
kubectl create secret docker-registry dynamo-components-imagepullsecret \
  --docker-server=<docker-registry-for-dynamo-components> \
  --docker-username=<username> \
  --docker-password=<password> \
  --namespace=${NAMESPACE}
168
169
```

170
171
172
173
174
175
176
177
178
179
180
181
If you wish to expose your Dynamo Cloud Platform externally, you can setup the following environment variables:

```bash
# if using ingress
export INGRESS_ENABLED="true"
export INGRESS_CLASS="nginx" # or whatever ingress class you have configured

# if using istio
export ISTIO_ENABLED="true"
export ISTIO_GATEWAY="istio-system/istio-ingressgateway" # or whatever istio gateway you have configured
```

182
Running the installation script with `--interactive` guides you through the process of exposing your Dynamo Cloud Platform externally if you don't want to set these environment variables manually.
183

184
2. [One-time Action] Create a new kubernetes namespace and set it as your default.
185
186

```bash
187
cd deploy/cloud/helm
188
189
kubectl create namespace $NAMESPACE
kubectl config set-context --current --namespace=$NAMESPACE
190
191
```

192
3. Deploy the Helm charts (install CRDs first, then platform) using the deployment script:
193

194
```bash
195
./deploy.sh --crds
196
197
```

198
if you want guidance during the process, run the deployment script with the `--interactive` flag:
199
200

```bash
201
./deploy.sh --crds --interactive
202
203
```

204
205
omitting `--crds` will skip the CRDs installation/upgrade. This is useful when installing on a shared cluster as CRDs are cluster-scoped resources.

206
If you'd like to only generate the generated-values.yaml file without deploying to Kubernetes (e.g., for inspection, CI workflows, or dry-run testing), use:
207
208

```bash
209
./deploy_dynamo_cloud.py --yaml-only
210
```
211

212
213
214

### Installation using published helm chart

215
To install Dynamo Cloud using the published Helm chart, you'll need to configure Docker registry credentials and image settings.
216
217
218
219
220
221
222
223


#### Environment Setup

Set the required environment variables:

```bash
# Docker registry configuration
224
export DOCKER_SERVER="your-registry.com"                    # Docker registry server where images of dynamo cloud services (operator) are available
225
226
227
export IMAGE_TAG="v1.0.0"                                   # Image tag to deploy
export NAMESPACE="dynamo-cloud"                             # Target namespace

228
229
# Components-specific Docker registry (if different from DOCKER_SERVER)
export COMPONENTS_DOCKER_SERVER="your-pipeline-registry.com" # Registry for Dynamo components images
230
231

# Image pull secret for the operator itself
232
233
export DOCKER_SECRET_NAME="my-pull-secret"                       # Secret for pulling images of dynamo cloud services (operator) operator images
export COMPONENTS_DOCKER_SECRET_NAME="my-components-pull-secret" # Secret for pulling images of dynamo components images (if needed)
234
235
236
237
238
239
240
```

you can easily create an image pull secret with the following command :

```bash
kubectl create secret docker-registry ${DOCKER_SECRET_NAME} \
  --docker-server=${DOCKER_SERVER} \
241
242
243
244
245
246
247
248
249
  --docker-username=<docker-server-username> \
  --docker-password=<docker-server-password> \
  --namespace=${NAMESPACE}

# Only if using a different registry for Dynamo components
kubectl create secret docker-registry ${COMPONENTS_DOCKER_SECRET_NAME} \
  --docker-server=${COMPONENTS_DOCKER_SERVER} \
  --docker-username=<components-docker-server-username> \
  --docker-password=<components-docker-server-password> \
250
  --namespace=${NAMESPACE}
251

252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
```

#### Installation Commands

**Step 1: Install Custom Resource Definitions (CRDs)**

```bash
helm install dynamo-crds dynamo-crds-helm-chart.tgz \
  --namespace default \
  --wait \
  --atomic
```

**Step 2: Install Dynamo Platform**

267
Run the following helm command:
268
269
270
271
272
273

```bash
helm install dynamo-platform dynamo-platform-helm-chart.tgz \
  --namespace ${NAMESPACE} \
  --set "dynamo-operator.controllerManager.manager.image.repository=${DOCKER_SERVER}/dynamo-operator" \
  --set "dynamo-operator.controllerManager.manager.image.tag=${IMAGE_TAG}" \
274
  --set "dynamo-operator.imagePullSecrets[0].name=${DOCKER_SECRET_NAME}"
275
276
```

277
278
279
280
281
### Cloud Provider-Specific deployment

#### Google Kubernetes Engine (GKE) deployment

You can find detailed instructions for deployment in GKE [here](../dynamo_deploy/gke_setup.md)
282

283
284
285
286
287
288
289
290
291
## Next Steps

After deploying the Dynamo cloud platform, you can:

1. Deploy your first inference graph using the [Dynamo CLI](operator_deployment.md)
2. Deploy Dynamo LLM graphs to Kubernetes using the [Dynamo CLI](../../examples/llm_deployment.md)
3. Manage your deployments using the Dynamo CLI

For more detailed information about deploying inference graphs, see the [Dynamo Deploy Guide](README.md).