---
apiVersion: batch/v1
kind: Job
metadata:
  name: export-tf-graph
spec:
  template:
    spec:
      containers:
      - name: export-tf-graph
        image: lcastell/pets_object_detection
        imagePullPolicy: IfNotPresent
        workingDir: "/"
        command:
          - "python"
          - "models/research/object_detection/export_inference_graph.py"
        args:
          - "--input_type=image_tensor"
          - "--pipeline_config_path=/pets_data/faster_rcnn_resnet101_pets.config"
          - "--trained_checkpoint_prefix=/pets_data/train/model.ckpt-<number>"
          - "--output_directory=/pets_data/exported_graphs"
        volumeMounts:
          - mountPath: "/pets_data"
            name: pets-data
      volumes:
        - name: pets-data
          persistentVolumeClaim:
            claimName: pets-data-claim
      restartPolicy: Never
  backoffLimit: 4