Debian Codegraph @

third_party/googleapis/google/genomics/v1alpha2/pipelines.proto

raw
1 // Copyright 2016 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 syntax = "proto3";
16
17 package google.genomics.v1alpha2;
18
19 import "google/api/annotations.proto";
20 import "google/longrunning/operations.proto";
21 import "google/protobuf/duration.proto";
22 import "google/protobuf/empty.proto";
23 import "google/protobuf/timestamp.proto";
24 import "google/rpc/code.proto";
25
26 option cc_enable_arenas = true;
27 option go_package = "google.golang.org/genproto/googleapis/genomics/v1alpha2;genomics";
28 option java_multiple_files = true;
29 option java_outer_classname = "PipelinesProto";
30 option java_package = "com.google.genomics.v1a";
31
32
33 // A service for running genomics pipelines.
34 service PipelinesV1Alpha2 {
35 // Creates a pipeline that can be run later. Create takes a Pipeline that
36 // has all fields other than `pipelineId` populated, and then returns
37 // the same pipeline with `pipelineId` populated. This id can be used
38 // to run the pipeline.
39 //
40 // Caller must have WRITE permission to the project.
41 rpc CreatePipeline(CreatePipelineRequest) returns (Pipeline) {
42 option (google.api.http) = { post: "/v1alpha2/pipelines" body: "pipeline" };
43 }
44
45 // Runs a pipeline. If `pipelineId` is specified in the request, then
46 // run a saved pipeline. If `ephemeralPipeline` is specified, then run
47 // that pipeline once without saving a copy.
48 //
49 // The caller must have READ permission to the project where the pipeline
50 // is stored and WRITE permission to the project where the pipeline will be
51 // run, as VMs will be created and storage will be used.
52 rpc RunPipeline(RunPipelineRequest) returns (google.longrunning.Operation) {
53 option (google.api.http) = { post: "/v1alpha2/pipelines:run" body: "*" };
54 }
55
56 // Retrieves a pipeline based on ID.
57 //
58 // Caller must have READ permission to the project.
59 rpc GetPipeline(GetPipelineRequest) returns (Pipeline) {
60 option (google.api.http) = { get: "/v1alpha2/pipelines/{pipeline_id}" };
61 }
62
63 // Lists pipelines.
64 //
65 // Caller must have READ permission to the project.
66 rpc ListPipelines(ListPipelinesRequest) returns (ListPipelinesResponse) {
67 option (google.api.http) = { get: "/v1alpha2/pipelines" };
68 }
69
70 // Deletes a pipeline based on ID.
71 //
72 // Caller must have WRITE permission to the project.
73 rpc DeletePipeline(DeletePipelineRequest) returns (google.protobuf.Empty) {
74 option (google.api.http) = { delete: "/v1alpha2/pipelines/{pipeline_id}" };
75 }
76
77 // Gets controller configuration information. Should only be called
78 // by VMs created by the Pipelines Service and not by end users.
79 rpc GetControllerConfig(GetControllerConfigRequest) returns (ControllerConfig) {
80 option (google.api.http) = { get: "/v1alpha2/pipelines:getControllerConfig" };
81 }
82
83 // Sets status of a given operation. Any new timestamps (as determined by
84 // description) are appended to TimestampEvents. Should only be called by VMs
85 // created by the Pipelines Service and not by end users.
86 rpc SetOperationStatus(SetOperationStatusRequest) returns (google.protobuf.Empty) {
87 option (google.api.http) = { put: "/v1alpha2/pipelines:setOperationStatus" body: "*" };
88 }
89 }
90
91 // Describes a Compute Engine resource that is being managed by a running
92 // [pipeline][google.genomics.v1alpha2.Pipeline].
93 message ComputeEngine {
94 // The instance on which the operation is running.
95 string instance_name = 1;
96
97 // The availability zone in which the instance resides.
98 string zone = 2;
99
100 // The machine type of the instance.
101 string machine_type = 3;
102
103 // The names of the disks that were created for this pipeline.
104 repeated string disk_names = 4;
105 }
106
107 // Runtime metadata that will be populated in the
108 // [runtimeMetadata][google.genomics.v1.OperationMetadata.runtime_metadata]
109 // field of the Operation associated with a RunPipeline execution.
110 message RuntimeMetadata {
111 // Execution information specific to Google Compute Engine.
112 ComputeEngine compute_engine = 1;
113 }
114
115 // The pipeline object. Represents a transformation from a set of input
116 // parameters to a set of output parameters. The transformation is defined
117 // as a docker image and command to run within that image. Each pipeline
118 // is run on a Google Compute Engine VM. A pipeline can be created with the
119 // `create` method and then later run with the `run` method, or a pipeline can
120 // be defined and run all at once with the `run` method.
121 message Pipeline {
122 // Required. The project in which to create the pipeline. The caller must have
123 // WRITE access.
124 string project_id = 1;
125
126 // Required. A user specified pipeline name that does not have to be unique.
127 // This name can be used for filtering Pipelines in ListPipelines.
128 string name = 2;
129
130 // User-specified description.
131 string description = 3;
132
133 // Input parameters of the pipeline.
134 repeated PipelineParameter input_parameters = 8;
135
136 // Output parameters of the pipeline.
137 repeated PipelineParameter output_parameters = 9;
138
139 // Required. The executor indicates in which environment the pipeline runs.
140 oneof executor {
141 // Specifies the docker run information.
142 DockerExecutor docker = 5;
143 }
144
145 // Required. Specifies resource requirements for the pipeline run.
146 // Required fields:
147 //
148 // *
149 // [minimumCpuCores][google.genomics.v1alpha2.PipelineResources.minimum_cpu_cores]
150 //
151 // *
152 // [minimumRamGb][google.genomics.v1alpha2.PipelineResources.minimum_ram_gb]
153 PipelineResources resources = 6;
154
155 // Unique pipeline id that is generated by the service when CreatePipeline
156 // is called. Cannot be specified in the Pipeline used in the
157 // CreatePipelineRequest, and will be populated in the response to
158 // CreatePipeline and all subsequent Get and List calls. Indicates that the
159 // service has registered this pipeline.
160 string pipeline_id = 7;
161 }
162
163 // The request to create a pipeline. The pipeline field here should not have
164 // `pipelineId` populated, as that will be populated by the server.
165 message CreatePipelineRequest {
166 // The pipeline to create. Should not have `pipelineId` populated.
167 Pipeline pipeline = 1;
168 }
169
170 // The pipeline run arguments.
171 message RunPipelineArgs {
172 // Required. The project in which to run the pipeline. The caller must have
173 // WRITER access to all Google Cloud services and resources (e.g. Google
174 // Compute Engine) will be used.
175 string project_id = 1;
176
177 // Pipeline input arguments; keys are defined in the pipeline documentation.
178 // All input parameters that do not have default values must be specified.
179 // If parameters with defaults are specified here, the defaults will be
180 // overridden.
181 map<string, string> inputs = 2;
182
183 // Pipeline output arguments; keys are defined in the pipeline
184 // documentation. All output parameters of without default values
185 // must be specified. If parameters with defaults are specified
186 // here, the defaults will be overridden.
187 map<string, string> outputs = 3;
188
189 // The Google Cloud Service Account that will be used to access data and
190 // services. By default, the compute service account associated with
191 // `projectId` is used.
192 ServiceAccount service_account = 4;
193
194 // This field is deprecated. Use `labels` instead. Client-specified pipeline
195 // operation identifier.
196 string client_id = 5;
197
198 // Specifies resource requirements/overrides for the pipeline run.
199 PipelineResources resources = 6;
200
201 // Required. Logging options. Used by the service to communicate results
202 // to the user.
203 LoggingOptions logging = 7;
204
205 // How long to keep the VM up after a failure (for example docker command
206 // failed, copying input or output files failed, etc). While the VM is up, one
207 // can ssh into the VM to debug. Default is 0; maximum allowed value is 1 day.
208 google.protobuf.Duration keep_vm_alive_on_failure_duration = 8;
209
210 // Labels to apply to this pipeline run. Labels will also be applied to
211 // compute resources (VM, disks) created by this pipeline run. When listing
212 // operations, operations can [filtered by labels]
213 // [google.longrunning.ListOperationsRequest.filter].
214 // Label keys may not be empty; label values may be empty. Non-empty labels
215 // must be 1-63 characters long, and comply with [RFC1035]
216 // (https://www.ietf.org/rfc/rfc1035.txt).
217 // Specifically, the name must be 1-63 characters long and match the regular
218 // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
219 // character must be a lowercase letter, and all following characters must be
220 // a dash, lowercase letter, or digit, except the last character, which cannot
221 // be a dash.
222 map<string, string> labels = 9;
223 }
224
225 // The request to run a pipeline. If `pipelineId` is specified, it
226 // refers to a saved pipeline created with CreatePipeline and set as
227 // the `pipelineId` of the returned Pipeline object. If
228 // `ephemeralPipeline` is specified, that pipeline is run once
229 // with the given args and not saved. It is an error to specify both
230 // `pipelineId` and `ephemeralPipeline`. `pipelineArgs`
231 // must be specified.
232 message RunPipelineRequest {
233 oneof pipeline {
234 // The already created pipeline to run.
235 string pipeline_id = 1;
236
237 // A new pipeline object to run once and then delete.
238 Pipeline ephemeral_pipeline = 2;
239 }
240
241 // The arguments to use when running this pipeline.
242 RunPipelineArgs pipeline_args = 3;
243 }
244
245 // A request to get a saved pipeline by id.
246 message GetPipelineRequest {
247 // Caller must have READ access to the project in which this pipeline
248 // is defined.
249 string pipeline_id = 1;
250 }
251
252 // A request to list pipelines in a given project. Pipelines can be
253 // filtered by name using `namePrefix`: all pipelines with names that
254 // begin with `namePrefix` will be returned. Uses standard pagination:
255 // `pageSize` indicates how many pipelines to return, and
256 // `pageToken` comes from a previous ListPipelinesResponse to
257 // indicate offset.
258 message ListPipelinesRequest {
259 // Required. The name of the project to search for pipelines. Caller
260 // must have READ access to this project.
261 string project_id = 1;
262
263 // Pipelines with names that match this prefix should be
264 // returned. If unspecified, all pipelines in the project, up to
265 // `pageSize`, will be returned.
266 string name_prefix = 2;
267
268 // Number of pipelines to return at once. Defaults to 256, and max
269 // is 2048.
270 int32 page_size = 3;
271
272 // Token to use to indicate where to start getting results.
273 // If unspecified, returns the first page of results.
274 string page_token = 4;
275 }
276
277 // The response of ListPipelines. Contains at most `pageSize`
278 // pipelines. If it contains `pageSize` pipelines, and more pipelines
279 // exist, then `nextPageToken` will be populated and should be
280 // used as the `pageToken` argument to a subsequent ListPipelines
281 // request.
282 message ListPipelinesResponse {
283 // The matched pipelines.
284 repeated Pipeline pipelines = 1;
285
286 // The token to use to get the next page of results.
287 string next_page_token = 2;
288 }
289
290 // The request to delete a saved pipeline by ID.
291 message DeletePipelineRequest {
292 // Caller must have WRITE access to the project in which this pipeline
293 // is defined.
294 string pipeline_id = 1;
295 }
296
297 // Request to get controller configuation. Should only be used
298 // by VMs created by the Pipelines Service and not by end users.
299 message GetControllerConfigRequest {
300 // The operation to retrieve controller configuration for.
301 string operation_id = 1;
302
303 uint64 validation_token = 2;
304 }
305
306 // Stores the information that the controller will fetch from the
307 // server in order to run. Should only be used by VMs created by the
308 // Pipelines Service and not by end users.
309 message ControllerConfig {
310 message RepeatedString {
311 repeated string values = 1;
312 }
313
314 string image = 1;
315
316 string cmd = 2;
317
318 string gcs_log_path = 3;
319
320 string machine_type = 4;
321
322 map<string, string> vars = 5;
323
324 map<string, string> disks = 6;
325
326 map<string, RepeatedString> gcs_sources = 7;
327
328 map<string, RepeatedString> gcs_sinks = 8;
329 }
330
331 // Stores the list of events and times they occured for major events in job
332 // execution.
333 message TimestampEvent {
334 // String indicating the type of event
335 string description = 1;
336
337 // The time this event occured.
338 google.protobuf.Timestamp timestamp = 2;
339 }
340
341 // Request to set operation status. Should only be used by VMs
342 // created by the Pipelines Service and not by end users.
343 message SetOperationStatusRequest {
344 string operation_id = 1;
345
346 repeated TimestampEvent timestamp_events = 2;
347
348 google.rpc.Code error_code = 3;
349
350 string error_message = 4;
351
352 uint64 validation_token = 5;
353 }
354
355 // A Google Cloud Service Account.
356 message ServiceAccount {
357 // Email address of the service account. Defaults to `default`,
358 // which uses the compute service account associated with the project.
359 string email = 1;
360
361 // List of scopes to be enabled for this service account on the VM.
362 // The following scopes are automatically included:
363 //
364 // * https://www.googleapis.com/auth/compute
365 // * https://www.googleapis.com/auth/devstorage.full_control
366 // * https://www.googleapis.com/auth/genomics
367 // * https://www.googleapis.com/auth/logging.write
368 // * https://www.googleapis.com/auth/monitoring.write
369 repeated string scopes = 2;
370 }
371
372 // The logging options for the pipeline run.
373 message LoggingOptions {
374 // The location in Google Cloud Storage to which the pipeline logs
375 // will be copied. Can be specified as a fully qualified directory
376 // path, in which case logs will be output with a unique identifier
377 // as the filename in that directory, or as a fully specified path,
378 // which must end in `.log`, in which case that path will be
379 // used, and the user must ensure that logs are not
380 // overwritten. Stdout and stderr logs from the run are also
381 // generated and output as `-stdout.log` and `-stderr.log`.
382 string gcs_path = 1;
383 }
384
385 // The system resources for the pipeline run.
386 message PipelineResources {
387 // A Google Compute Engine disk resource specification.
388 message Disk {
389 // The types of disks that may be attached to VMs.
390 enum Type {
391 // Default disk type. Use one of the other options below.
392 TYPE_UNSPECIFIED = 0;
393
394 // Specifies a Google Compute Engine persistent hard disk. See
395 // https://cloud.google.com/compute/docs/disks/#pdspecs for details.
396 PERSISTENT_HDD = 1;
397
398 // Specifies a Google Compute Engine persistent solid-state disk. See
399 // https://cloud.google.com/compute/docs/disks/#pdspecs for details.
400 PERSISTENT_SSD = 2;
401
402 // Specifies a Google Compute Engine local SSD.
403 // See https://cloud.google.com/compute/docs/disks/local-ssd for details.
404 LOCAL_SSD = 3;
405 }
406
407 // Required. The name of the disk that can be used in the pipeline
408 // parameters. Must be 1 - 63 characters.
409 // The name "boot" is reserved for system use.
410 string name = 1;
411
412 // Required. The type of the disk to create.
413 Type type = 2;
414
415 // The size of the disk. Defaults to 500 (GB).
416 // This field is not applicable for local SSD.
417 int32 size_gb = 3;
418
419 // The full or partial URL of the persistent disk to attach. See
420 // https://cloud.google.com/compute/docs/reference/latest/instances#resource
421 // and
422 // https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots
423 // for more details.
424 string source = 4;
425
426 // Deprecated. Disks created by the Pipelines API will be deleted at the end
427 // of the pipeline run, regardless of what this field is set to.
428 bool auto_delete = 6;
429
430 // Required at create time and cannot be overridden at run time.
431 // Specifies the path in the docker container where files on
432 // this disk should be located. For example, if `mountPoint`
433 // is `/mnt/disk`, and the parameter has `localPath`
434 // `inputs/file.txt`, the docker container can access the data at
435 // `/mnt/disk/inputs/file.txt`.
436 string mount_point = 8;
437 }
438
439 // The minimum number of cores to use. Defaults to 1.
440 int32 minimum_cpu_cores = 1;
441
442 // Whether to use preemptible VMs. Defaults to `false`. In order to use this,
443 // must be true for both create time and run time. Cannot be true at run time
444 // if false at create time.
445 bool preemptible = 2;
446
447 // The minimum amount of RAM to use. Defaults to 3.75 (GB)
448 double minimum_ram_gb = 3;
449
450 // Disks to attach.
451 repeated Disk disks = 4;
452
453 // List of Google Compute Engine availability zones to which resource
454 // creation will restricted. If empty, any zone may be chosen.
455 repeated string zones = 5;
456
457 // The size of the boot disk. Defaults to 10 (GB).
458 int32 boot_disk_size_gb = 6;
459
460 // Whether to assign an external IP to the instance. This is an experimental
461 // feature that may go away. Defaults to false.
462 // Corresponds to `--no_address` flag for [gcloud compute instances create]
463 // (https://cloud.google.com/sdk/gcloud/reference/compute/instances/create).
464 // In order to use this, must be true for both create time and run time.
465 // Cannot be true at run time if false at create time. If you need to ssh into
466 // a private IP VM for debugging, you can ssh to a public VM and then ssh into
467 // the private VM's Internal IP. If noAddress is set, this pipeline run may
468 // only load docker images from Google Container Registry and not Docker Hub.
469 // ** Note: To use this option, your project must be in Google Access for
470 // Private IPs Early Access Program.**
471 bool no_address = 7;
472 }
473
474 // Parameters facilitate setting and delivering data into the
475 // pipeline's execution environment. They are defined at create time,
476 // with optional defaults, and can be overridden at run time.
477 //
478 // If `localCopy` is unset, then the parameter specifies a string that
479 // is passed as-is into the pipeline, as the value of the environment
480 // variable with the given name. A default value can be optionally
481 // specified at create time. The default can be overridden at run time
482 // using the inputs map. If no default is given, a value must be
483 // supplied at runtime.
484 //
485 // If `localCopy` is defined, then the parameter specifies a data
486 // source or sink, both in Google Cloud Storage and on the Docker container
487 // where the pipeline computation is run. The [service account associated with
488 // the Pipeline][google.genomics.v1alpha2.RunPipelineArgs.service_account] (by
489 // default the project's Compute Engine service account) must have access to the
490 // Google Cloud Storage paths.
491 //
492 // At run time, the Google Cloud Storage paths can be overridden if a default
493 // was provided at create time, or must be set otherwise. The pipeline runner
494 // should add a key/value pair to either the inputs or outputs map. The
495 // indicated data copies will be carried out before/after pipeline execution,
496 // just as if the corresponding arguments were provided to `gsutil cp`.
497 //
498 // For example: Given the following `PipelineParameter`, specified
499 // in the `inputParameters` list:
500 //
501 // ```
502 // {name: "input_file", localCopy: {path: "file.txt", disk: "pd1"}}
503 // ```
504 //
505 // where `disk` is defined in the `PipelineResources` object as:
506 //
507 // ```
508 // {name: "pd1", mountPoint: "/mnt/disk/"}
509 // ```
510 //
511 // We create a disk named `pd1`, mount it on the host VM, and map
512 // `/mnt/pd1` to `/mnt/disk` in the docker container. At
513 // runtime, an entry for `input_file` would be required in the inputs
514 // map, such as:
515 //
516 // ```
517 // inputs["input_file"] = "gs://my-bucket/bar.txt"
518 // ```
519 //
520 // This would generate the following gsutil call:
521 //
522 // ```
523 // gsutil cp gs://my-bucket/bar.txt /mnt/pd1/file.txt
524 // ```
525 //
526 // The file `/mnt/pd1/file.txt` maps to `/mnt/disk/file.txt` in the
527 // Docker container. Acceptable paths are:
528 //
529 // <table>
530 // <thead>
531 // <tr><th>Google Cloud storage path</th><th>Local path</th></tr>
532 // </thead>
533 // <tbody>
534 // <tr><td>file</td><td>file</td></tr>
535 // <tr><td>glob</td><td>directory</td></tr>
536 // </tbody>
537 // </table>
538 //
539 // For outputs, the direction of the copy is reversed:
540 //
541 // ```
542 // gsutil cp /mnt/disk/file.txt gs://my-bucket/bar.txt
543 // ```
544 //
545 // Acceptable paths are:
546 //
547 // <table>
548 // <thead>
549 // <tr><th>Local path</th><th>Google Cloud Storage path</th></tr>
550 // </thead>
551 // <tbody>
552 // <tr><td>file</td><td>file</td></tr>
553 // <tr>
554 // <td>file</td>
555 // <td>directory - directory must already exist</td>
556 // </tr>
557 // <tr>
558 // <td>glob</td>
559 // <td>directory - directory will be created if it doesn't exist</td></tr>
560 // </tbody>
561 // </table>
562 //
563 // One restriction due to docker limitations, is that for outputs that are found
564 // on the boot disk, the local path cannot be a glob and must be a file.
565 message PipelineParameter {
566 // LocalCopy defines how a remote file should be copied to and from the VM.
567 message LocalCopy {
568 // Required. The path within the user's docker container where
569 // this input should be localized to and from, relative to the specified
570 // disk's mount point. For example: file.txt,
571 string path = 1;
572
573 // Required. The name of the disk where this parameter is
574 // located. Can be the name of one of the disks specified in the
575 // Resources field, or "boot", which represents the Docker
576 // instance's boot disk and has a mount point of `/`.
577 string disk = 2;
578 }
579
580 // Required. Name of the parameter - the pipeline runner uses this string
581 // as the key to the input and output maps in RunPipeline.
582 string name = 1;
583
584 // Human-readable description.
585 string description = 2;
586
587 // The default value for this parameter. Can be overridden at runtime.
588 // If `localCopy` is present, then this must be a Google Cloud Storage path
589 // beginning with `gs://`.
590 string default_value = 5;
591
592 // If present, this parameter is marked for copying to and from the VM.
593 // `LocalCopy` indicates where on the VM the file should be. The value
594 // given to this parameter (either at runtime or using `defaultValue`)
595 // must be the remote path where the file should be.
596 LocalCopy local_copy = 6;
597 }
598
599 // The Docker execuctor specification.
600 message DockerExecutor {
601 // Required. Image name from either Docker Hub or Google Container Registry.
602 // Users that run pipelines must have READ access to the image.
603 string image_name = 1;
604
605 // Required. The command or newline delimited script to run. The command
606 // string will be executed within a bash shell.
607 //
608 // If the command exits with a non-zero exit code, output parameter
609 // de-localization will be skipped and the pipeline operation's
610 // [`error`][google.longrunning.Operation.error] field will be populated.
611 //
612 // Maximum command string length is 16384.
613 string cmd = 2;
614 }