Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
86bc5442
"lib/engines/git@developer.sourcefind.cn:OpenDAS/dynamo.git" did not exist on "ceaeba3e3858432fd8b5e696eb6c2c8a64ffd632"
Commit
86bc5442
authored
Mar 11, 2025
by
julienmancuso
Committed by
GitHub
Mar 11, 2025
Browse files
feat: add script to deploy a Dynemo pipeline in k8s using helm (#42)
parent
3f84cdad
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
219 additions
and
0 deletions
+219
-0
deploy/Kubernetes/pipeline/README.md
deploy/Kubernetes/pipeline/README.md
+16
-0
deploy/Kubernetes/pipeline/chart/Chart.yaml
deploy/Kubernetes/pipeline/chart/Chart.yaml
+21
-0
deploy/Kubernetes/pipeline/chart/templates/deployment.yaml
deploy/Kubernetes/pipeline/chart/templates/deployment.yaml
+70
-0
deploy/Kubernetes/pipeline/chart/templates/service.yaml
deploy/Kubernetes/pipeline/chart/templates/service.yaml
+28
-0
deploy/Kubernetes/pipeline/deploy.sh
deploy/Kubernetes/pipeline/deploy.sh
+84
-0
No files found.
deploy/Kubernetes/pipeline/README.md
0 → 100644
View file @
86bc5442
# deploy Dynamo pipeline on Kubernetes
This is a proof of concept for a Helm chart to deploy services defined in a bento.yaml configuration.
## Usage
### Prerequisites
-
make sure dynamo cli is installed
### Install the Helm chart
```
bash
./deploy.sh <docker_registry> <k8s_namespace> <bento_name> <path_to_bento_directory>
# example./deploy.sh nvcr.io/nvidian/nim-llm-dev my-namespace my-helm-poc ../deploy/compoundai/sdk/examples/basic_service
```
\ No newline at end of file
deploy/Kubernetes/pipeline/chart/Chart.yaml
0 → 100644
View file @
86bc5442
# 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.
apiVersion
:
v2
name
:
dynamo-pipeline
description
:
A Helm chart to deploy a Dynamo pipeline on Kubernetes
type
:
application
version
:
0.1.0
appVersion
:
1.0.0
deploy/Kubernetes/pipeline/chart/templates/deployment.yaml
0 → 100644
View file @
86bc5442
# 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.
{{
- range .Values.services
}}
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
poc-{{ .name | lower }}
labels
:
app
:
{{
.name | lower
}}
spec
:
replicas
:
1
selector
:
matchLabels
:
app
:
poc-{{ .name | lower }}
template
:
metadata
:
labels
:
app
:
poc-{{ .name | lower }}
spec
:
# pull secrets
imagePullSecrets
:
-
name
:
yatai-regcred
securityContext
:
runAsUser
:
0
containers
:
-
name
:
poc-{{ .name | lower }}
image
:
{{
$.Values.image
}}
args
:
-
uv run compoundai start --service-name {{ .name }}
command
:
-
sh
-
-c
resources
:
requests
:
cpu
:
"
{{
.config.resources.cpu
}}"
limits
:
cpu
:
"
{{
.config.resources.cpu
}}"
env
:
-
name
:
TRAFFIC_TIMEOUT
value
:
"
{{
.config.traffic.timeout
}}"
{{
- if and .config.nova .config.nova.enabled
}}
-
name
:
NOVA_NAMESPACE
value
:
"
{{
.config.nova.namespace
}}"
-
name
:
NOVA_NAME
value
:
"
{{
.config.nova.name
}}"
{{
- end
}}
{{
- if .config.workers
}}
-
name
:
WORKERS
value
:
"
{{
.config.workers
}}"
{{
- end
}}
-
name
:
PORT
value
:
"
3000"
-
name
:
NATS_SERVER
value
:
nats://my-nats:4222
-
name
:
ETCD_ENDPOINTS
value
:
etcd:2379
---
{{
- end
}}
deploy/Kubernetes/pipeline/chart/templates/service.yaml
0 → 100644
View file @
86bc5442
# 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.
{{
- range .Values.services
}}
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
{{
.name | lower
}}
spec
:
selector
:
app
:
{{
.name | lower
}}
ports
:
-
protocol
:
TCP
port
:
80
targetPort
:
3000
---
{{
- end
}}
deploy/Kubernetes/pipeline/deploy.sh
0 → 100755
View file @
86bc5442
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2024-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.
set
-euo
pipefail
# Validate input parameters
if
[
"$#"
-ne
4
]
;
then
echo
"Usage:
$0
<DOCKER_REGISTRY> <NAMESPACE> <BENTO_NAME> <BENTO_DIRECTORY>"
exit
1
fi
DOCKER_REGISTRY
=
$1
NAMESPACE
=
$2
BENTO_NAME
=
$3
BENTO_DIRECTORY
=
$4
# Check if any of the inputs are empty
if
[[
-z
"
$DOCKER_REGISTRY
"
||
-z
"
$NAMESPACE
"
||
-z
"
$BENTO_NAME
"
||
-z
"
$BENTO_DIRECTORY
"
]]
;
then
echo
"Error: All input parameters (DOCKER_REGISTRY, NAMESPACE, BENTO_NAME, BENTO_DIRECTORY) must be non-empty."
exit
1
fi
# Check if the specified directory exists
if
[
!
-d
"
$BENTO_DIRECTORY
"
]
;
then
echo
"Error: Directory
$BENTO_DIRECTORY
does not exist."
exit
1
fi
echo
"Logging into Docker registry:
$DOCKER_REGISTRY
"
docker login
"
$DOCKER_REGISTRY
"
# Change to the specified directory
cd
"
$BENTO_DIRECTORY
"
# Update the bentofile.yaml with the new BENTO_NAME
echo
"Updating bentofile.yaml with name:
$BENTO_NAME
"
yq
eval
".name =
\"
$BENTO_NAME
\"
"
-i
bentofile.yaml
# Build the Bento container
echo
"Building Bento image for
$BENTO_NAME
..."
DOCKER_DEFAULT_PLATFORM
=
linux/amd64 uv run dynamo build
--containerize
# Find the built image
docker_image
=
$(
docker images
--format
"{{.Repository}}:{{.Tag}} {{.CreatedAt}}"
|
grep
"^
$BENTO_NAME
:"
|
sort
-r
|
head
-n
1 |
awk
'{print $1}'
)
if
[[
-z
"
$docker_image
"
]]
;
then
echo
"Failed to find the built image for
$BENTO_NAME
"
exit
1
fi
# Extract the image tag (SHA) from the docker image info
docker_sha
=
$(
echo
"
$docker_image
"
|
awk
-F
':'
'{print $2}'
)
echo
"Found Docker image:
$docker_image
"
echo
"Docker SHA (bento-version):
$docker_sha
"
# Tag the image for the registry
docker_tag_for_registry
=
"
$DOCKER_REGISTRY
/
$docker_image
"
echo
"Tagging image:
$docker_tag_for_registry
"
docker tag
"
$docker_image
"
"
$docker_tag_for_registry
"
# Push the image
echo
"Pushing image:
$docker_tag_for_registry
"
docker push
"
$docker_tag_for_registry
"
cd
-
# Install the Helm chart with the correct bento-version (SHA)
echo
"Installing Helm chart with image:
$docker_tag_for_registry
and bento-version:
$docker_sha
"
helm
install
"
$BENTO_NAME
"
./poc
-f
~/bentoml/bentos/
"
$BENTO_NAME
"
/
"
$docker_sha
"
/bento.yaml
--set
image
=
"
$docker_tag_for_registry
"
-n
"
$NAMESPACE
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment