apiVersion: batch/v1
kind: Job
metadata:
  name: kyu-automl-template
spec:
  activeDeadlineSeconds: 345600 # 4-days
  template:
    spec:
      restartPolicy: Never
      securityContext:
        runAsUser: 168151
        fsGroup: 11166
      containers:
      - name: pytorch-automl-framework
        # image: ic-registry.epfl.ch/cvlab-k8s-master/pytorch:19.05-py3
        image: ic-registry.epfl.ch/cvlab-k8s-master/automl-pytorch1.2:cuda10.0
        command: ['sleep', 'infinity']
        workingDir: /home/kyu/pycharm/automl
        env:
        - name: ROLE
          value: worker
        - name: HOME
          value: /home/kyu
        - name: PYTHONPATH
          value: /home/kyu/pycharm/automl:/home/kyu/pycharm/nasbench
        resources:
          limits:
            nvidia.com/gpu: 1 # requests one GPU
        volumeMounts:
        # mount the data volumes
        - mountPath: /home/kyu/python
          name: cvlabdata2
          subPath: /cvlabdata2/python/path
        - mountPath: /home/kyu
          name: cvlabdata2
          subPath: home/kyu
        - mountPath: /cvlabdata2
          name: cvlabdata2
      volumes:
      - name: cvlabdata2
        persistentVolumeClaim:
          claimName: pv-cvlabdata2-deadline
      - name: dshm
        emptyDir:
          medium: Memory
          sizeLimit: 8Gi
