# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

apiVersion: nvidia.com/v1alpha1
kind: DynamoGraphDeployment
metadata:
  name: hello-world
spec:
  services:
    Frontend:
      livenessProbe:
        httpGet:
          path: /health
          port: 8000
        initialDelaySeconds: 10
        periodSeconds: 10
        timeoutSeconds: 2
        failureThreshold: 3
      readinessProbe:
        exec:
          command:
            - /bin/sh
            - -c
            - 'echo ok'
        initialDelaySeconds: 10
        periodSeconds: 10
        timeoutSeconds: 2
        failureThreshold: 3
      dynamoNamespace: hello-world
      componentType: frontend
      replicas: 1
      resources:
        requests:
          cpu: "1"
          memory: "2Gi"
        limits:
          cpu: "1"
          memory: "2Gi"
      extraPodSpec:
        mainContainer:
          image: my-registry/dynamo:my-tag
          workingDir: /workspace/examples/runtime/hello_world/
          command:
            - /bin/sh
            - -c
          args:
            - "python3 client.py"
    HelloWorldWorker:
      livenessProbe:
        exec:
          command:
            - /bin/sh
            - -c
            - "exit 0"
        periodSeconds: 5
        timeoutSeconds: 2
        failureThreshold: 3
      readinessProbe:
        exec:
          command:
            - /bin/sh
            - -c
            - 'grep "Serving endpoint" /tmp/hello_world.log'
        initialDelaySeconds: 60
        periodSeconds: 60
        timeoutSeconds: 30
        failureThreshold: 10
      dynamoNamespace: hello-world
      componentType: worker
      replicas: 1
      resources:
        requests:
          cpu: "1"
          memory: "4Gi"
        limits:
          cpu: "1"
          memory: "4Gi"
      extraPodSpec:
        mainContainer:
          image: my-registry/dynamo:my-tag
          workingDir: /workspace/examples/runtime/hello_world/
          command:
            - /bin/sh
            - -c
          args:
            - python3 hello_world.py 2>&1 | tee /tmp/hello_world.log
