8000 fix: dynamo deploy helm chart cleanup by mohammedabdulwahhab · Pull Request #727 · ai-dynamo/dynamo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: dynamo deploy helm chart cleanup #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
8000 Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ all-test:
BUILD ./deploy/dynamo/operator+test

all-docker:
ARG CI_REGISTRY_IMAGE=my-registry
ARG CI_COMMIT_SHA=latest
BUILD ./deploy/dynamo/operator+docker --CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE --CI_COMMIT_SHA=$CI_COMMIT_SHA
BUILD ./deploy/dynamo/api-store+docker --CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE --CI_COMMIT_SHA=$CI_COMMIT_SHA
ARG DOCKER_SERVER=my-registry
ARG IMAGE_TAG=latest
BUILD ./deploy/dynamo/operator+docker --DOCKER_SERVER=$DOCKER_SERVER --IMAGE_TAG=$IMAGE_TAG
BUILD ./deploy/dynamo/api-store+docker --DOCKER_SERVER=$DOCKER_SERVER --IMAGE_TAG=$IMAGE_TAG

all-lint:
BUILD ./deploy/dynamo/operator+lint
Expand All @@ -189,6 +189,6 @@ all:

# For testing
custom:
ARG CI_REGISTRY_IMAGE=my-registry
ARG CI_COMMIT_SHA=latest
ARG DOCKER_SERVER=my-registry
ARG IMAGE_TAG=latest
BUILD +all-test
6 changes: 3 additions & 3 deletions deploy/dynamo/api-store/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ uv-base:
RUN uv sync --frozen --no-install-project --no-dev --no-install-workspace --no-editable

