API changes for sending task updates to the Manager

This commit is contained in:
Sybren A. Stüvel 2022-02-14 18:01:32 +01:00
parent 0457809641
commit 7586be010b
5 changed files with 279 additions and 54 deletions

View File

@ -157,6 +157,37 @@ paths:
schema:
$ref: "#/components/schemas/WorkerStateChange"
/api/worker/task/{task_id}:
summary: Workers send info about task progression here.
post:
operationId: taskUpdate
summary: Update the task, typically to indicate progress, completion, or failure.
security: [{worker_auth: []}]
tags: [worker]
parameters:
- name: task_id
in: path
required: true
schema: {type: string, format: uuid}
requestBody:
description: Task update information
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/TaskUpdate"
responses:
"204":
description: The update was accepted.
"409":
description: The task is assigned to another worker, so the update was not accepted.
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/jobs/types:
summary: Available Flamenco job types.
get:
@ -278,7 +309,6 @@ components:
properties:
uuid: {type: string, format: uuid}
job: {type: string}
user: {type: string}
name: {type: string}
status: {$ref: "#/components/schemas/TaskStatus"}
priority: {type: integer}
@ -288,7 +318,15 @@ components:
commands:
type: array
items: {$ref: "#/components/schemas/Command"}
required: [uuid, job, user, name, status, priority, job_priority, job_type, task_type, commands]
required: [uuid, job, name, status, priority, job_priority, job_type, task_type, commands]
TaskUpdate:
type: object
description: TaskUpdate is sent by a Worker to update the status & logs of a task it's executing.
properties:
taskStatus: {$ref: "#/components/schemas/TaskStatus", description: The new task status.}
activity: {type: string, description: One-liner to indicate what's currently happening with the task. Overwrites previously sent activity strings.}
log: {type: string, description: Log lines for this task, will be appended to logs sent earlier.}
JobStatus:
type: string

View File

@ -124,6 +124,11 @@ type ClientInterface interface {
// ScheduleTask request
ScheduleTask(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// TaskUpdate request with any body
TaskUpdateWithBody(ctx context.Context, taskId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
TaskUpdate(ctx context.Context, taskId string, body TaskUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
func (c *Client) SubmitJobWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
@ -282,6 +287,30 @@ func (c *Client) ScheduleTask(ctx context.Context, reqEditors ...RequestEditorFn
return c.Client.Do(req)
}
func (c *Client) TaskUpdateWithBody(ctx context.Context, taskId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewTaskUpdateRequestWithBody(c.Server, taskId, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) TaskUpdate(ctx context.Context, taskId string, body TaskUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewTaskUpdateRequest(c.Server, taskId, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// NewSubmitJobRequest calls the generic SubmitJob builder with application/json body
func NewSubmitJobRequest(server string, body SubmitJobJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
@ -584,6 +613,53 @@ func NewScheduleTaskRequest(server string) (*http.Request, error) {
return req, nil
}
// NewTaskUpdateRequest calls the generic TaskUpdate builder with application/json body
func NewTaskUpdateRequest(server string, taskId string, body TaskUpdateJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewTaskUpdateRequestWithBody(server, taskId, "application/json", bodyReader)
}
// NewTaskUpdateRequestWithBody generates requests for TaskUpdate with any type of body
func NewTaskUpdateRequestWithBody(server string, taskId string, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "task_id", runtime.ParamLocationPath, taskId)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/worker/task/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
for _, r := range c.RequestEditors {
if err := r(ctx, req); err != nil {
@ -661,6 +737,11 @@ type ClientWithResponsesInterface interface {
// ScheduleTask request
ScheduleTaskWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ScheduleTaskResponse, error)
// TaskUpdate request with any body
TaskUpdateWithBodyWithResponse(ctx context.Context, taskId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TaskUpdateResponse, error)
TaskUpdateWithResponse(ctx context.Context, taskId string, body TaskUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*TaskUpdateResponse, error)
}
type SubmitJobResponse struct {
@ -867,6 +948,28 @@ func (r ScheduleTaskResponse) StatusCode() int {
return 0
}
type TaskUpdateResponse struct {
Body []byte
HTTPResponse *http.Response
JSONDefault *Error
}
// Status returns HTTPResponse.Status
func (r TaskUpdateResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r TaskUpdateResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// SubmitJobWithBodyWithResponse request with arbitrary body returning *SubmitJobResponse
func (c *ClientWithResponses) SubmitJobWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SubmitJobResponse, error) {
rsp, err := c.SubmitJobWithBody(ctx, contentType, body, reqEditors...)
@ -980,6 +1083,23 @@ func (c *ClientWithResponses) ScheduleTaskWithResponse(ctx context.Context, reqE
return ParseScheduleTaskResponse(rsp)
}
// TaskUpdateWithBodyWithResponse request with arbitrary body returning *TaskUpdateResponse
func (c *ClientWithResponses) TaskUpdateWithBodyWithResponse(ctx context.Context, taskId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TaskUpdateResponse, error) {
rsp, err := c.TaskUpdateWithBody(ctx, taskId, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseTaskUpdateResponse(rsp)
}
func (c *ClientWithResponses) TaskUpdateWithResponse(ctx context.Context, taskId string, body TaskUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*TaskUpdateResponse, error) {
rsp, err := c.TaskUpdate(ctx, taskId, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseTaskUpdateResponse(rsp)
}
// ParseSubmitJobResponse parses an HTTP response from a SubmitJobWithResponse call
func ParseSubmitJobResponse(rsp *http.Response) (*SubmitJobResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body)
@ -1255,3 +1375,29 @@ func ParseScheduleTaskResponse(rsp *http.Response) (*ScheduleTaskResponse, error
return response, nil
}
// ParseTaskUpdateResponse parses an HTTP response from a TaskUpdateWithResponse call
func ParseTaskUpdateResponse(rsp *http.Response) (*TaskUpdateResponse, error) {
bodyBytes, err := ioutil.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &TaskUpdateResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSONDefault = &dest
}
return response, nil
}

View File

@ -40,6 +40,9 @@ type ServerInterface interface {
// Obtain a new task to execute
// (POST /api/worker/task)
ScheduleTask(ctx echo.Context) error
// Update the task, typically to indicate progress, completion, or failure.
// (POST /api/worker/task/{task_id})
TaskUpdate(ctx echo.Context, taskId string) error
}
// ServerInterfaceWrapper converts echo contexts to parameters.
@ -145,6 +148,24 @@ func (w *ServerInterfaceWrapper) ScheduleTask(ctx echo.Context) error {
return err
}
// TaskUpdate converts echo context to params.
func (w *ServerInterfaceWrapper) TaskUpdate(ctx echo.Context) error {
var err error
// ------------- Path parameter "task_id" -------------
var taskId string
err = runtime.BindStyledParameterWithLocation("simple", false, "task_id", runtime.ParamLocationPath, ctx.Param("task_id"), &taskId)
if err != nil {
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter task_id: %s", err))
}
ctx.Set(Worker_authScopes, []string{""})
// Invoke the callback with all the unmarshalled arguments
err = w.Handler.TaskUpdate(ctx, taskId)
return err
}
// This is a simple interface which specifies echo.Route addition functions which
// are present on both echo.Echo and echo.Group, since we want to allow using
// either of them for path registration
@ -182,5 +203,6 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL
router.GET(baseURL+"/api/worker/state", wrapper.WorkerState)
router.POST(baseURL+"/api/worker/state-changed", wrapper.WorkerStateChanged)
router.POST(baseURL+"/api/worker/task", wrapper.ScheduleTask)
router.POST(baseURL+"/api/worker/task/:task_id", wrapper.TaskUpdate)
}

View File

@ -18,57 +18,61 @@ import (
// Base64 encoded, gzipped, json marshaled Swagger object
var swaggerSpec = []string{
"H4sIAAAAAAAC/9xa224ct/l/FWLyB5LgP7srW24v9qqOHTsyYlvIKshFLKw4w293KHHICcnRemsIyEP0",
"TdoAvWiu+gLKGxUfyTnPaqVactMahjA7PH3H33cYfohSlRdKgrQmmn+ITJpBTt3jU2P4WgI7oeYCfzMw",
"qeaF5UpG884o4YZQYvGJGsIt/taQAr8ERpItsRmQH5S+AD2N4qjQqgBtObhTUpXnVDL3zC3k7uH/NKyi",
"efTZrCFuFiibPfMLoqs4stsConlEtaZb/H2uElwdXhuruVyH98tCc6W53bYmcGlhDbqa4d+OLJc0Hx+4",
"eU9jqS33soPyW/iZyBE1F7sJKQ3o8YGSMxxYKZ1TG839i7g/8SqONPxUcg0smv9YTUKphb0DrzXtLRZ7",
"UmyJrE113OjztD5eJeeQWqTz6SXlgiYCXqlkAdY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JoBr2hvASyqb553rFDaqBsi6uQnv/m3hoX8drgfXe1YRo1WAk0TBb9rz3DcUoS957U",
"zfJlvAvMyO4dv22Xur17JCkkF2RT3kRKQYO/LbTdoYRhPxgljdHCIHgNjCHuFciaBw2o93WVGr2cN8Cz",
"/6+8F/A82M0rYUxOUm5I4q4qLtwNI5ogYAhgvjD1w+KAJfXwuuUrMVEakavUSokvoEdCJVQ4aKPC3DWe",
"raElTWF6rmrDXesd6TVJgRUCTvyM+P4awObN7wHDujvfzc53F1C9VuHOaPsenBt0l9dkLuPo0cHh3Y0k",
"Wh8nB5g/Bl024U9Bcg+ajx4eflrEL52bSqksUQtLuXTVsNNXTBaF9bfpVspd7JXKwZ8PglsG0htPnVb0",
"G7bb5+HO1Cb4nR4YWzQcd/LBTZ9D+z3swo3PRDfpwAPBj2/B7x7FG5LsCpFQpmD7jCz6uxS/AsRPUihp",
"bRziJZCXie7RwV+GN9jyf8wIwdx0I2+0mJhwJb2mjd7Yov97yRZv6y+IKHlM7DbnCRVi2/rgl2u10mBM",
"HG4khYvdmiwpF4WGvZBfAr0ByVrTFFR3SR3BBQuVMlL1uvRxP82eRI1aqGu8rxAo8V+Hle6KM4qwAuvG",
"XtUFqwUVC0Fb0yrjbs11BnXHR+3RZbO2UllWyPAplNu0N98c1+SDNi5PL/8bAAD//4q9w500NAAA",
}
// GetSwagger returns the content of the embedded swagger specification file

View File

@ -114,7 +114,6 @@ type AssignedTask struct {
Priority int `json:"priority"`
Status TaskStatus `json:"status"`
TaskType string `json:"task_type"`
User string `json:"user"`
Uuid string `json:"uuid"`
}
@ -234,6 +233,16 @@ type SubmittedJob struct {
// TaskStatus defines model for TaskStatus.
type TaskStatus string
// TaskUpdate is sent by a Worker to update the status & logs of a task it's executing.
type TaskUpdate struct {
// One-liner to indicate what's currently happening with the task. Overwrites previously sent activity strings.
Activity *string `json:"activity,omitempty"`
// Log lines for this task
Log *string `json:"log,omitempty"`
TaskStatus *TaskStatus `json:"taskStatus,omitempty"`
}
// WorkerRegistration defines model for WorkerRegistration.
type WorkerRegistration struct {
Nickname string `json:"nickname"`
@ -273,6 +282,9 @@ type SignOnJSONBody WorkerSignOn
// WorkerStateChangedJSONBody defines parameters for WorkerStateChanged.
type WorkerStateChangedJSONBody WorkerStateChanged
// TaskUpdateJSONBody defines parameters for TaskUpdate.
type TaskUpdateJSONBody TaskUpdate
// SubmitJobJSONRequestBody defines body for SubmitJob for application/json ContentType.
type SubmitJobJSONRequestBody SubmitJobJSONBody
@ -285,6 +297,9 @@ type SignOnJSONRequestBody SignOnJSONBody
// WorkerStateChangedJSONRequestBody defines body for WorkerStateChanged for application/json ContentType.
type WorkerStateChangedJSONRequestBody WorkerStateChangedJSONBody
// TaskUpdateJSONRequestBody defines body for TaskUpdate for application/json ContentType.
type TaskUpdateJSONRequestBody TaskUpdateJSONBody
// Getter for additional properties for JobMetadata. Returns the specified
// element and whether it was found
func (a JobMetadata) Get(fieldName string) (value string, found bool) {