-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kubectl-plugin] add --worker-gpu flag for cluster creation #2675
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import ( | |
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
corev1 "k8s.io/api/core/v1" | ||
"k8s.io/apimachinery/pkg/api/resource" | ||
|
||
rayv1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1" | ||
|
@@ -23,6 +24,7 @@ func TestGenerateRayCluterApplyConfig(t *testing.T) { | |
WorkerReplicas: 3, | ||
WorkerCPU: "2", | ||
WorkerMemory: "10Gi", | ||
WorkerGPU: "1", | ||
}, | ||
} | ||
|
||
|
@@ -37,6 +39,7 @@ func TestGenerateRayCluterApplyConfig(t *testing.T) { | |
assert.Equal(t, testRayClusterYamlObject.WorkerGrpName, *result.Spec.WorkerGroupSpecs[0].GroupName) | ||
assert.Equal(t, testRayClusterYamlObject.WorkerReplicas, *result.Spec.WorkerGroupSpecs[0].Replicas) | ||
assert.Equal(t, resource.MustParse(testRayClusterYamlObject.WorkerCPU), *result.Spec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Resources.Requests.Cpu()) | ||
assert.Equal(t, resource.MustParse(testRayClusterYamlObject.WorkerGPU), *result.Spec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Resources.Requests.Name(corev1.ResourceName("nvidia.com/gpu"), resource.DecimalSI)) | ||
assert.Equal(t, resource.MustParse(testRayClusterYamlObject.WorkerMemory), *result.Spec.WorkerGroupSpecs[0].Template.Spec.Containers[0].Resources.Requests.Memory()) | ||
} | ||
|
||
|
@@ -54,6 +57,7 @@ func TestGenerateRayJobApplyConfig(t *testing.T) { | |
WorkerReplicas: 3, | ||
WorkerCPU: "2", | ||
WorkerMemory: "10Gi", | ||
WorkerGPU: "0", | ||
}, | ||
} | ||
|
||
|
@@ -85,6 +89,7 @@ func TestConvertRayClusterApplyConfigToYaml(t *testing.T) { | |
WorkerReplicas: 3, | ||
WorkerCPU: "2", | ||
WorkerMemory: "10Gi", | ||
WorkerGPU: "0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it is worth it to check the yaml output when the GPU is non-zero? Or is it enough to see that the value is properly set in the applyconfig? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, will add a test for when GPU is set to 1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah nvm, I already updated the test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh oops my bad, missed that. |
||
}, | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are adding the GPU option, should we add the option to specify the
gke-accelerator
?I do think this could also be done on a later date though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to generalize it further and support an option to specify node selectors