apiVersion: batch/v1
kind: Job
metadata:
  name: job-perl-slurm-mpi-local
spec:
  backoffLimit: 1
  template:
    metadata:
      labels:
        name: job-slurm-template
    spec:
      runtimeClassName: multicri
      containers:
      - name: job-slurm-container
        image: multicri/docker-repository.alpine:3.8
        command: ["sleep","60","&&","ls", "/"]
        env:
        - name: MPI_VERSION
          value: "1.10.2"
        - name: MPI_FLAGS
          value: "-np 2"
        - name: CLUSTER_USERNAME
          valueFrom:
            secretKeyRef:
              name: local-secret
              key: username
        - name: CLUSTER_PASSWORD
          valueFrom:
            secretKeyRef:
              name: local-secret
              key: password
        - name: CLUSTER_HOST
          valueFrom:
            secretKeyRef:
              name: local-secret
              key: host
        - name: CLUSTER_PORT
          valueFrom:
            secretKeyRef:
              name: local-secret
              key: port
        - name: JOB_QUEUE
          valueFrom:
            secretKeyRef:
              name: local-secret
              key: queue
        - name: JOB_NUM_CORES
          value: "1"
        - name: JOB_NUM_TASKS_NODE
          value: "1"
        volumeMounts:
        # name must match the volume name below
        - name: my-pvc-nfs
          mountPath: "multicri"
      restartPolicy: Never
      nodeSelector:
        beta.kubernetes.io/arch: amd64
      volumes:
      - name: my-pvc-nfs
        persistentVolumeClaim:
          claimName: nfs-v1