apiVersion: batch/v1
kind: Job
metadata:
  name: dhealth-job-inference-$PART
spec:
  ttlSecondsAfterFinished: 0 #to be automatically deleted, 0 seconds after it finishes.
  completions: 1
  template:
    metadata:
      name: dhealth-pod-inference
    spec:    
      volumes:
        - name: dhealth-volume
          persistentVolumeClaim:
            claimName: dhealth-pvc
      containers:
      - name: dhealth-pylibs
        image: dhealth/pylibs:latest
        volumeMounts:
          - name: dhealth-volume
            mountPath: /deephealth
        command: ["/bin/bash", "-c", "export OUTPUT_DIR=/deephealth/outputs; mkdir $OUTPUT_DIR/trash; nvidia-smi; python3 /deephealth/use_case_pipeline/python/skin_lesion_segmentation_inference.py /deephealth/dataset/isic_segmentation/$FILENAME /deephealth/models/isic_segm_checkpoint.bin --out-dir $OUTPUT_DIR/$PART --batch-size 2"]
        resources:
          limits:
            memory: "3072Mi"
            cpu: "3000m"
      restartPolicy: Never
