---
apiVersion: batch/v1
kind: Job
metadata:
  labels:
    app: ktuner-tuner
  name: KTUNER_DEP_NAME
  namespace: NAMESPACE
spec:
  # replicas: 1
  template:
    metadata:
      labels:
        app: ktuner-tuner
        version: v1
    spec:
      containers:
      - args:
        - --epochs=EPOCHS
        - --tuner-dir=TUNER_DIR
        - --tuner-proj=TUNER_PROJ
        - --tuner-num=TUNER_NUM
        - --max-trials=MAX_TRIALS
        - --executions-per-trial=EXECS_PER_TRIAL
        - --num-best-hps=NUM_BEST_HPS
        - --respath=RES_PATH
        - --bucket-name=BUCKET_NAME
        image: gcr.io/google-samples/ml-pipeline-bikes-tuner
        env:
        - name: KERASTUNER_TUNER_ID
          value: KTUNER_ID
        - name: KERASTUNER_ORACLE_IP
          value: KTUNER_CHIEF
        - name: KERASTUNER_ORACLE_PORT
          value: "9000"
        imagePullPolicy: Always
        name: kktuner-tuner
        ports:
        - name: tuner-port
          containerPort: 9000
        resources:
          limits: {nvidia.com/gpu: 1}
      restartPolicy: Never
