# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
apiVersion: batch/v1
kind: Job
metadata:
  name: qwen3-vl-30b-generate-datasets
spec:
  backoffLimit: 1
  completions: 1
  parallelism: 1
  template:
    metadata:
      labels:
        app: generate-datasets
    spec:
      restartPolicy: Never
      securityContext:
        runAsUser: 0
        runAsGroup: 0
        fsGroup: 0
      containers:
        - name: generate-datasets
          image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:1.0.0
          imagePullPolicy: IfNotPresent
          command:
            - /bin/bash
            - -lc
            - |
              set -euo pipefail

              GENERATOR_MAIN="/workspace/benchmarks/multimodal/jsonl/main.py"
              OUTPUT_DIR="/perf-cache/datasets"

              if [[ ! -f "${GENERATOR_MAIN}" ]]; then
                echo "Generator not found at ${GENERATOR_MAIN}"
                exit 1
              fi

              mkdir -p "${OUTPUT_DIR}"

              python3 "${GENERATOR_MAIN}" \
                -n 1000 \
                --images-per-request 1 \
                --images-pool 200 \
                --user-text-tokens 400 \
                --image-mode http \
                --image-dir /perf-cache/images \
                -o "${OUTPUT_DIR}/qwen3_vl_1000req_1img_pool200.jsonl"

              echo "Dataset generation complete in ${OUTPUT_DIR}"
          volumeMounts:
            - name: perf-cache
              mountPath: /perf-cache
      volumes:
        - name: perf-cache
          persistentVolumeClaim:
            claimName: perf-cache
