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

DELETE_RAYJOB_CR_AFTER_JOB_FINISHES doesn't work with Configuration API #2260

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

Conversation

andrewsykim
Copy link
Collaborator

@andrewsykim andrewsykim commented Jul 19, 2024

Why are these changes needed?

This is a follow-up to #2225

The deleteRayJobAfterJobFinishes field in the Configuration API does not actually work because the controller only checks for environment variables. This PR changes the behavior so that KubeRay checks both environment variables and the Configuration API.

Related issue number

Checks

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

@andrewsykim
Copy link
Collaborator Author

@MortalHappiness @kevin85421 PTAL

@kevin85421 kevin85421 self-assigned this Jul 19, 2024
Comment on lines +35 to +46
type RayClientProvider struct {
configapi.Configuration
}

func (r *RayClientProvider) GetDashboardClient(mgr manager.Manager) func() RayDashboardClientInterface {
return GetRayDashboardClientFunc(mgr, r.UseKubernetesProxy)
}

func (r *RayClientProvider) GetHttpProxyClient(mgr manager.Manager) func() RayHttpProxyClientInterface {
return GetRayHttpProxyClientFunc(mgr, r.UseKubernetesProxy)
}

Copy link
Contributor

@MortalHappiness MortalHappiness Jul 21, 2024

Choose a reason for hiding this comment

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

Why a new type RayClientProvider is introduced here? Is this for refactoring purpose to make sure that the type Configuration has no other methods except for deepcopy? If yes it might be better to put this in a separate PR or at least mentioned this in the PR description.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This refactor was needed because otherwise in NewRayJobReconciler we pass in two copies of the Configuration, one implementing util.ClientProvider and one containing the actual type. Also as you mentioned, Kubernetes API types should not implement other methods outside standrdard DeepCopy and other generated methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Thanks.

@andrewsykim
Copy link
Collaborator Author

@MortalHappiness @kevin85421 should we include this in v1.2?

@andrewsykim
Copy link
Collaborator Author

I am okay to defer this given we don't have much usage of the Configuration API. We can revisit if/when we want to promote it

@MortalHappiness
Copy link
Contributor

This PR looks good to me. I think it can be included in v1.2

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

Successfully merging this pull request may close these issues.

3 participants