apiVersion: kubeflow.org/v1
kind: TFJob
metadata:
  name: tfjob-deep-gpu
  namespace: kubeflow
spec:
  tfReplicaSpecs:
    Worker:
      replicas: 1
      restartPolicy: OnFailure
      template:
        spec:
          containers:
          - name: tensorflow
            image: gcr.io/<project>/<image-name>/gpu:v1
            command:
              - python
              - run_preprocess_train_deploy.py
              - --model=DeepModel
              - --epochs=30001
              - --bucket=<BUCKET_NAME>
              - --tag=v3
            workingDir: "/opt/workdir"
            env:
            - name: GOOGLE_APPLICATION_CREDENTIALS
              value: "/secret/gcp-credentials/user-gcp-sa.json"
            resources:
              limits:
                nvidia.com/gpu: 1
            volumeMounts:
            - name: sa
              mountPath: "/secret/gcp-credentials"
              readOnly: true
          volumes:
          - name: sa
            secret:
              secretName: user-gcp-sa