# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: batch/v1
kind: Job
metadata:
  name: profile-sla
  namespace: ${NAMESPACE}
spec:
  template:
    spec:
      serviceAccountName: profile-sla-sa
      containers:
      - name: profile-sla
        image: ${DOCKER_IMAGE}
        resources:
          requests:
            cpu: "16"
            memory: "10Gi"
        env:
          - name: HUGGING_FACE_HUB_TOKEN
            valueFrom:
              secretKeyRef:
                name: hf-token-secret
                key: HF_TOKEN
          - name: NATS_SERVER
            value: nats://${NAMESPACE}-nats:4222
          - name: ETCD_ENDPOINTS
            value: ${NAMESPACE}-etcd:2379
        command: ["python", "/workspace/benchmarks/profiler/profile_sla.py"]
        args:
          - --config
          - ${DGD_CONFIG_FILE}
          - --output-dir
          - /workspace/profiling_results
          - --namespace
          - ${NAMESPACE}
          - --backend
          - vllm
          - --min-num-gpus-per-engine
          - "1"
          - --max-num-gpus-per-engine
          - "8"
          - --isl
          - "3000"
          - --osl
          - "150"
          - --ttft
          - "200"
          - --itl
          - "20"
        volumeMounts:
          - name: output-volume
            mountPath: /workspace/profiling_results
      restartPolicy: Never
      volumes:
        - name: output-volume
          persistentVolumeClaim:
            claimName: profiling-pvc
  backoffLimit: 0
