-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathrun.proto
361 lines (302 loc) · 10.4 KB
/
run.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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
// Copyright 2018 The Kubeflow Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option go_package = "github.com/kubeflow/pipelines/backend/api/v1beta1/go_client";
package api;
import "backend/api/v1beta1/error.proto";
import "google/protobuf/empty.proto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "backend/api/v1beta1/pipeline_spec.proto";
import "backend/api/v1beta1/resource_reference.proto";
import "protoc-gen-swagger/options/annotations.proto";
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
responses: {
key: "default";
value: {
schema: {
json_schema: {
ref: ".api.Status";
}
}
}
}
// Use bearer token for authorizing access to job service.
// Kubernetes client library(https://kubernetes.io/docs/reference/using-api/client-libraries/)
// uses bearer token as default for authorization. The section below
// ensures security definition object is generated in the swagger definition.
// For more details see https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject
security_definitions: {
security: {
key: "Bearer";
value: {
type: TYPE_API_KEY;
in: IN_HEADER;
name: "authorization";
}
}
}
security: {
security_requirement: {
key: "Bearer";
value: {};
}
}
};
service RunService {
// Creates a new run.
rpc CreateRunV1(CreateRunRequest) returns (RunDetail) {
option (google.api.http) = {
post: "/apis/v1beta1/runs"
body: "run"
};
}
// Finds a specific run by ID.
rpc GetRunV1(GetRunRequest) returns (RunDetail) {
option (google.api.http) = {
get: "/apis/v1beta1/runs/{run_id}"
};
}
// Finds all runs.
rpc ListRunsV1(ListRunsRequest) returns (ListRunsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/runs"
};
}
// Archives a run.
rpc ArchiveRunV1(ArchiveRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{id}:archive"
};
}
// Restores an archived run.
rpc UnarchiveRunV1(UnarchiveRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{id}:unarchive"
};
}
// Deletes a run.
rpc DeleteRunV1(DeleteRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/apis/v1beta1/runs/{id}"
};
}
// ReportRunMetrics reports metrics of a run. Each metric is reported in its
// own transaction, so this API accepts partial failures. Metric can be
// uniquely identified by (run_id, node_id, name). Duplicate reporting will be
// ignored by the API. First reporting wins.
rpc ReportRunMetricsV1(ReportRunMetricsRequest)
returns (ReportRunMetricsResponse) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{run_id}:reportMetrics"
body: "*"
};
}
// Finds a run's artifact data.
rpc ReadArtifactV1(ReadArtifactRequest) returns (ReadArtifactResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/runs/{run_id}/nodes/{node_id}/artifacts/{artifact_name}:read"
};
}
// Terminates an active run.
rpc TerminateRunV1(TerminateRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{run_id}/terminate"
};
}
// Re-initiates a failed or terminated run.
rpc RetryRunV1(RetryRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{run_id}/retry"
};
}
}
message CreateRunRequest {
Run run = 1;
}
message GetRunRequest {
// The ID of the run to be retrieved.
string run_id = 1;
}
message ListRunsRequest {
// A page token to request the next page of results. The token is acquried
// from the nextPageToken field of the response from the previous
// ListRuns call or can be omitted when fetching the first page.
string page_token = 1;
// The number of runs to be listed per page. If there are more runs than this
// number, the response message will contain a nextPageToken field you can use
// to fetch the next page.
int32 page_size = 2;
// Can be format of "field_name", "field_name asc" or "field_name desc"
// (Example, "name asc" or "id desc"). Ascending by default.
string sort_by = 3;
// What resource reference to filter on.
// E.g. If listing run for an experiment, the query string would be
// resource_reference_key.type=EXPERIMENT&resource_reference_key.id=123
ResourceKey resource_reference_key = 4;
// A url-encoded, JSON-serialized Filter protocol buffer (see
// [filter.proto](https://github.com/kubeflow/pipelines/blob/master/backend/api/v1beta1/filter.proto)).
string filter = 5;
}
message TerminateRunRequest {
// The ID of the run to be terminated.
string run_id = 1;
}
message RetryRunRequest {
// The ID of the run to be retried.
string run_id = 1;
}
message ListRunsResponse {
repeated Run runs = 1;
// The total number of runs for the given query.
int32 total_size = 3;
// The token to list the next page of runs.
string next_page_token = 2;
}
message ArchiveRunRequest {
// The ID of the run to be archived.
string id = 1;
}
message UnarchiveRunRequest {
// The ID of the run to be restored.
string id = 1;
}
message DeleteRunRequest {
// The ID of the run to be deleted.
string id = 1;
}
message Run {
// Output. Unique run ID. Generated by API server.
string id = 1;
// Required input field. Name provided by user,
// or auto generated if run is created by scheduled job. Not unique.
string name = 2;
enum StorageState {
STORAGESTATE_AVAILABLE = 0;
STORAGESTATE_ARCHIVED = 1;
}
// Output. Specify whether this run is in archived or available mode.
StorageState storage_state = 10;
// Optional input field. Describing the purpose of the run
string description = 3;
// Required input field.
// Describing what the pipeline manifest and parameters to use for the run.
PipelineSpec pipeline_spec = 4;
// Optional input field. Specify which resource this run belongs to.
// When creating a run from a particular pipeline version, the pipeline
// version can be specified here.
repeated ResourceReference resource_references = 5;
// Optional input field. Specify which Kubernetes service account this run uses.
string service_account = 14;
// Output. The time that the run created.
google.protobuf.Timestamp created_at = 6;
// Output. When this run is scheduled to run. This could be different from
// created_at. For example, if a run is from a backfilling job that was
// supposed to run 2 month ago, the scheduled_at is 2 month ago,
// v.s. created_at is the current time.
google.protobuf.Timestamp scheduled_at = 7;
// Output. The time this run is finished.
google.protobuf.Timestamp finished_at = 13;
// Output. The status of the run.
// One of [Pending, Running, Succeeded, Skipped, Failed, Error]
string status = 8;
// In case any error happens retrieving a run field, only run ID
// and the error message is returned. Client has the flexibility of choosing
// how to handle error. This is especially useful during listing call.
string error = 12;
// Output. The metrics of the run. The metrics are reported by ReportMetrics
// API.
repeated RunMetric metrics = 9;
}
// Next field number of Run will be 15
message PipelineRuntime {
// Output. The runtime JSON manifest of the pipeline, including the status
// of pipeline steps and fields need for UI visualization etc.
string pipeline_manifest = 10;
// Output. The runtime JSON manifest of the argo workflow.
// This is deprecated after pipeline_runtime_manifest is in use.
string workflow_manifest = 11;
}
message RunDetail {
Run run = 1;
PipelineRuntime pipeline_runtime = 2;
}
message RunMetric {
// Required. The user defined name of the metric. It must between 1 and 63
// characters long and must conform to the following regular expression:
// `[a-z]([-a-z0-9]*[a-z0-9])?`.
string name = 1;
// Required. The runtime node ID which reports the metric. The node ID can be
// found in the RunDetail.workflow.Status. Metric with same (node_id, name)
// are considerd as duplicate. Only the first reporting will be recorded. Max
// length is 128.
string node_id = 2;
oneof value {
// The number value of the metric.
double number_value = 3;
}
enum Format {
// Default value if not present.
UNSPECIFIED = 0;
// Display value as its raw format.
RAW = 1;
// Display value in percentage format.
PERCENTAGE = 2;
}
// The display format of metric.
Format format = 4;
}
message ReportRunMetricsRequest {
// Required. The parent run ID of the metric.
string run_id = 1;
// List of metrics to report.
repeated RunMetric metrics = 2;
}
message ReportRunMetricsResponse {
message ReportRunMetricResult {
// Output. The name of the metric.
string metric_name = 1;
// Output. The ID of the node which reports the metric.
string metric_node_id = 2;
enum Status {
// Default value if not present.
UNSPECIFIED = 0;
// Indicates successful reporting.
OK = 1;
// Indicates that the payload of the metric is invalid.
INVALID_ARGUMENT = 2;
// Indicates that the metric has been reported before.
DUPLICATE_REPORTING = 3;
// Indicates that something went wrong in the server.
INTERNAL_ERROR = 4;
}
// Output. The status of the metric reporting.
Status status = 3;
// Output. The detailed message of the error of the reporting.
string message = 4;
}
repeated ReportRunMetricResult results = 1;
}
message ReadArtifactRequest {
// The ID of the run.
string run_id = 1;
// The ID of the running node.
string node_id = 2;
// The name of the artifact.
string artifact_name = 3;
}
message ReadArtifactResponse {
// The bytes of the artifact content.
bytes data = 1;
}