kind: Job
apiVersion: batch/v1
metadata:
  name: $APP_NAME-$BUILD_NUMBER
  namespace: $PROJECT_NAMESPACE
spec:
  #backoffLimit: 5
  template:
    spec:
      initContainers:
      - name: prepare-wordvector
        # hub.data.wust.edu.cn:30880/ygtao/mnist-wordvector:v1.0
        image: $wordvector_IMAGE
        command: ['sh', '-c', 'mv /wordvector/* /tempdir;echo the init container is used to prepare wordvector for your code!']
        volumeMounts:
        - name: shared-wordvector
          mountPath: /tempdir
      containers:
        - name: $APP_NAME-$BUILD_NUMBER
          image: $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:SNAPSHOT-$BUILD_NUMBER
          volumeMounts:
          - name: shared-wordvector
            mountPath: /wordvector
          resources:
            limits:
              nvidia.com/gpu: 1
          imagePullPolicy: IfNotPresent
      imagePullSecrets:
       - name: $HARBOR_LOGIN_SECRET_NAME
      restartPolicy: Never
      volumes:
      - name: shared-wordvector
        emptyDir: {}