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
15 changes: 2 additions & 13 deletions apis/workflows/v1/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ message Job {
google.protobuf.Timestamp submitted_at = 7;
// The time the job started running. Deprecated, use execution_stats.first_task_started_at instead.
google.protobuf.Timestamp started_at = 8 [deprecated = true];
// A list of tasks of the job.
repeated TaskSummary task_summaries = 9;
reserved 9;
reserved task_summaries;
// The automation that submitted the job.
tilebox.v1.ID automation_id = 10;
// A list of progress indicators for the job.
Expand Down Expand Up @@ -90,17 +90,6 @@ enum JobState {
JOB_STATE_CANCELED = 6;
}

// A summary of a task. Mainly used in the Console.
message TaskSummary {
tilebox.v1.ID id = 1;
string display = 2;
TaskState state = 3;
tilebox.v1.ID parent_id = 4;
reserved 5; // depends_on in case we want to add that in the future
google.protobuf.Timestamp started_at = 6;
google.protobuf.Timestamp stopped_at = 7;
}

// Progress is an indicator of total and completed work units for a job.
message Progress {
// A human-readable label for the progress indicator. Can also be empty.
Expand Down
73 changes: 68 additions & 5 deletions apis/workflows/v1/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package workflows.v1;

import "buf/validate/validate.proto";
import "google/protobuf/timestamp.proto";
import "tilebox/v1/id.proto";
import "tilebox/v1/query.proto";
import "workflows/v1/core.proto";
Expand Down Expand Up @@ -45,11 +46,73 @@
tilebox.v1.ID job_id = 1 [(buf.validate.field).required = true];
}

// GetJobProgressRequest requests a jobs progress. It returns a full job object, but only
// partially filled with progress indicators, job state and a started_at timestamp.
message GetJobProgressRequest {
// The ID of the job to get progress for.
// TaskSummary is a compact representation of a task within a job's task tree.
message TaskSummary {
// The ID of the task. Tasks are ordered by this ID within a sibling collection.
tilebox.v1.ID id = 1;
// The ID of the closest non-virtual ancestor task. It is absent for a root task.
tilebox.v1.ID parent_id = 2 [features.field_presence = EXPLICIT];

Check failure on line 54 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "2" on message "TaskSummary" changed name from "display" to "parent_id".

Check failure on line 54 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "2" with name "parent_id" on message "TaskSummary" changed type from "string" to "message". See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules and https://developers.google.com/protocol-buffers/docs/proto3#json for JSON compatibility rules.

Check failure on line 54 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "2" with name "parent_id" on message "TaskSummary" changed option "json_name" from "display" to "parentId".
// A human-readable representation of the task.
string display = 3;

Check failure on line 56 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" on message "TaskSummary" changed name from "state" to "display".

Check failure on line 56 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" with name "display" on message "TaskSummary" changed type from "enum" to "string". See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules and https://developers.google.com/protocol-buffers/docs/proto3#json for JSON compatibility rules.

Check failure on line 56 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" with name "display" on message "TaskSummary" changed option "json_name" from "state" to "display".
// The current state of the task.
TaskState state = 4;

Check failure on line 58 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "4" on message "TaskSummary" changed name from "parent_id" to "state".

Check failure on line 58 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "4" with name "state" on message "TaskSummary" changed type from "message" to "enum". See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules and https://developers.google.com/protocol-buffers/docs/proto3#json for JSON compatibility rules.

Check failure on line 58 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "4" with name "state" on message "TaskSummary" changed option "json_name" from "parentId" to "state".
// The time the task was submitted.
google.protobuf.Timestamp submitted_at = 5;
// The time the task started running.
google.protobuf.Timestamp started_at = 6;
// The time the task stopped running.
google.protobuf.Timestamp stopped_at = 7;
// The serialized input parameters in the format expected by the task.
bytes input = 8 [features.field_presence = EXPLICIT];
// The number of times the task has been retried.
int64 retry_count = 9;
// The maximum number of times the task may be retried.
int64 max_retries = 10;
// Whether the task has children in the user-visible tree.
bool has_children = 11;
// The ID of the cluster on which the task is scheduled to run.
tilebox.v1.ID cluster_id = 12;
// Whether failure of the task is optional, either directly or through an optional ancestor.
bool optional = 13;
}

Check failure on line 77 in apis/workflows/v1/job.proto

View workflow job for this annotation

GitHub Actions / Buf

Previously present reserved range "[5]" on message "TaskSummary" is missing values: [5] were removed.

// JobTaskChildrenPrefetch configures the child pages included with the requested task page.
message JobTaskChildrenPrefetch {
// The maximum number of user-visible children to return for each task in the requested page.
int64 limit = 1 [(buf.validate.field).int64 = {
gte: 1
lte: 100
}];
}

// ListJobTasksRequest requests one page from a job's task tree.
message ListJobTasksRequest {
// The ID of the job whose tasks to list.
tilebox.v1.ID job_id = 1 [(buf.validate.field).required = true];
// The parent whose user-visible children to list. If absent, root tasks are listed.
tilebox.v1.ID parent_task_id = 2 [features.field_presence = EXPLICIT];
// The pagination parameters for the requested sibling collection.
tilebox.v1.Pagination page = 3 [features.field_presence = EXPLICIT];
// Optional configuration for prefetching one user-visible child page per returned task.
JobTaskChildrenPrefetch prefetch_children = 4 [features.field_presence = EXPLICIT];
}

// JobTaskPage is one page of a job's root tasks or one parent's user-visible children.
message JobTaskPage {
// The user-visible parent of this sibling collection. It is absent for the root collection.
tilebox.v1.ID parent_task_id = 1 [features.field_presence = EXPLICIT];
// The tasks in this page, ordered by ascending task ID.
repeated TaskSummary tasks = 2;
// The pagination parameters for the next page of this sibling collection.
tilebox.v1.Pagination next_page = 3 [features.field_presence = EXPLICIT];
}

// ListJobTasksResponse contains the requested task page and any prefetched child pages.
message ListJobTasksResponse {
// The requested page.
JobTaskPage page = 1;
// The first user-visible child page for each task in page that has children.
repeated JobTaskPage prefetched_child_pages = 2;
}

// RetryJobRequest requests a retry of a job that has failed.
Expand Down Expand Up @@ -178,7 +241,7 @@
service JobService {
rpc SubmitJob(SubmitJobRequest) returns (Job);
rpc GetJob(GetJobRequest) returns (Job);
rpc GetJobProgress(GetJobProgressRequest) returns (Job);
rpc ListJobTasks(ListJobTasksRequest) returns (ListJobTasksResponse);
rpc RetryJob(RetryJobRequest) returns (RetryJobResponse);
rpc CancelJob(CancelJobRequest) returns (CancelJobResponse);
rpc VisualizeJob(VisualizeJobRequest) returns (Diagram);
Expand Down