xref: /aosp_15_r20/external/googleapis/google/cloud/run/v2/task_template.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
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
15syntax = "proto3";
16
17package google.cloud.run.v2;
18
19import "google/api/resource.proto";
20import "google/cloud/run/v2/k8s.min.proto";
21import "google/cloud/run/v2/vendor_settings.proto";
22import "google/protobuf/duration.proto";
23
24option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb";
25option java_multiple_files = true;
26option java_outer_classname = "TaskTemplateProto";
27option java_package = "com.google.cloud.run.v2";
28
29// TaskTemplate describes the data a task should have when created
30// from a template.
31message TaskTemplate {
32  // Holds the single container that defines the unit of execution for this
33  // task.
34  repeated Container containers = 1;
35
36  // A list of Volumes to make available to containers.
37  repeated Volume volumes = 2;
38
39  oneof retries {
40    // Number of retries allowed per Task, before marking this Task failed.
41    // Defaults to 3.
42    int32 max_retries = 3;
43  }
44
45  // Max allowed time duration the Task may be active before the system will
46  // actively try to mark it failed and kill associated containers. This applies
47  // per attempt of a task, meaning each retry can run for the full timeout.
48  // Defaults to 600 seconds.
49  google.protobuf.Duration timeout = 4;
50
51  // Email address of the IAM service account associated with the Task of a
52  // Job. The service account represents the identity of the
53  // running task, and determines what permissions the task has. If
54  // not provided, the task will use the project's default service account.
55  string service_account = 5;
56
57  // The execution environment being used to host this Task.
58  ExecutionEnvironment execution_environment = 6;
59
60  // A reference to a customer managed encryption key (CMEK) to use to encrypt
61  // this container image. For more information, go to
62  // https://cloud.google.com/run/docs/securing/using-cmek
63  string encryption_key = 7 [(google.api.resource_reference) = {
64    type: "cloudkms.googleapis.com/CryptoKey"
65  }];
66
67  // VPC Access configuration to use for this Task. For more information,
68  // visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
69  VpcAccess vpc_access = 8;
70}
71