From 4bd62a18b32a876e5ef2b024e454ccf793849050 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 23 Dec 2022 12:17:37 +0100 Subject: dashboard: support multiple simultaneous jobs Modify job_poll never to return already started jobs. Introduce a special job_reset API call to clear the "started" flag for the specified list of managers. --- dashboard/dashapi/dashapi.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'dashboard/dashapi') diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index 348fe92c5..4c46d1582 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -147,6 +147,8 @@ func (dash *Dashboard) BuilderPoll(manager string) (*BuilderPollResp, error) { } // Jobs workflow: +// - syz-ci sends JobResetReq to indicate that no previously started jobs +// are any longer in progress. // - syz-ci sends JobPollReq periodically to check for new jobs, // request contains list of managers that this syz-ci runs. // - dashboard replies with JobPollResp that contains job details, @@ -155,6 +157,10 @@ func (dash *Dashboard) BuilderPoll(manager string) (*BuilderPollResp, error) { // job execution result (Build, Crash or Error details), // ID must match JobPollResp.ID. +type JobResetReq struct { + Managers []string +} + type JobPollReq struct { Managers map[string]ManagerJobs } @@ -228,6 +234,10 @@ func (dash *Dashboard) JobDone(req *JobDoneReq) error { return dash.Query("job_done", req, nil) } +func (dash *Dashboard) JobReset(req *JobResetReq) error { + return dash.Query("job_reset", req, nil) +} + type BuildErrorReq struct { Build Build Crash Crash -- cgit mrf-deployment