apiVersion: batch/v1
kind: Job
metadata:
  name: model-eval
spec:
  backoffLimit: 0
  template:
    metadata:
      labels:
        app: model-eval
        ml-platform: model-eval
    spec:
      containers:
      - name: job
        image: V_IMAGE_URL
        imagePullPolicy: Always
        command: ["/bin/sh"]
        args:
        - -c
        - |
          ACTION=predict python validate_fine_tuned_model.py
          ACTION=accuracy python validate_fine_tuned_model.py
        env:
        - name: "BUCKET"
          value: "V_DATA_BUCKET"
        - name: "DATASET_OUTPUT_PATH"
          value: "V_DATASET_OUTPUT_PATH"
        - name: "ENDPOINT"
          value: "V_ENDPOINT"
        - name: "MODEL_PATH"
          value: "V_MODEL_PATH"
        - name: "PREDICTIONS_FILE"
          value: "V_PREDICTIONS_FILE"
        resources:
          requests:
            cpu: "2"
            memory: "5Gi"
          limits:
            cpu: "2"
            memory: "5Gi"
      restartPolicy: Never
      serviceAccountName: V_KSA
      tolerations:
      - key: "on-demand"
        value: "true"
        operator: "Equal"
        effect: "NoSchedule"