Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apis/workflows/v1/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ message Job {
repeated TaskSummary task_summaries = 9;
// The automation that submitted the job.
tilebox.v1.ID automation_id = 10;
// A list of progress bars for the job.
repeated ProgressBar progress_bars = 11;
}

// The state of a job.
Expand All @@ -65,6 +67,16 @@ message TaskSummary {
google.protobuf.Timestamp stopped_at = 7;
}

// ProgressBar is an indication of progress for a workflow.
message ProgressBar {
// A human-readable label displayed next to the progress bar. Can also be empty.
string label = 1 [(buf.validate.field).string.max_len = 100];
// The total number of work units to be processed.
uint64 total = 2;
// The number of work units that have already been processed.
uint64 done = 3;
}

// A task is a single unit of work.
message Task {
// The id of the task instance. Contains the submission timestamp as the time part of the ULID.
Expand Down
10 changes: 10 additions & 0 deletions apis/workflows/v1/task.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ message ComputedTask {
string display = 2;
// A list of sub-tasks that the just computed task spawned.
repeated TaskSubmission sub_tasks = 3 [(buf.validate.field).repeated.max_items = 64];
// A list of progress bar updates that the computed task wants to report.
repeated ProgressBar progress_updates = 4;
}

// IdlingResponse is set in the response of a NextTaskRequest if no task was returned, indicating that the requesting
Expand Down Expand Up @@ -64,9 +66,17 @@ message NextTaskResponse {

// TaskFailedRequest is the request for marking a task as failed.
message TaskFailedRequest {
// The id of the task that has failed.
tilebox.v1.ID task_id = 1 [(buf.validate.field).required = true];
// A display name for the task that has failed for visualization purposes.
string display = 2;
// Whether to cancel the job that the task belongs to.
bool cancel_job = 3;
// A list of progress bar updates that the failed task wants to report. Even if a task fails, it could
// still have made some progress before failing, and we want to reflect that progress.
// Since progress updates are idempotent, retrying the task and getting the same progress update again
// is not an issue.
repeated ProgressBar progress_updates = 4;
}

// TaskStateResponse is the response to the TaskFailed request,
Expand Down