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

[RayService][Refactor] Change the ServeConfigs to nested map #2591

Conversation

MortalHappiness
Copy link
Member

@MortalHappiness MortalHappiness commented Dec 2, 2024

Why are these changes needed?

See the description in the corresponding issue for details.

Related issue number

Closes: #2550

Checks

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

@kevin85421
Copy link
Member

cc @rueian would you mind reviewing the PR?

cacheKey := rayServiceInstance.Namespace + "/" + rayServiceInstance.Name
serveConfigs, exist := r.ServeConfigs.Get(cacheKey)
if !exist {
return ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible that the config is indeed an empty string?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 040d475. Only cache the serveConfig when it is not empty.

@@ -57,7 +57,7 @@ type RayServiceReconciler struct {
Recorder record.EventRecorder
// Currently, the Ray dashboard doesn't cache the Serve deployment config.
// To avoid reapplying the same config repeatedly, cache the config in this map.
ServeConfigs cmap.ConcurrentMap[string, string]
ServeConfigs cmap.ConcurrentMap[string, cmap.ConcurrentMap[string, string]]
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment to explain the definitions of key and value?

Copy link
Member Author

@MortalHappiness MortalHappiness Dec 4, 2024

Choose a reason for hiding this comment

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

Added in b2cb82a

@MortalHappiness MortalHappiness force-pushed the feature/#2550-serveconfig-ds-change branch from 040d475 to ca8482b Compare December 4, 2024 01:37
@MortalHappiness MortalHappiness force-pushed the feature/#2550-serveconfig-ds-change branch from ca8482b to b2cb82a Compare December 4, 2024 01:38
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.

Nit: It should be "serve application configs" instead of "serve deployment configs."

ray-operator/controllers/ray/rayservice_controller.go Outdated Show resolved Hide resolved
ray-operator/controllers/ray/rayservice_controller.go Outdated Show resolved Hide resolved
ray-operator/controllers/ray/rayservice_controller.go Outdated Show resolved Hide resolved
@kevin85421 kevin85421 self-assigned this Dec 4, 2024
@kevin85421 kevin85421 merged commit 3c8904c into ray-project:master Dec 4, 2024
23 checks passed
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.

[RayService][Refactor] Change the data structure of ServeConfigs to avoid iterating the whole map
3 participants