Skip to content

Commit 45e2d16

Browse files
julienmancusonnshah1
authored andcommitted
feat: Add support for model express url injection (#2769)
Signed-off-by: Julien Mancuso <jmancuso@nvidia.com> Signed-off-by: nnshah1 <neelays@nvidia.com>
1 parent 27f305b commit 45e2d16

File tree

11 files changed

+56
-6
lines changed

11 files changed

+56
-6
lines changed

deploy/cloud/helm/platform/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies:
3535
repository: "https://charts.bitnami.com/bitnami"
3636
condition: etcd.enabled
3737
- name: kai-scheduler
38-
version: v0.8.1
38+
version: v0.8.4
3939
repository: oci://ghcr.io/nvidia/kai-scheduler
4040
condition: kai-scheduler.enabled
4141
- name: grove-charts

deploy/cloud/helm/platform/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The Dynamo Platform Helm chart deploys the complete Dynamo Cloud infrastructure
4848
| https://charts.bitnami.com/bitnami | etcd | 11.1.0 |
4949
| https://nats-io.github.io/k8s/helm/charts/ | nats | 1.3.2 |
5050
| oci://ghcr.io/nvidia/grove | grove(grove-charts) | v0.0.0-6e30275 |
51-
| oci://ghcr.io/nvidia/kai-scheduler | kai-scheduler | v0.8.1 |
51+
| oci://ghcr.io/nvidia/kai-scheduler | kai-scheduler | v0.8.4 |
5252

5353
## Values
5454

@@ -57,6 +57,8 @@ The Dynamo Platform Helm chart deploys the complete Dynamo Cloud infrastructure
5757
| dynamo-operator.enabled | bool | `true` | Whether to enable the Dynamo Kubernetes operator deployment |
5858
| dynamo-operator.natsAddr | string | `""` | NATS server address for operator communication (leave empty to use the bundled NATS chart). Format: "nats://hostname:port" |
5959
| dynamo-operator.etcdAddr | string | `""` | etcd server address for operator state storage (leave empty to use the bundled etcd chart). Format: "http://hostname:port" or "https://hostname:port" |
60+
| dynamo-operator.modelExpressURL | string | `""` | URL for the Model Express server if not deployed by this helm chart. This is ignored if Model Express server is installed by this helm chart (global.model-express.enabled is true). |
61+
| dynamo-operator.namespaceRestriction | object | `{"enabled":true,"targetNamespace":null}` | Namespace access controls for the operator |
6062
| dynamo-operator.namespaceRestriction.enabled | bool | `true` | Whether to restrict operator to specific namespaces |
6163
| dynamo-operator.namespaceRestriction.targetNamespace | string | `nil` | Target namespace for operator deployment (leave empty for current namespace) |
6264
| dynamo-operator.controllerManager.tolerations | list | `[]` | Node tolerations for controller manager pods |

deploy/cloud/helm/platform/components/operator/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ spec:
104104
{{- if .Values.dynamo.groveTerminationDelay }}
105105
- --grove-termination-delay={{ .Values.dynamo.groveTerminationDelay }}
106106
{{- end }}
107+
{{- if .Values.modelExpressURL }}
108+
- --model-express-url={{ .Values.modelExpressURL }}
109+
{{- end }}
107110
command:
108111
- /manager
109112
env:

deploy/cloud/helm/platform/components/operator/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,5 @@ metricsService:
112112

113113
natsAddr: ""
114114
etcdAddr: ""
115+
modelExpressURL: ""
116+

deploy/cloud/helm/platform/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ dynamo-operator:
2727
# -- etcd server address for operator state storage (leave empty to use the bundled etcd chart). Format: "http://hostname:port" or "https://hostname:port"
2828
etcdAddr: ""
2929

30-
# Namespace access controls for the operator
30+
# -- URL for the Model Express server if not deployed by this helm chart. This is ignored if Model Express server is installed by this helm chart (global.model-express.enabled is true).
31+
modelExpressURL: ""
32+
# -- Namespace access controls for the operator
3133
namespaceRestriction:
3234
# -- Whether to restrict operator to specific namespaces
3335
enabled: true

deploy/cloud/operator/cmd/main.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"context"
2424
"crypto/tls"
2525
"flag"
26+
"net/url"
2627
"os"
2728
"time"
2829

@@ -130,6 +131,7 @@ func main() {
130131
var ingressControllerTLSSecretName string
131132
var ingressHostSuffix string
132133
var groveTerminationDelay time.Duration
134+
var modelExpressURL string
133135
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
134136
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
135137
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
@@ -157,12 +159,23 @@ func main() {
157159
"The suffix to use for the ingress host")
158160
flag.DurationVar(&groveTerminationDelay, "grove-termination-delay", consts.DefaultGroveTerminationDelay,
159161
"The termination delay for Grove PodGangSets")
162+
flag.StringVar(&modelExpressURL, "model-express-url", "",
163+
"URL of the Model Express server to inject into all pods")
160164
opts := zap.Options{
161165
Development: true,
162166
}
163167
opts.BindFlags(flag.CommandLine)
164168
flag.Parse()
165169

170+
// Validate modelExpressURL if provided
171+
if modelExpressURL != "" {
172+
if _, err := url.Parse(modelExpressURL); err != nil {
173+
setupLog.Error(err, "invalid model-express-url provided", "url", modelExpressURL)
174+
os.Exit(1)
175+
}
176+
setupLog.Info("Model Express URL configured", "url", modelExpressURL)
177+
}
178+
166179
ctrlConfig := commonController.Config{
167180
RestrictedNamespace: restrictedNamespace,
168181
Grove: commonController.GroveConfig{
@@ -183,6 +196,7 @@ func main() {
183196
IngressControllerTLSSecret: ingressControllerTLSSecretName,
184197
IngressHostSuffix: ingressHostSuffix,
185198
},
199+
ModelExpressURL: modelExpressURL,
186200
}
187201

188202
mainCtx := ctrl.SetupSignalHandler()

deploy/cloud/operator/internal/controller_common/predicate.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ type Config struct {
5656
EtcdAddress string
5757
NatsAddress string
5858
IngressConfig IngressConfig
59+
// ModelExpressURL is the URL of the Model Express server to inject into all pods
60+
ModelExpressURL string
5961
}
6062

6163
type IngressConfig struct {

deploy/cloud/operator/internal/dynamo/graph.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,13 @@ func addStandardEnvVars(container *corev1.Container, controllerConfig controller
673673
Value: controllerConfig.EtcdAddress,
674674
})
675675
}
676+
677+
if controllerConfig.ModelExpressURL != "" {
678+
container.Env = append(container.Env, corev1.EnvVar{
679+
Name: "MODEL_EXPRESS_URL",
680+
Value: controllerConfig.ModelExpressURL,
681+
})
682+
}
676683
}
677684

678685
// GenerateBasePodSpec creates a basic PodSpec with common logic shared between controller and grove

deploy/cloud/operator/internal/dynamo/graph_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,9 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
10651065
args: args{
10661066
ctx: context.Background(),
10671067
controllerConfig: controller_common.Config{
1068-
EtcdAddress: "etcd-address",
1069-
NatsAddress: "nats-address",
1068+
EtcdAddress: "etcd-address",
1069+
NatsAddress: "nats-address",
1070+
ModelExpressURL: "model-express-url",
10701071
Grove: controller_common.GroveConfig{
10711072
TerminationDelay: 15 * time.Minute,
10721073
},
@@ -1343,6 +1344,10 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
13431344
Name: "DYN_PARENT_DGD_K8S_NAMESPACE",
13441345
Value: "test-namespace",
13451346
},
1347+
{
1348+
Name: "MODEL_EXPRESS_URL",
1349+
Value: "model-express-url",
1350+
},
13461351
},
13471352
Resources: corev1.ResourceRequirements{
13481353
Requests: corev1.ResourceList{
@@ -1474,6 +1479,10 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
14741479
Name: "DYN_PARENT_DGD_K8S_NAMESPACE",
14751480
Value: "test-namespace",
14761481
},
1482+
{
1483+
Name: "MODEL_EXPRESS_URL",
1484+
Value: "model-express-url",
1485+
},
14771486
},
14781487
Resources: corev1.ResourceRequirements{
14791488
Requests: corev1.ResourceList{

deploy/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ services:
3434
- monitoring
3535

3636
etcd-server:
37-
image: bitnami/etcd:3.6.1
37+
image: bitnamilegacy/etcd:3.6.1
3838
environment:
3939
- ALLOW_NONE_AUTHENTICATION=yes
4040
ports:

0 commit comments

Comments
 (0)