-
Notifications
You must be signed in to change notification settings - Fork 837
Add fqdn #5108
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
Add fqdn #5108
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 |
|---|---|---|
|
|
@@ -24,3 +24,5 @@ featureGates: | |
| enabled: true | ||
| - name: RayClusterMTLS | ||
| enabled: true | ||
| - name: RayClusterWorkerFQDN | ||
| enabled: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -896,36 +896,37 @@ func (r *RayClusterReconciler) reconcileServeService(ctx context.Context, instan | |
|
|
||
| // Return nil only when the headless service for multi-host worker groups is successfully created or already exists. | ||
| func (r *RayClusterReconciler) reconcileHeadlessService(ctx context.Context, instance *rayv1.RayCluster) error { | ||
| // Check if there are worker groups with NumOfHosts > 1 in the cluster | ||
| isMultiHost := false | ||
| for _, workerGroup := range instance.Spec.WorkerGroupSpecs { | ||
| if workerGroup.NumOfHosts > 1 { | ||
| isMultiHost = true | ||
| break | ||
| // Check if Stable Worker FQDN is enabled | ||
| needHeadless := features.Enabled(features.RayClusterWorkerFQDN) | ||
|
|
||
| // If Stable Worker FQDN is not enabled, check if there are worker groups with NumOfHosts > 1 in the cluster | ||
| if !needHeadless { | ||
| for _, workerGroup := range instance.Spec.WorkerGroupSpecs { | ||
| if workerGroup.NumOfHosts > 1 { | ||
| needHeadless = true | ||
| break | ||
| } | ||
| } | ||
| } | ||
| if !needHeadless { | ||
| return nil | ||
| } | ||
|
|
||
| if isMultiHost { | ||
| services := corev1.ServiceList{} | ||
| options := common.RayClusterHeadlessServiceListOptions(instance) | ||
|
|
||
| if err := r.List(ctx, &services, options...); err != nil { | ||
| return err | ||
| } | ||
| // Check if there's an existing headless service in the cluster. | ||
| if len(services.Items) != 0 { | ||
| // service exists, do nothing | ||
| return nil | ||
| } | ||
| // Create headless tpu worker service if there's no existing one in the cluster. | ||
| headlessSvc := common.BuildHeadlessServiceForRayCluster(*instance) | ||
| services := corev1.ServiceList{} | ||
| options := common.RayClusterHeadlessServiceListOptions(instance) | ||
|
|
||
| if err := r.createService(ctx, headlessSvc, instance); err != nil { | ||
| return err | ||
| } | ||
| if err := r.List(ctx, &services, options...); err != nil { | ||
| return err | ||
| } | ||
| // Check if there's an existing headless service in the cluster. | ||
| if len(services.Items) != 0 { | ||
| // service exists, do nothing | ||
| return nil | ||
| } | ||
| // Create headless tpu worker service if there's no existing one in the cluster. | ||
| headlessSvc := common.BuildHeadlessServiceForRayCluster(*instance) | ||
|
|
||
| return nil | ||
| return r.createService(ctx, headlessSvc, instance) | ||
| } | ||
|
|
||
| func (r *RayClusterReconciler) reconcilePods(ctx context.Context, instance *rayv1.RayCluster) error { | ||
|
|
@@ -1092,7 +1093,7 @@ func (r *RayClusterReconciler) reconcilePods(ctx context.Context, instance *rayv | |
| continue | ||
| } | ||
|
|
||
| isRayMultiHostIndexing := worker.NumOfHosts > 1 && features.Enabled(features.RayMultiHostIndexing) | ||
| isRayMultiHostIndexing := worker.NumOfHosts > 1 && features.NeedsWorkerIndices() | ||
|
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. FQDN orphans existing multi-host podsMedium Severity With Additional Locations (1)Reviewed by Cursor Bugbot for commit 24cb74d. Configure here. |
||
| if isRayMultiHostIndexing { | ||
| if err := r.reconcileMultiHostWorkerGroup(ctx, instance, &worker, workerPods.Items); err != nil { | ||
| return err | ||
|
|
@@ -1168,9 +1169,9 @@ func (r *RayClusterReconciler) reconcilePods(ctx context.Context, instance *rayv | |
|
|
||
| logger.Info("reconcilePods", "workerReplicas", numExpectedWorkerPods, "NumOfHosts", worker.NumOfHosts, "runningPods", len(runningPods.Items), "diff", diff) | ||
|
|
||
| // Support replica indices for single-host, multi-slice environments. | ||
| // Support replica indices for single-host workers (RayMultiHostIndexing and/or RayClusterWorkerFQDN). | ||
| validReplicaIndices := make(map[int]bool) | ||
| if features.Enabled(features.RayMultiHostIndexing) { | ||
| if features.NeedsWorkerIndices() { | ||
| for _, pod := range runningPods.Items { | ||
| if indexStr, ok := pod.Labels[utils.RayWorkerReplicaIndexKey]; ok { | ||
| if index, err := strconv.Atoi(indexStr); err == nil { | ||
|
|
@@ -1189,7 +1190,7 @@ func (r *RayClusterReconciler) reconcilePods(ctx context.Context, instance *rayv | |
| return fmt.Errorf("mTLS secrets not ready: %w", err) | ||
| } | ||
| } | ||
| if features.Enabled(features.RayMultiHostIndexing) { | ||
| if features.NeedsWorkerIndices() { | ||
| newReplicaIndex := 0 | ||
| // create all workers of this group | ||
| for i := range diff { | ||
|
|
@@ -1280,7 +1281,7 @@ func (r *RayClusterReconciler) deletePods(ctx context.Context, instance *rayv1.R | |
| } | ||
|
|
||
| // reconcileMultiHostWorkerGroup handles reconciliation and Pod deletion for worker groups with NumOfHosts > 1 when | ||
| // the RayMultihostIndexing feature is enabled. This function is responsible for: | ||
| // NeedsWorkerIndices is true (RayMultiHostIndexing and/or RayClusterWorkerFQDN). This function is responsible for: | ||
| // 1. Deleting incomplete or unhealthy multi-host groups atomically. | ||
| // 2. Explicit deletes of entire multi-host groups for the autoscaler. | ||
| // 3. Scale up/down of multi-host groups. | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.