@@ -221,7 +221,6 @@ func (r *RayServiceReconciler) Reconcile(ctx context.Context, request ctrl.Reque
221
221
if r .inconsistentRayServiceStatuses (ctx , originalRayServiceInstance .Status , rayServiceInstance .Status ) {
222
222
rayServiceInstance .Status .LastUpdateTime = & metav1.Time {Time : time .Now ()}
223
223
if errStatus := r .Status ().Update (ctx , rayServiceInstance ); errStatus != nil {
224
- logger .Error (errStatus , "Failed to update RayService status" , "rayServiceInstance" , rayServiceInstance )
225
224
return ctrl.Result {RequeueAfter : ServiceDefaultRequeueDuration }, errStatus
226
225
}
227
226
}
@@ -230,10 +229,8 @@ func (r *RayServiceReconciler) Reconcile(ctx context.Context, request ctrl.Reque
230
229
}
231
230
232
231
func (r * RayServiceReconciler ) calculateStatus (ctx context.Context , rayServiceInstance * rayv1.RayService ) error {
233
- logger := ctrl .LoggerFrom (ctx )
234
232
serveEndPoints := & corev1.Endpoints {}
235
233
if err := r .Get (ctx , common .RayServiceServeServiceNamespacedName (rayServiceInstance ), serveEndPoints ); err != nil && ! errors .IsNotFound (err ) {
236
- logger .Error (err , "Fail to retrieve the Kubernetes Endpoints from the cluster!" )
237
234
return err
238
235
}
239
236
@@ -438,7 +435,6 @@ func (r *RayServiceReconciler) cleanUpRayClusterInstance(ctx context.Context, ra
438
435
439
436
var err error
440
437
if err = r .List (ctx , & rayClusterList , common .RayServiceRayClustersAssociationOptions (rayServiceInstance ).ToListOptions ()... ); err != nil {
441
- logger .Error (err , "Fail to list RayCluster for " + rayServiceInstance .Name )
442
438
return err
443
439
}
444
440
@@ -463,7 +459,6 @@ func (r *RayServiceReconciler) cleanUpRayClusterInstance(ctx context.Context, ra
463
459
if reasonForDeletion != "" {
464
460
logger .Info ("reconcileRayCluster" , "delete Ray cluster" , rayClusterInstance .Name , "reason" , reasonForDeletion )
465
461
if err := r .Delete (ctx , & rayClusterInstance , client .PropagationPolicy (metav1 .DeletePropagationBackground )); err != nil {
466
- logger .Error (err , "Fail to delete RayCluster " + rayClusterInstance .Name )
467
462
return err
468
463
}
469
464
}
@@ -475,12 +470,10 @@ func (r *RayServiceReconciler) cleanUpRayClusterInstance(ctx context.Context, ra
475
470
}
476
471
477
472
func (r * RayServiceReconciler ) getRayClusterByNamespacedName (ctx context.Context , clusterKey client.ObjectKey ) (* rayv1.RayCluster , error ) {
478
- logger := ctrl .LoggerFrom (ctx )
479
473
rayCluster := & rayv1.RayCluster {}
480
474
if clusterKey .Name != "" {
481
475
// Ignore not found since in that case we should return RayCluster as nil.
482
476
if err := r .Get (ctx , clusterKey , rayCluster ); client .IgnoreNotFound (err ) != nil {
483
- logger .Error (err , "Fail to get RayCluster " + clusterKey .String ())
484
477
return nil , err
485
478
}
486
479
} else {
@@ -603,7 +596,6 @@ func (r *RayServiceReconciler) createRayClusterInstanceIfNeeded(ctx context.Cont
603
596
} else {
604
597
clusterAction , err = getClusterAction (pendingRayCluster .Spec , rayServiceInstance .Spec .RayClusterSpec )
605
598
if err != nil {
606
- logger .Error (err , "Fail to generate hash for RayClusterSpec" )
607
599
return nil , err
608
600
}
609
601
}
@@ -640,7 +632,6 @@ func (r *RayServiceReconciler) updateRayClusterInstance(ctx context.Context, ray
640
632
Name : rayClusterInstance .Name ,
641
633
})
642
634
if err != nil {
643
- logger .Error (err , "Failed to get the current state of RayCluster" , "Namespace" , rayClusterInstance .Namespace , "Name" , rayClusterInstance .Name )
644
635
return err
645
636
}
646
637
@@ -658,7 +649,6 @@ func (r *RayServiceReconciler) updateRayClusterInstance(ctx context.Context, ray
658
649
659
650
// Update the RayCluster
660
651
if err = r .Update (ctx , currentRayCluster ); err != nil {
661
- logger .Error (err , "Fail to update RayCluster " + currentRayCluster .Name )
662
652
return err
663
653
}
664
654
@@ -692,19 +682,16 @@ func (r *RayServiceReconciler) createRayClusterInstance(ctx context.Context, ray
692
682
}
693
683
// if error is `not found`, then continue.
694
684
} else if ! errors .IsNotFound (err ) {
695
- logger .Error (err , "Get request rayCluster instance error!" )
696
685
return nil , err
697
686
// if error is `not found`, then continue.
698
687
}
699
688
700
689
logger .Info ("No pending RayCluster, creating RayCluster." )
701
690
rayClusterInstance , err = r .constructRayClusterForRayService (ctx , rayServiceInstance , rayClusterKey .Name )
702
691
if err != nil {
703
- logger .Error (err , "unable to construct rayCluster from spec" )
704
692
return nil , err
705
693
}
706
694
if err = r .Create (ctx , rayClusterInstance ); err != nil {
707
- logger .Error (err , "unable to create rayCluster for rayService" , "rayCluster" , rayClusterInstance )
708
695
return nil , err
709
696
}
710
697
logger .Info ("created rayCluster for rayService" , "rayCluster" , rayClusterInstance )
@@ -713,8 +700,6 @@ func (r *RayServiceReconciler) createRayClusterInstance(ctx context.Context, ray
713
700
}
714
701
715
702
func (r * RayServiceReconciler ) constructRayClusterForRayService (ctx context.Context , rayService * rayv1.RayService , rayClusterName string ) (* rayv1.RayCluster , error ) {
716
- logger := ctrl .LoggerFrom (ctx )
717
-
718
703
var err error
719
704
rayClusterLabel := make (map [string ]string )
720
705
for k , v := range rayService .Labels {
@@ -727,12 +712,8 @@ func (r *RayServiceReconciler) constructRayClusterForRayService(ctx context.Cont
727
712
for k , v := range rayService .Annotations {
728
713
rayClusterAnnotations [k ] = v
729
714
}
730
- errContext := "Failed to serialize RayCluster config. " +
731
- "Manual config updates will NOT be tracked accurately. " +
732
- "Please tear down the cluster and apply a new config."
733
715
rayClusterAnnotations [utils .HashWithoutReplicasAndWorkersToDeleteKey ], err = generateHashWithoutReplicasAndWorkersToDelete (rayService .Spec .RayClusterSpec )
734
716
if err != nil {
735
- logger .Error (err , errContext )
736
717
return nil , err
737
718
}
738
719
rayClusterAnnotations [utils .NumWorkerGroupsKey ] = strconv .Itoa (len (rayService .Spec .RayClusterSpec .WorkerGroupSpecs ))
@@ -991,7 +972,6 @@ func (r *RayServiceReconciler) reconcileServices(ctx context.Context, rayService
991
972
oldSvc .Spec = * newSvc .Spec .DeepCopy ()
992
973
logger .Info (fmt .Sprintf ("Update Kubernetes Service serviceType %v" , serviceType ))
993
974
if updateErr := r .Update (ctx , oldSvc ); updateErr != nil {
994
- logger .Error (updateErr , fmt .Sprintf ("Fail to update Kubernetes Service serviceType %v" , serviceType ), "Error" , updateErr )
995
975
return updateErr
996
976
}
997
977
} else if errors .IsNotFound (err ) {
@@ -1004,11 +984,9 @@ func (r *RayServiceReconciler) reconcileServices(ctx context.Context, rayService
1004
984
logger .Info ("The Kubernetes Service already exists, no need to create." )
1005
985
return nil
1006
986
}
1007
- logger .Error (createErr , fmt .Sprintf ("Fail to create Kubernetes Service serviceType %v" , serviceType ), "Error" , createErr )
1008
987
return createErr
1009
988
}
1010
989
} else {
1011
- logger .Error (err , "Fail to retrieve the Kubernetes Service from the cluster!" )
1012
990
return err
1013
991
}
1014
992
@@ -1120,7 +1098,6 @@ func (r *RayServiceReconciler) reconcileServe(ctx context.Context, rayServiceIns
1120
1098
}
1121
1099
1122
1100
func (r * RayServiceReconciler ) labelHeadPodForServeStatus (ctx context.Context , rayClusterInstance * rayv1.RayCluster ) error {
1123
- logger := ctrl .LoggerFrom (ctx )
1124
1101
headPod , err := r .getHeadPod (ctx , rayClusterInstance )
1125
1102
if err != nil {
1126
1103
return err
@@ -1151,7 +1128,6 @@ func (r *RayServiceReconciler) labelHeadPodForServeStatus(ctx context.Context, r
1151
1128
1152
1129
if ! reflect .DeepEqual (originalLabels , headPod .Labels ) {
1153
1130
if updateErr := r .Update (ctx , headPod ); updateErr != nil {
1154
- logger .Error (updateErr , "Pod label Update error!" , "Pod.Error" , updateErr )
1155
1131
return updateErr
1156
1132
}
1157
1133
}
0 commit comments