docker:
ARG CI_REGISTRY_IMAGE=my-registry
ARG CI_COMMIT_SHA=latest
ARG DOCKER_SERVER=my-registry
ARG IMAGE_TAG=latest
ARG IMAGE=dynamo-api-store
FROM +uv-base
# Copy project files
COPY ai_dynamo_store ai_dynamo_store
RUN uv pip install .
ENTRYPOINT ["ai-dynamo-store"]
SAVE IMAGE --push $CI_REGISTRY_IMAGE/$IMAGE:$CI_COMMIT_SHA
SAVE IMAGE --push $DOCKER_SERVER/$IMAGE:$IMAGE_TAG
74 changes: 43 additions & 31 deletions deploy/dynamo/helm/README.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ You can build and push Docker images for the Dynamo cloud components (API server

First, set the required environment variables:
```bash
export CI_REGISTRY_IMAGE=<CONTAINER_REGISTRY>/<ORGANIZATION>
export CI_COMMIT_SHA=<TAG>
export DOCKER_SERVER=<CONTAINER_REGISTRY>
export IMAGE_TAG=<TAG>
```

As a description of the placeholders:
- `<CONTAINER_REGISTRY>/<ORGANIZATION>`: Your container registry and organization name (e.g., `nvcr.io/myorg`, `docker.io/myorg`, etc.)
- `<CONTAINER_REGISTRY>`: Your container registry (e.g., `nvcr.io`, `docker.io/<your-username>`, etc.)
- `<TAG>`: The tag you want to use for the image (e.g., `latest`, `0.0.1`, etc.)

Note: Make sure you're logged in to your container registry before pushing images. For example:
Expand All @@ -45,56 +45,68 @@ docker login <CONTAINER_REGISTRY>

You can build each component individually or build all components at once:

#### Option 1: Build All Components at Once
#### Build and push platform components
```bash
earthly --push +all-docker --CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE --CI_COMMIT_SHA=$CI_COMMIT_SHA
earthly --push +all-docker --DOCKER_SERVER=$DOCKER_SERVER --IMAGE_TAG=$IMAGE_TAG
```

#### Option 2: Build Components Individually
## Deploy Dynamo Cloud Platform

### Prerequisites
Before deploying Dynamo Cloud, ensure your Kubernetes cluster meets the following requirements:

#### 1. Istio Installation
Dynamo Cloud requires Istio for service mesh capabilities. Verify Istio is installed and running:

1. **API Store**
```bash
cd deploy/dynamo/api-store
earthly --push +docker --CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE --CI_COMMIT_SHA=$CI_COMMIT_SHA
# 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. **Operator**
#### 2. PVC Support with Default Storage Class
Dynamo Cloud requires Persistent Volume Claim (PVC) support with a default storage class. Verify your cluster configuration:

```bash
cd deploy/dynamo/operator
earthly --push +docker --CI_REGISTRY_IMAGE=$CI_REGISTRY_IMAGE --CI_COMMIT_SHA=$CI_COMMIT_SHA
```
# Check if default storage class exists
kubectl get storageclass

## Deploy Dynamo Cloud Platform
# 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
```

Pre-requisite: make sure your terminal is set in the `deploy/dynamo/helm/` directory.
### Installation

1. Set the required environment variables:
```bash
cd deploy/dynamo/helm
export KUBE_NS=hello-world # change this to whatever you want!
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!
```

1. [One-time Action] Create a new kubernetes namespace and set it as your default. Create image pull secrets if needed.
2. [One-time Action] Create a new kubernetes namespace and set it as your default. Create image pull secrets if needed.

```bash
kubectl create namespace $KUBE_NS
kubectl config set-context --current --namespace=$KUBE_NS
cd deploy/dynamo/helm
kubectl create namespace $NAMESPACE
kubectl config set-context --current --namespace=$NAMESPACE

# [Optional] if needed, create image pull secrets
kubectl create secret docker-registry docker-imagepullsecret \
--docker-server=<your-registry> \
--docker-username=<your-username> \
--docker-password=<your-password> \
--namespace=$KUBE_NS
--docker-server=$DOCKER_SERVER \
--docker-username=$DOCKER_USERNAME \
--docker-password=$DOCKER_PASSWORD \
--namespace=$NAMESPACE
```

2. Deploy the helm chart using the deploy script:
3. Deploy the helm chart using the deploy script:

```bash
export NGC_TOKEN=$NGC_API_TOKEN
export NAMESPACE=$KUBE_NS
export CI_COMMIT_SHA=<TAG> # Use the same tag you used when building the images
export CI_REGISTRY_IMAGE=<CONTAINER_REGISTRY>/<ORGANIZATION> # Use the same registry/org you used when building the images
export RELEASE_NAME=$KUBE_NS

./deploy.sh
```
37 changes: 22 additions & 15 deletions deploy/dynamo/helm/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,27 @@ set -euo pipefail
HELM_CMD=$(which helm)

# Set default values only if not already set
export NAMESPACE="${NAMESPACE:=cai-system}" # Default namespace
export NGC_TOKEN="${NGC_TOKEN:=<your-ngc-token>}" # Default NGC token
export CI_REGISTRY_IMAGE="${CI_REGISTRY_IMAGE:=<your-registry>/<your-org>}" # Default registry/org
export CI_COMMIT_SHA="${CI_COMMIT_SHA:=250e2e0f93f7af3d83a4a0ff992e56956f7651f2}" # Default commit SHA
export RELEASE_NAME="${RELEASE_NAME:=dynamo-platform}" # Default release name
export DYNAMO_INGRESS_SUFFIX="${DYNAMO_INGRESS_SUFFIX:=}"
export NAMESPACE="${NAMESPACE:=dynamo-cloud}" # Default namespace
export RELEASE_NAME="${RELEASE_NAME:=${NAMESPACE}}" # Default release name is same as namespace
export DOCKER_USERNAME="${DOCKER_USERNAME:=<your-docker-username>}" # Default docker username
export DOCKER_PASSWORD="${DOCKER_PASSWORD:=<your-docker-password>}" # Default docker password
export DOCKER_SERVER="${DOCKER_SERVER:=<your-docker-server>}" # Default docker server
export IMAGE_TAG="${IMAGE_TAG:=latest}" # Default image tag
export DYNAMO_INGRESS_SUFFIX="${DYNAMO_INGRESS_SUFFIX:=dynamo-cloud.com}"

# Check if required variables are set
if [ "$NGC_TOKEN" = "<your-ngc-token>" ]; then
echo "Error: Please set your NGC_TOKEN in the script or via environment variable"
if [ "$DOCKER_USERNAME" = "<your-docker-username>" ]; then
echo "Error: Please set your DOCKER_USERNAME in the script or via environment variable"
exit 1
fi

if [ "$CI_REGISTRY_IMAGE" = "<your-registry>/<your-org>" ]; then
echo "Error: Please set your CI_REGISTRY_IMAGE in the script or via environment variable"
if [ "$DOCKER_PASSWORD" = "<your-docker-password>" ]; then
echo "Error: Please set your DOCKER_PASSWORD in the script or via environment variable"
exit 1
fi

if [ "$DOCKER_SERVER" = "<your-docker-server>" ]; then
echo "Error: Please set your DOCKER_SERVER in the script or via environment variable"
exit 1
fi

Expand Down Expand Up @@ -76,15 +82,16 @@ cd ..
# Generate the values file
echo "Generating values file with:"
echo "NAMESPACE: $NAMESPACE"
echo "CI_COMMIT_SHA: $CI_COMMIT_SHA"
echo "CI_REGISTRY_IMAGE: $CI_REGISTRY_IMAGE"
echo "NGC_TOKEN: [HIDDEN]"
echo "RELEASE_NAME: $RELEASE_NAME"
echo "IMAGE_TAG: $IMAGE_TAG"
echo "DOCKER_USERNAME: $DOCKER_USERNAME"
echo "DOCKER_SERVER: $DOCKER_SERVER"
echo "DOCKER_PASSWORD: [HIDDEN]"

echo "generated file contents:"
envsubst '${NAMESPACE} ${NGC_TOKEN} ${CI_COMMIT_SHA} ${RELEASE_NAME} ${DYNAMO_INGRESS_SUFFIX} ${CI_REGISTRY_IMAGE}' < dynamo-platform-values.yaml
envsubst '${NAMESPACE} ${RELEASE_NAME} ${DOCKER_USERNAME} ${DOCKER_PASSWORD} ${DOCKER_SERVER} ${IMAGE_TAG} ${DYNAMO_INGRESS_SUFFIX}' < dynamo-platform-values.yaml

envsubst '${NAMESPACE} ${NGC_TOKEN} ${CI_COMMIT_SHA} ${RELEASE_NAME} ${DYNAMO_INGRESS_SUFFIX} ${CI_REGISTRY_IMAGE}' < dynamo-platform-values.yaml > generated-values.yaml
envsubst '${NAMESPACE} ${RELEASE_NAME} ${DOCKER_USERNAME} ${DOCKER_PASSWORD} ${DOCKER_SERVER} ${IMAGE_TAG} ${DYNAMO_INGRESS_SUFFIX}' < dynamo-platform-values.yaml > generated-values.yaml

echo ""
echo "Generated values file saved as generated-values.yaml"
Expand Down
87 changes: 12 additions & 75 deletions deploy/dynamo/helm/dynamo-platform-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,117 +12,54 @@
# 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.
existingImagePullSecret: nvcrimagepullsecret

# Global values used across charts
global:
NGC_API_KEY: ${NGC_TOKEN}
NGC_API_KEY: ${DOCKER_PASSWORD}

dynamo-operator:
enabled: true
natsAddr: "nats://${RELEASE_NAME}-nats:4222"
etcdAddr: "${RELEASE_NAME}-etcd:2379"
istioVirtualServiceEnabled: false
ingressControllerClassName: ""
namespaceRestriction:
enabled: true
targetNamespace: ${NAMESPACE}
controllerManager:
manager:
image:
repository: ${CI_REGISTRY_IMAGE}/dynamo-operator
tag: ${CI_COMMIT_SHA}
args:
- --health-probe-bind-address=:8081
- --metrics-bind-address=127.0.0.1:8080
repository: ${DOCKER_SERVER}/dynamo-operator
tag: ${IMAGE_TAG}
F438
dynamo:
dynamoIngressSuffix: ${DYNAMO_INGRESS_SUFFIX}
yatai:
endpoint: http://dynamo-store
clusterName: default

yataiSystem:
namespace: ""

internalImages:
bentoDownloader: quay.io/bentoml/bento-downloader:0.0.5
kaniko: quay.io/bentoml/kaniko:debug
buildkit: quay.io/bentoml/buildkit:master
buildkitRootless: quay.io/bentoml/buildkit:master-rootless
metricsTransformer: quay.io/bentoml/yatai-bento-metrics-transformer:0.0.4
debugger: quay.io/bentoml/bento-debugger:0.0.8
monitorExporter: quay.io/bentoml/bentoml-monitor-exporter:0.0.3
proxy: quay.io/bentoml/bentoml-proxy:0.0.1

disableAutomateBentoImageBuilder: false
enableRestrictedSecurityContext: false
disableYataiComponentRegistration: false

dockerRegistry:
server: 'nvcr.io/nvidian/nim-llm-dev'
inClusterServer: ''
username: '$oauthtoken'
passwordExistingSecretName: 'nvcrimagepullsecret'
secure: true
bentoRepositoryName: yatai-bentos

bentoImageBuildEngine: buildkit
addNamespacePrefixToImageName: false

estargz:
enabled: false

kaniko:
cacheRepo: ''
snapshotMode: ''
server: ${DOCKER_SERVER}
username: ${DOCKER_USERNAME}
password: ${DOCKER_PASSWORD}

dynamo-api-store:
enabled: true
namespaceRestriction:
enabled: true
targetNamespace: ${NAMESPACE}
istio:
host: ${NAMESPACE}.dev.aire.nvidia.com
dynamo:
env:
resource_scope: "user"
host: ${NAMESPACE}.${DYNAMO_INGRESS_SUFFIX}
image:
repository: ${CI_REGISTRY_IMAGE}/dynamo-api-store
tag: ${CI_COMMIT_SHA}
repository: ${DOCKER_SERVER}/dynamo-api-store
tag: ${IMAGE_TAG}
pullPolicy: IfNotPresent
imagePullSecrets:
- name: nvcrimagepullsecret
- name: docker-imagepullsecret
- name: gitlab-imagepull
ingress:
enabled: true
className: nginx
hosts:
- host: ${NAMESPACE}.dev.aire.nvidia.com
- host: ${NAMESPACE}.${DYNAMO_INGRESS_SUFFIX}
paths:
- path: /
pathType: Prefix
postgresql:
primary:
persistence:
enabled: false
minio:
persistence:
enabled: true
size: 5Gi
storageClass: "local-path"
apiIngress:
enabled: false
ingressClassName: nginx
hostname: minio.example.com
pathType: Prefix

etcd:
enabled: true
persistence:
enabled: true
storageClass: "local-path"
storageClass: ""
size: 1Gi
preUpgrade:
enabled: false
Expand All @@ -135,4 +72,4 @@ nats:
fileStore:
pvc:
size: 1Gi
storageClassName: "local-path"
storageClassName: ""
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ spec:
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 1000Gi
Expand Down
Loading
Loading
0