apiVersion: batch/v1
kind: Job
metadata:
    name: dk.job.ggr.scanmotifs.basset.stable
spec:
    template:
      spec:
        containers:
        - name: infer-container
          image: dskim89/tensorflow-genomics
          env:
          - name: MODEL_DIR
            value: "/datasets/models.2018-12-03"
          - name: MODEL
            value: "basset"
          - name: OUT_DIR
            value: "/datasets/inference.2019-02-05/motifs.input_x_grad.stable"
          - name: FILTER
            value: "STABLE_MARK_LABELS=0,1,2,3,5,6,7,9,10,11,13,14 ATAC_LABELS=0,1,2,3,4,5,6,9,10,12::reduce_type=min,min=2"
          command: ["bash", "-c"]
          args: ["source ~/.bash_profile && mkdir -p $OUT_DIR && /datasets/software/git/tronn/scripts/ggr/kube/scanmotifs.ggr.bash $MODEL_DIR $MODEL \"$FILTER\" $OUT_DIR"]
          resources:
            limits:
              nvidia.com/gpu: 6
          #    cpu: 16
              memory: 32Gi
          #requests:
          #    cpu: 8
          #    memory: 8Gi
          volumeMounts:
          - mountPath: /datasets
            name: datasets
        restartPolicy: Never
        volumes:
        - name: datasets
          flexVolume:
            driver: ceph.rook.io/rook
            fsType: ceph
            options:
             fsName: nautilusfs
             clusterNamespace: rook
             path: /kundajelab
             mountUser: kundajelab
             mountSecret: ceph-fs-secret
        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
              - matchExpressions:
                - key: gpu-type
                  operator: In # Use NotIn for other types
                  values:
                  - "1080Ti"