apiVersion: batch/v1
kind: Job
metadata:
  name: awni-rnnt-2
spec:
  template:
    metadata:
      labels:
        experiment: awni-rnnt-2
    spec:
      securityContext:
        supplementalGroups: [5555]
      restartPolicy: OnFailure
      containers:
        - name: rnnt
          image: gcr.io/myrtle-deepspeech/awni-speech:first
          command: ["/bin/bash", "-c"]
          args: ["source speech/setup.sh && \
                cd speech && \
          			mkdir ~/Data5 && \
                python3 examples/librispeech/download.py ~/Data && \
                python3 examples/librispeech/preprocess.py ~/Data && \
                python3 train.py ~/speech/configs/strawperson.json"]
          imagePullPolicy: Always
          resources:
            limits:
              cpu: 7000m
              memory: 20Gi
              nvidia.com/gpu: 1
          volumeMounts:
            - name: aws-credentials
              mountPath: "/home/ubuntu/.aws/"
              readOnly: true
            - name: nfs-pvc
              mountPath: "/home/ubuntu/persistent"
            - name: in-memory-data
              mountPath: "/tmp/data/cache"
            - name: shm
              mountPath: "/dev/shm"

      volumes:
      - name: aws-credentials
        secret:
          secretName: aws-credentials
      - name: nfs-pvc
        persistentVolumeClaim:
          claimName: nfs-pvc
      - name: in-memory-data
        emptyDir:
          sizeLimit: 24Gi
          medium: "Memory"
      - name: shm
        emptyDir:
          sizeLimit: 2Gi
          medium: "Memory"
      nodeSelector:
        cloud.google.com/gke-accelerator: nvidia-tesla-v100
