apiVersion: batch/v1
kind: Job
metadata:
  name: cifar10-single-job-$ITEM
spec:
  parallelism: 1
  template:
    metadata:
      name: cifar10-single-job
      labels:
        app: cifar10-single-job
    spec:
      restartPolicy: Never
      containers:
       - name: pytorch
         image: registry.cn-hangzhou.aliyuncs.com/nvidia_gpu/pytorch:18.06-py3
         workingDir: /cifar10-training
         env:
         - name: JOB_ID
           value: "$ITEM"
         command: ["bash"]
         args: ["-c","python cifar10_train.py"]
         resources:
           limits:
             nvidia.com/gpu: 1
         volumeMounts:
         - name: cifar10-dataset
           mountPath: /datasets
      volumes:
      - name: cifar10-dataset
        nfs:
          server: 39.106.67.247
          path: /nfsshare/
