Skip to content

Commit

Permalink
[RayJob] Add default CPU and memory for job submitter pod (ray-projec…
Browse files Browse the repository at this point in the history
…t#1319)

Adds a default CPU and memory resource requirement for the pod that submits the RayJob.

image
Here's the memory and CPU usage of the job submitter pod with a job entrypoint script that prints "hello world" in a tight loop from Python. I tested it on a local kind cluster. Since the job submitter pod just calls ray job submit which runs the job remotely and streams the job output to stdout on the submitter pod, this kind of log streaming job should be the most stressful from the perspective of the job submitter pod.

Based on this, we set the requests to 500m CPU and 200MiB memory, and set the limits to 1 CPU and 1GiB memory.

Why are these changes needed?
It's good to provide reasonable defaults to reduce the burden on the user.

Related issue number
Closes ray-project#1198

---------

Signed-off-by: Archit Kulkarni <[email protected]>
  • Loading branch information
architkulkarni authored and kevin85421 committed Oct 17, 2023
1 parent 9c4496f commit 7adf247
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ray-operator/controllers/ray/common/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/google/shlex"
rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"sigs.k8s.io/yaml"
)

Expand Down Expand Up @@ -154,6 +155,16 @@ func GetDefaultSubmitterTemplate(rayJobInstance *rayv1alpha1.RayJob) v1.PodTempl
{
Name: "ray-job-submitter",
Image: image,
Resources: v1.ResourceRequirements{
Limits: v1.ResourceList{
v1.ResourceCPU: resource.MustParse("1"),
v1.ResourceMemory: resource.MustParse("1Gi"),
},
Requests: v1.ResourceList{
v1.ResourceCPU: resource.MustParse("500m"),
v1.ResourceMemory: resource.MustParse("200Mi"),
},
},
},
},
RestartPolicy: v1.RestartPolicyNever,
Expand Down

0 comments on commit 7adf247

Please sign in to comment.