# 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:
  backendFramework: vllm
  services:
    Frontend:
      livenessProbe:
        exec:
          command:
            - /bin/sh
            - -c
            - 'echo ok'
        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/custom_backend/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
            - "exit 0"
        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/custom_backend/hello_world/
          command:
            - /bin/sh
            - -c
          args:
            - python3 hello_world.py
