Skip to content

Conversation

owenowenisme
Copy link
Contributor

@owenowenisme owenowenisme commented Aug 26, 2025

Why are these changes needed?

UnmarshalRuntimeEnvYAML doesn't depend on dashboard_httpvlient, so move to utils.go

Related issue number

Checks

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

Signed-off-by: You-Cheng Lin (Owen) <[email protected]>
@owenowenisme owenowenisme changed the title [Refactor] Move UnmarshalRuntimeEnvYAML to utils [refactor][2/N] Move UnmarshalRuntimeEnvYAML to utils Aug 26, 2025
@owenowenisme owenowenisme changed the title [refactor][2/N] Move UnmarshalRuntimeEnvYAML to utils [refactor][2/N] Move UnmarshalRuntimeEnvYAML to utils.go Aug 26, 2025
@owenowenisme owenowenisme marked this pull request as ready for review August 26, 2025 09:10
Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

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

Based on our discussion yesterday, we should not move UmarshalRuntimeEnvYAML to util.go in order to avoid importing ray/utils (which also imports controller-runtime) into dashboard_httpclient.go.

@owenowenisme
Copy link
Contributor Author

owenowenisme commented Aug 26, 2025

@kevin85421 Sorry I got mixed up, but after second thought, validation.go also use UmarshalRuntimeEnvYAML, and since we will eventually make dashboard_httpclient a new package, it will be weird to import dashboard_httpclient for
UmarshalRuntimeEnvYAML.
Are we going to separate a new package for functions like this (light-weight dependencies functions)?

if _, err := UnmarshalRuntimeEnvYAML(rayJob.Spec.RuntimeEnvYAML); err != nil {
return err
}
if rayJob.Spec.ActiveDeadlineSeconds != nil && *rayJob.Spec.ActiveDeadlineSeconds <= 0 {
return fmt.Errorf("activeDeadlineSeconds must be a positive integer")
}

@kevin85421
Copy link
Member

How about moving type RuntimeEnvType map[string]interface{} to rayjob_types.go, then removing UnmarshalRuntimeEnvYAML and using yaml.Unmarshal directly in case UnmarshalRuntimeEnvYAML is very short and simple?

Signed-off-by: You-Cheng Lin (Owen) <[email protected]>
@owenowenisme
Copy link
Contributor Author

owenowenisme commented Aug 28, 2025

How about moving type RuntimeEnvType map[string]interface{} to rayjob_types.go, then removing UnmarshalRuntimeEnvYAML and using yaml.Unmarshal directly in case UnmarshalRuntimeEnvYAML is very short and simple?

@kevin85421, How about moving it to utiltypes package as we are going to create a new package in #3979, I prefer not to modify rayJob_type for this and also code-gen will give error if we put that type there.
Updated in e9d9f0d

github.com/ray-project/kuberay/ray-operator/apis/ray/v1:-: invalid map value type: interface{}

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