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
117 changes: 0 additions & 117 deletions apis/workflows/v1/task_release.proto

This file was deleted.

40 changes: 40 additions & 0 deletions apis/workflows/v1/worker.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
edition = "2023";

package workflows.v1;

import "buf/validate/validate.proto";
import "google/protobuf/empty.proto";
import "workflows/v1/core.proto";
import "workflows/v1/task.proto";

// HandshakeRequest is sent by the runner to a worker runtime to discover its capabilities.
message HandshakeRequest {}

// HandshakeResponse is the response to a handshake request, containing the task identifiers that the worker can execute.
message HandshakeResponse {
workflows.v1.TaskIdentifiers task_identifiers = 1;
}

// ExecuteTaskResponse is the response of a worker runtime to a request to execute a task, after the task has
// been executed.
message ExecuteTaskResponse {
option (buf.validate.message).oneof = {
fields: [
"computed_task",
"failed_task"
]
};

// If the task execution succeeded, this field will be set with the computed task result.
workflows.v1.ComputedTask computed_task = 1;

// If the task execution failed, this field will be set with details about the failure.
workflows.v1.TaskFailedRequest failed_task = 2;
}

// WorkerService defines the RPC interface between a runner and a a worker runtime that can execute workflow tasks.
service WorkerService {
rpc Handshake(HandshakeRequest) returns (HandshakeResponse) {}
rpc ExecuteTask(workflows.v1.Task) returns (workflows.v1.ComputedTask) {}
rpc Shutdown(google.protobuf.Empty) returns (google.protobuf.Empty) {}
}
30 changes: 27 additions & 3 deletions apis/workflows/v1/workflows.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
message PublishWorkflowReleaseRequest {
string workflow_slug = 1 [(buf.validate.field).string.min_len = 1];
tilebox.v1.ID artifact_id = 2 [(buf.validate.field).required = true];
repeated TaskIdentifier tasks = 3 [(buf.validate.field).repeated.min_items = 1];
ReleaseContent content = 3 [(buf.validate.field).required = true];

Check failure on line 70 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" on message "PublishWorkflowReleaseRequest" changed name from "tasks" to "content".

Check failure on line 70 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" with name "content" on message "PublishWorkflowReleaseRequest" changed type from "workflows.v1.TaskIdentifier" to "workflows.v1.ReleaseContent".

Check failure on line 70 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" with name "content" on message "PublishWorkflowReleaseRequest" changed cardinality from "repeated" to "optional with explicit presence".

Check failure on line 70 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" with name "content" on message "PublishWorkflowReleaseRequest" changed option "json_name" from "tasks" to "content".
}

// ListWorkflowsRequest lists all workflows.
Expand Down Expand Up @@ -98,11 +98,35 @@
// WorkflowRelease represents an immutable release of a workflow, which includes a set of tasks and an artifact.
message WorkflowRelease {
tilebox.v1.ID id = 1;
tilebox.v1.ID artifact_id = 2;
repeated TaskIdentifier tasks = 3;
Artifact artifact = 2;

Check failure on line 101 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "2" on message "WorkflowRelease" changed name from "artifact_id" to "artifact".

Check failure on line 101 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "2" with name "artifact" on message "WorkflowRelease" changed type from "tilebox.v1.ID" to "workflows.v1.Artifact".

Check failure on line 101 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "2" with name "artifact" on message "WorkflowRelease" changed option "json_name" from "artifactId" to "artifact".
ReleaseContent content = 3;

Check failure on line 102 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" with name "content" on message "WorkflowRelease" changed type from "workflows.v1.TaskIdentifier" to "workflows.v1.ReleaseContent".

Check failure on line 102 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" with name "content" on message "WorkflowRelease" changed cardinality from "repeated" to "optional with explicit presence".

Check failure on line 102 in apis/workflows/v1/workflows.proto

View workflow job for this annotation

GitHub Actions / Buf

Field "3" with name "content" on message "WorkflowRelease" changed option "json_name" from "tasks" to "content".
google.protobuf.Timestamp created_at = 4;
}

// Artifact represents the artifact associated with a workflow release,
// which is the file that contains the code and dependencies needed to execute the tasks in the release.
message Artifact {
tilebox.v1.ID id = 1;
string digest = 2 [(buf.validate.field).string.pattern = "^[a-f0-9]{64}$"];
}

// ReleaseContent represents the content of a workflow release, which is the set of files that are included,
// the list of task identifiers, and the command to start a worker runtime for executing the tasks in the release.
// The fingerprint is a hash of the release content.
message ReleaseContent {
string fingerprint = 1 [(buf.validate.field).string.pattern = "^[a-f0-9]{64}$"];
repeated TaskIdentifier tasks = 2 [(buf.validate.field).repeated.min_items = 1];
Path root = 3;
repeated string command = 4;
}

// Path represents a file or directory path in the release content. If it is a directory, it can have child paths.
message Path {
string path = 1;
bool directory = 2;
repeated Path children = 3;
}

// DeployWorkflowReleaseRequest deploys a workflow release to a set of clusters, making the tasks available for
// execution on those clusters.
message DeployWorkflowReleaseRequest {
Expand Down