# Job to run a Ray program in its own pod. Assumes that a Ray cluster is already
# running.
apiVersion: batch/v1
kind: Job
metadata:
  generateName: ray-test-job-
  labels:
    component: ray-job
    type: ray
    example: job
spec:
  template:
    metadata:
      labels:
        component: ray-job
        type: ray
        example: job
    spec:
      restartPolicy: Never
      volumes:
        - name: efs-volume
          persistentVolumeClaim:
            claimName: team-efs
      containers:
        - name: ray
          image: rayproject/ray:1.3.0
          volumeMounts:
          - mountPath: /efs/shared
            name: efs-volume
          imagePullPolicy: IfNotPresent
          command: [ "/bin/bash", "-c", "--" ]
          args:
            - "python /efs/shared/samples/notebooks/H-Model-Development/job_example.py"
          resources:
            requests:
              cpu: 100m
              memory: 512Mi
