-
Notifications
You must be signed in to change notification settings - Fork 669
/
agent.proto
258 lines (226 loc) · 9.03 KB
/
agent.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
syntax = "proto3";
package flyteidl.admin;
option go_package = "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/admin";
import "flyteidl/core/literals.proto";
import "flyteidl/core/tasks.proto";
import "flyteidl/core/workflow.proto";
import "flyteidl/core/identifier.proto";
import "flyteidl/core/execution.proto";
import "flyteidl/core/metrics.proto";
import "flyteidl/core/security.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/struct.proto";
// The state of the execution is used to control its visibility in the UI/CLI.
enum State {
option deprecated = true;
RETRYABLE_FAILURE = 0;
PERMANENT_FAILURE = 1;
PENDING = 2;
RUNNING = 3;
SUCCEEDED = 4;
}
// Represents a subset of runtime task execution metadata that are relevant to external plugins.
message TaskExecutionMetadata {
// ID of the task execution
core.TaskExecutionIdentifier task_execution_id = 1;
// k8s namespace where the task is executed in
string namespace = 2;
// Labels attached to the task execution
map<string, string> labels = 3;
// Annotations attached to the task execution
map<string, string> annotations = 4;
// k8s service account associated with the task execution
string k8s_service_account = 5;
// Environment variables attached to the task execution
map<string, string> environment_variables = 6;
// Represents the maximum number of attempts allowed for a task.
// If a task fails, it can be retried up to this maximum number of attempts.
int32 max_attempts = 7;
// Indicates whether the task execution can be interrupted.
// If set to true, the task can be stopped before completion.
bool interruptible = 8;
// Specifies the threshold for failure count at which the interruptible property
// will take effect. If the number of consecutive task failures exceeds this threshold,
// interruptible behavior will be activated.
int32 interruptible_failure_threshold = 9;
// Overrides for specific properties of the task node.
// These overrides can be used to customize the behavior of the task node.
core.TaskNodeOverrides overrides = 10;
// Identity of user running this task execution
core.Identity identity = 11;
}
// Represents a request structure to create task.
message CreateTaskRequest {
// The inputs required to start the execution. All required inputs must be
// included in this map. If not required and not provided, defaults apply.
// +optional
core.LiteralMap inputs = 1;
// Template of the task that encapsulates all the metadata of the task.
core.TaskTemplate template = 2;
// Prefix for where task output data will be written. (e.g. s3://my-bucket/randomstring)
string output_prefix = 3;
// subset of runtime task execution metadata.
TaskExecutionMetadata task_execution_metadata = 4;
}
// Represents a create response structure.
message CreateTaskResponse {
// ResourceMeta is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
bytes resource_meta = 1;
}
message CreateRequestHeader {
// Template of the task that encapsulates all the metadata of the task.
core.TaskTemplate template = 1;
// Prefix for where task output data will be written. (e.g. s3://my-bucket/randomstring)
string output_prefix = 2;
// subset of runtime task execution metadata.
TaskExecutionMetadata task_execution_metadata = 3;
// MaxDatasetSizeBytes is the maximum size of the dataset that can be generated by the task.
int64 max_dataset_size_bytes = 4;
}
message ExecuteTaskSyncRequest {
oneof part {
CreateRequestHeader header = 1;
core.LiteralMap inputs = 2;
}
}
message ExecuteTaskSyncResponseHeader {
Resource resource = 1;
}
message ExecuteTaskSyncResponse {
// Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
// Resource is for synchronous task execution.
oneof res {
ExecuteTaskSyncResponseHeader header = 1;
core.LiteralMap outputs = 2;
}
}
// A message used to fetch a job resource from flyte agent server.
message GetTaskRequest {
// A predefined yet extensible Task type identifier.
string task_type = 1 [deprecated = true];
// Metadata about the resource to be pass to the agent.
bytes resource_meta = 2;
// A predefined yet extensible Task type identifier.
TaskCategory task_category = 3;
}
// Response to get an individual task resource.
message GetTaskResponse {
Resource resource = 1;
}
message Resource {
// DEPRECATED. The state of the execution is used to control its visibility in the UI/CLI.
State state = 1 [deprecated = true];
// The outputs of the execution. It's typically used by sql task. Agent service will create a
// Structured dataset pointing to the query result table.
// +optional
core.LiteralMap outputs = 2;
// A descriptive message for the current state. e.g. waiting for cluster.
string message = 3;
// log information for the task execution.
repeated core.TaskLog log_links = 4;
// The phase of the execution is used to determine the phase of the plugin's execution.
core.TaskExecution.Phase phase = 5;
// Custom data specific to the agent.
google.protobuf.Struct custom_info = 6;
}
// A message used to delete a task.
message DeleteTaskRequest {
// A predefined yet extensible Task type identifier.
string task_type = 1 [deprecated = true];
// Metadata about the resource to be pass to the agent.
bytes resource_meta = 2;
// A predefined yet extensible Task type identifier.
TaskCategory task_category = 3;
}
// Response to delete a task.
message DeleteTaskResponse {}
// A message containing the agent metadata.
message Agent {
// Name is the developer-assigned name of the agent.
string name = 1;
// SupportedTaskTypes are the types of the tasks that the agent can handle.
repeated string supported_task_types = 2 [deprecated = true];
// IsSync indicates whether this agent is a sync agent. Sync agents are expected to return their
// results synchronously when called by propeller. Given that sync agents can affect the performance
// of the system, it's important to enforce strict timeout policies.
// An Async agent, on the other hand, is required to be able to identify jobs by an
// identifier and query for job statuses as jobs progress.
bool is_sync = 3;
// Supported_task_categories are the categories of the tasks that the agent can handle.
repeated TaskCategory supported_task_categories = 4;
}
message TaskCategory {
// The name of the task type.
string name = 1;
// The version of the task type.
int32 version = 2;
}
// A request to get an agent.
message GetAgentRequest {
// The name of the agent.
string name = 1;
}
// A response containing an agent.
message GetAgentResponse {
Agent agent = 1;
}
// A request to list all agents.
message ListAgentsRequest {}
// A response containing a list of agents.
message ListAgentsResponse {
repeated Agent agents = 1;
}
// A request to get the metrics from a task execution.
message GetTaskMetricsRequest {
// A predefined yet extensible Task type identifier.
string task_type = 1 [deprecated = true];
// Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
bytes resource_meta = 2;
// The metrics to query. If empty, will return a default set of metrics.
// e.g. EXECUTION_METRIC_USED_CPU_AVG or EXECUTION_METRIC_USED_MEMORY_BYTES_AVG
repeated string queries = 3;
// Start timestamp, inclusive.
google.protobuf.Timestamp start_time = 4;
// End timestamp, inclusive..
google.protobuf.Timestamp end_time = 5;
// Query resolution step width in duration format or float number of seconds.
google.protobuf.Duration step = 6;
// A predefined yet extensible Task type identifier.
TaskCategory task_category = 7;
}
// A response containing a list of metrics for a task execution.
message GetTaskMetricsResponse {
// The execution metric results.
repeated core.ExecutionMetricResult results = 1;
}
// A request to get the log from a task execution.
message GetTaskLogsRequest {
// A predefined yet extensible Task type identifier.
string task_type = 1 [deprecated = true];
// Metadata is created by the agent. It could be a string (jobId) or a dict (more complex metadata).
bytes resource_meta = 2;
// Number of lines to return.
uint64 lines = 3;
// In the case of multiple pages of results, the server-provided token can be used to fetch the next page
// in a query. If there are no more results, this value will be empty.
string token = 4;
// A predefined yet extensible Task type identifier.
TaskCategory task_category = 5;
}
message GetTaskLogsResponseHeader {
// In the case of multiple pages of results, the server-provided token can be used to fetch the next page
// in a query. If there are no more results, this value will be empty.
string token = 1;
}
message GetTaskLogsResponseBody {
// The execution log results.
repeated string results = 1;
}
// A response containing the logs for a task execution.
message GetTaskLogsResponse {
oneof part {
GetTaskLogsResponseHeader header = 1;
GetTaskLogsResponseBody body = 2;
}
}