-
Notifications
You must be signed in to change notification settings - Fork 687
background goroutine get job info #4160
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
Changes from 26 commits
805369a
73b14b5
4ce2381
e184e5c
859f6a1
03ce0e9
ac275c2
0923ef5
9f87da6
97ab407
929a829
a2a0961
d2173bb
50c9b94
0bfd41e
1ab70fa
efb7d17
9e71883
82085c0
bdb62b2
75345e6
5d471c4
745e7a6
3172fbe
c3363c3
e114330
1fd0268
dd6e750
6ec8372
cf62d4d
94729a6
88e6702
0d5dfe8
10ef540
03bc5b1
11db5a3
d2e13db
1f90762
12b6c40
2765c2a
c3336f2
b7f649a
09b501c
5d5bbde
8475d1f
a52f2a9
4d4ed19
17b75d1
67df232
314df45
e3cbe9f
f0a3b80
e55c2e0
ae8bf77
5c7a5bb
8964c93
90d2c30
7502bc8
886c07f
339adf3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ package ray | |
|
|
||
| import ( | ||
| "context" | ||
| errs "errors" | ||
| "fmt" | ||
| "os" | ||
| "strconv" | ||
|
|
@@ -42,11 +43,10 @@ const ( | |
| // RayJobReconciler reconciles a RayJob object | ||
| type RayJobReconciler struct { | ||
| client.Client | ||
| Scheme *runtime.Scheme | ||
| Recorder record.EventRecorder | ||
|
|
||
| dashboardClientFunc func(rayCluster *rayv1.RayCluster, url string) (dashboardclient.RayDashboardClientInterface, error) | ||
| Recorder record.EventRecorder | ||
| options RayJobReconcilerOptions | ||
| Scheme *runtime.Scheme | ||
| dashboardClientFunc func(rayCluster *rayv1.RayCluster, url string) (dashboardclient.RayDashboardClientInterface, error) | ||
| } | ||
|
|
||
| type RayJobReconcilerOptions struct { | ||
|
|
@@ -55,8 +55,8 @@ type RayJobReconcilerOptions struct { | |
| } | ||
|
|
||
| // NewRayJobReconciler returns a new reconcile.Reconciler | ||
| func NewRayJobReconciler(_ context.Context, mgr manager.Manager, options RayJobReconcilerOptions, provider utils.ClientProvider) *RayJobReconciler { | ||
| dashboardClientFunc := provider.GetDashboardClient(mgr) | ||
| func NewRayJobReconciler(ctx context.Context, mgr manager.Manager, options RayJobReconcilerOptions, provider utils.ClientProvider) *RayJobReconciler { | ||
| dashboardClientFunc := provider.GetDashboardClient(ctx, mgr) | ||
| return &RayJobReconciler{ | ||
| Client: mgr.GetClient(), | ||
| Scheme: mgr.GetScheme(), | ||
|
|
@@ -288,6 +288,10 @@ func (r *RayJobReconciler) Reconcile(ctx context.Context, request ctrl.Request) | |
|
|
||
| jobInfo, err := rayDashboardClient.GetJobInfo(ctx, rayJobInstance.Status.JobId) | ||
| if err != nil { | ||
| if errs.Is(err, dashboardclient.ErrAgain) { | ||
|
Collaborator
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. I think the
Collaborator
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. NotFoundError is probably not a good idea. It sounds like the JobInfo doesn't actually exist in the RayCluster. |
||
| logger.Info("The Ray job info was not ready. Try again next iteration.", "JobId", rayJobInstance.Status.JobId) | ||
| return ctrl.Result{RequeueAfter: RayJobDefaultRequeueDuration}, nil | ||
| } | ||
| // If the Ray job was not found, GetJobInfo returns a BadRequest error. | ||
| if errors.IsBadRequest(err) { | ||
| if rayJobInstance.Spec.SubmissionMode == rayv1.HTTPMode { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.