Skip to content

Commit 3f95ea2

Browse files
Google APIscopybara-github
authored andcommitted
feat: added StatusEvent.task_state
docs: updated comments PiperOrigin-RevId: 513426000
1 parent 8bf363b commit 3f95ea2

4 files changed

Lines changed: 34 additions & 50 deletions

File tree

google/cloud/batch/v1/batch.proto

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import "google/api/resource.proto";
2323
import "google/cloud/batch/v1/job.proto";
2424
import "google/cloud/batch/v1/task.proto";
2525
import "google/longrunning/operations.proto";
26+
import "google/protobuf/empty.proto";
2627
import "google/protobuf/timestamp.proto";
2728

2829
option csharp_namespace = "Google.Cloud.Batch.V1";
@@ -124,8 +125,8 @@ message CreateJobRequest {
124125
// ignore the request if it has already been completed. The server will
125126
// guarantee that for at least 60 minutes since the first request.
126127
//
127-
// For example, consider a situation where you make an initial request and t
128-
// he request times out. If you make the request again with the same request
128+
// For example, consider a situation where you make an initial request and
129+
// the request times out. If you make the request again with the same request
129130
// ID, the server can check if original operation with the same request ID
130131
// was received, and if so, will ignore the second request. This prevents
131132
// clients from accidentally creating duplicate commitments.
@@ -157,8 +158,8 @@ message DeleteJobRequest {
157158
// ignore the request if it has already been completed. The server will
158159
// guarantee that for at least 60 minutes after the first request.
159160
//
160-
// For example, consider a situation where you make an initial request and t
161-
// he request times out. If you make the request again with the same request
161+
// For example, consider a situation where you make an initial request and
162+
// the request times out. If you make the request again with the same request
162163
// ID, the server can check if original operation with the same request ID
163164
// was received, and if so, will ignore the second request. This prevents
164165
// clients from accidentally creating duplicate commitments.

google/cloud/batch/v1/batch_v1.yaml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ title: Batch API
66
apis:
77
- name: google.cloud.batch.v1.BatchService
88
- name: google.cloud.location.Locations
9-
- name: google.iam.v1.IAMPolicy
109
- name: google.longrunning.Operations
1110

1211
types:
@@ -22,29 +21,6 @@ documentation:
2221
- selector: google.cloud.location.Locations.ListLocations
2322
description: Lists information about the supported locations for this service.
2423

25-
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
26-
description: |-
27-
Gets the access control policy for a resource. Returns an empty policy
28-
if the resource exists and does not have a policy set.
29-
30-
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
31-
description: |-
32-
Sets the access control policy on the specified resource. Replaces
33-
any existing policy.
34-
35-
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
36-
errors.
37-
38-
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
39-
description: |-
40-
Returns permissions that a caller has on the specified resource. If the
41-
resource does not exist, this will return an empty set of
42-
permissions, not a `NOT_FOUND` error.
43-
44-
Note: This operation is designed to be used for building
45-
permission-aware UIs and command-line tools, not for authorization
46-
checking. This operation may "fail open" without warning.
47-
4824
backend:
4925
rules:
5026
- selector: 'google.cloud.batch.v1.BatchService.*'
@@ -53,8 +29,6 @@ backend:
5329
deadline: 60.0
5430
- selector: google.cloud.location.Locations.ListLocations
5531
deadline: 60.0
56-
- selector: 'google.iam.v1.IAMPolicy.*'
57-
deadline: 60.0
5832
- selector: 'google.longrunning.Operations.*'
5933
deadline: 60.0
6034

@@ -64,14 +38,6 @@ http:
6438
get: '/v1/{name=projects/*/locations/*}'
6539
- selector: google.cloud.location.Locations.ListLocations
6640
get: '/v1/{name=projects/*}/locations'
67-
- selector: google.iam.v1.IAMPolicy.GetIamPolicy
68-
get: '/v1/{resource=projects/*/locations/*/jobs/*}:getIamPolicy'
69-
- selector: google.iam.v1.IAMPolicy.SetIamPolicy
70-
post: '/v1/{resource=projects/*/locations/*/jobs/*}:setIamPolicy'
71-
body: '*'
72-
- selector: google.iam.v1.IAMPolicy.TestIamPermissions
73-
post: '/v1/{resource=projects/*/locations/*/jobs/*}:testIamPermissions'
74-
body: '*'
7541
- selector: google.longrunning.Operations.CancelOperation
7642
post: '/v1/{name=projects/*/locations/*/operations/*}:cancel'
7743
body: '*'
@@ -96,10 +62,6 @@ authentication:
9662
oauth:
9763
canonical_scopes: |-
9864
https://www.googleapis.com/auth/cloud-platform
99-
- selector: 'google.iam.v1.IAMPolicy.*'
100-
oauth:
101-
canonical_scopes: |-
102-
https://www.googleapis.com/auth/cloud-platform
10365
- selector: 'google.longrunning.Operations.*'
10466
oauth:
10567
canonical_scopes: |-

google/cloud/batch/v1/job.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ message Job {
4646
string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
4747

4848
// Priority of the Job.
49-
// The valid value range is [0, 100).
49+
// The valid value range is [0, 100). Default value is 0.
50+
// Higher value indicates higher priority.
5051
// A job with higher priority value is more likely to run earlier if all other
5152
// requirements are satisfied.
5253
int64 priority = 3;

google/cloud/batch/v1/task.proto

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ message StatusEvent {
5555

5656
// Task Execution
5757
TaskExecution task_execution = 4;
58+
59+
// Task State
60+
TaskStatus.State task_state = 5;
5861
}
5962

6063
// This Task Execution field includes detail information for
@@ -140,9 +143,23 @@ message Runnable {
140143
message Script {
141144
oneof command {
142145
// Script file path on the host VM.
146+
//
147+
// To specify an interpreter, please add a `#!<interpreter>`(also known as
148+
// [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix))) as the
149+
// first line of the file.(For example, to execute the script using bash,
150+
// `#!/bin/bash` should be the first line of the file. To execute the
151+
// script using`Python3`, `#!/usr/bin/env python3` should be the first
152+
// line of the file.) Otherwise, the file will by default be excuted by
153+
// `/bin/sh`.
143154
string path = 1;
144155

145156
// Shell script text.
157+
//
158+
// To specify an interpreter, please add a `#!<interpreter>\n` at the
159+
// beginning of the text.(For example, to execute the script using bash,
160+
// `#!/bin/bash\n` should be added. To execute the script using`Python3`,
161+
// `#!/usr/bin/env python3\n` should be added.) Otherwise, the script will
162+
// by default be excuted by `/bin/sh`.
146163
string text = 2;
147164
}
148165
}
@@ -220,13 +237,12 @@ message TaskSpec {
220237
int32 max_retry_count = 5;
221238

222239
// Lifecycle management schema when any task in a task group is failed.
223-
// The valid size of lifecycle policies are [0, 10].
224-
// For each lifecycle policy, when the condition is met,
225-
// the action in that policy will execute.
226-
// If there are multiple policies that the task execution result matches,
227-
// we use the action from the first matched policy. If task execution result
228-
// does not meet with any of the defined lifecycle policy, we consider it as
229-
// the default policy. Default policy means if the exit code is 0, exit task.
240+
// Currently we only support one lifecycle policy.
241+
// When the lifecycle policy condition is met,
242+
// the action in the policy will execute.
243+
// If task execution result does not meet with the defined lifecycle
244+
// policy, we consider it as the default policy.
245+
// Default policy means if the exit code is 0, exit task.
230246
// If task ends with non-zero exit code, retry the task with max_retry_count.
231247
repeated LifecyclePolicy lifecycle_policies = 9;
232248

@@ -265,6 +281,10 @@ message LifecyclePolicy {
265281
}
266282

267283
// Action to execute when ActionCondition is true.
284+
// When RETRY_TASK is specified, we will retry failed tasks
285+
// if we notice any exit code match and fail tasks if no match is found.
286+
// Likewise, when FAIL_TASK is specified, we will fail tasks
287+
// if we notice any exit code match and retry tasks if no match is found.
268288
Action action = 1;
269289

270290
// Conditions that decide why a task failure is dealt with a specific action.

0 commit comments

Comments
 (0)