sigs.k8s.io/kueue@v0.6.2/site/static/examples/jobs/ray-job-sample.yaml (about)

     1  apiVersion: ray.io/v1alpha1
     2  kind: RayJob
     3  metadata:
     4    name: ray-job-sample
     5    labels:
     6      kueue.x-k8s.io/queue-name: user-queue
     7  spec:
     8    suspend: true
     9    shutdownAfterJobFinishes: true
    10    entrypoint: python /home/ray/samples/sample_code.py
    11    runtimeEnv: ewogICAgInBpcCI6IFsKICAgICAgICAicmVxdWVzdHM9PTIuMjYuMCIsCiAgICAgICAgInBlbmR1bHVtPT0yLjEuMiIKICAgIF0sCiAgICAiZW52X3ZhcnMiOiB7ImNvdW50ZXJfbmFtZSI6ICJ0ZXN0X2NvdW50ZXIifQp9Cg==
    12    rayClusterSpec:
    13      rayVersion: '2.4.0' # should match the Ray version in the image of the containers
    14      # Ray head pod template
    15      headGroupSpec:
    16        # the following params are used to complete the ray start: ray start --head --block --redis-port=6379 ...
    17        rayStartParams:
    18          dashboard-host: '0.0.0.0'
    19          num-cpus: '1' # can be auto-completed from the limits
    20        #pod template
    21        template:
    22          spec:
    23            containers:
    24              - name: ray-head
    25                image: rayproject/ray:2.4.0
    26                ports:
    27                  - containerPort: 6379
    28                    name: gcs-server
    29                  - containerPort: 8265 # Ray dashboard
    30                    name: dashboard
    31                  - containerPort: 10001
    32                    name: client
    33                  - containerPort: 8000
    34                    name: serve
    35                resources:
    36                  limits:
    37                    cpu: "2"
    38                  requests:
    39                    cpu: "1"
    40                volumeMounts:
    41                  - mountPath: /home/ray/samples
    42                    name: code-sample
    43            volumes:
    44              # You set volumes at the Pod level, then mount them into containers inside that Pod
    45              - name: code-sample
    46                configMap:
    47                  # Provide the name of the ConfigMap you want to mount.
    48                  name: ray-job-code-sample
    49                  # An array of keys from the ConfigMap to create as files
    50                  items:
    51                    - key: sample_code.py
    52                      path: sample_code.py
    53      workerGroupSpecs:
    54        # the pod replicas in this group typed worker
    55        - replicas: 3
    56          minReplicas: 1
    57          maxReplicas: 5
    58          # logical group name, for this called small-group, also can be functional
    59          groupName: small-group
    60          rayStartParams: {}
    61          #pod template
    62          template:
    63            spec:
    64              containers:
    65                - name: ray-worker # must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc'
    66                  image: rayproject/ray:2.4.0
    67                  lifecycle:
    68                    preStop:
    69                      exec:
    70                        command: [ "/bin/sh","-c","ray stop" ]
    71                  resources:
    72                    limits:
    73                      cpu: "2"
    74                    requests:
    75                      cpu: "1"