Skip to content
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

[Feat][Kubectl-Plugin]Implement kubectl ray job submit #2394

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chiayi
Copy link
Contributor

@chiayi chiayi commented Sep 21, 2024

Why are these changes needed?

This PR implements the kubectl ray submit job command.

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(


submissionMode := options.RayJob.Object["spec"].(map[string]interface{})["submissionMode"]
if submissionMode != nil {
if submissionMode == rayv1api.K8sJobMode || submissionMode == rayv1api.HTTPMode {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably safer to make this if submissionMode != rayv1api.UserMode in case we add more submission modes in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently using "UserMode" string since the latest release does not have rayv1api.UserMode. Also added a check that returns an error if the ray job does not have submission mode since I did not see #2364 doing defaulting if submission mode is none.

kubectl-plugin/pkg/cmd/submit/submit.go Outdated Show resolved Hide resolved
return fmt.Errorf("Failed to find service name: %w", err)
}

portForwardCmd := portforward.NewCmdPortForward(factory, *options.ioStreams)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be some polling logic to wait for the RayCluster to be ready before we attempt the next step to port-forward and submit a job?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, we should. Adding check for cluster status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants