Skip to content

Commit ce7ddbf

Browse files
feat: [google-cloud-batch] Add tags field in Job's AllocationPolicy field in v1alpha (googleapis#12171)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE feat: Add `tags` field in Job's AllocationPolicy field in v1alpha feat: Add `run_as_non_root field` and deprecate `enable_oslogin` for non-root execution docs: updated comments END_COMMIT_OVERRIDE PiperOrigin-RevId: 596742590 Source-Link: googleapis/googleapis@09b78e2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d5d869942aafdf9446c274380b7348c1591c156d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJkNWQ4Njk5NDJhYWZkZjk0NDZjMjc0MzgwYjczNDhjMTU5MWMxNTZkIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent d30f83d commit ce7ddbf

8 files changed

Lines changed: 39 additions & 14 deletions

File tree

packages/google-cloud-batch/google/cloud/batch/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.6" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.6" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1alpha/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.17.6" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-batch/google/cloud/batch_v1alpha/types/job.py

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,12 @@ class AllocationPolicy(proto.Message):
548548
instead of this field.
549549
placement (google.cloud.batch_v1alpha.types.AllocationPolicy.PlacementPolicy):
550550
The placement policy.
551+
tags (MutableSequence[str]):
552+
Optional. Tags applied to the VM instances.
553+
554+
The tags identify valid sources or targets for network
555+
firewalls. Each tag must be 1-63 characters long, and comply
556+
with `RFC1035 <https://www.ietf.org/rfc/rfc1035.txt>`__.
551557
"""
552558

553559
class ProvisioningModel(proto.Enum):
@@ -1059,6 +1065,10 @@ class PlacementPolicy(proto.Message):
10591065
number=10,
10601066
message=PlacementPolicy,
10611067
)
1068+
tags: MutableSequence[str] = proto.RepeatedField(
1069+
proto.STRING,
1070+
number=11,
1071+
)
10621072

10631073

10641074
class TaskGroup(proto.Message):
@@ -1126,9 +1136,9 @@ class TaskGroup(proto.Message):
11261136
passwordless login between VMs running the Batch
11271137
tasks in the same TaskGroup.
11281138
enable_oslogin (bool):
1129-
Optional. When true, Batch will use the OS Login generated
1130-
POSIX account to exeucute the runnables instead of the
1131-
default root user.
1139+
Optional. Deprecated: When true, Batch will use the OS Login
1140+
generated POSIX account to exeucute the runnables instead of
1141+
the default root user.
11321142
11331143
| To control root or non-root privilege for runnable
11341144
execution, the project
@@ -1138,6 +1148,14 @@ class TaskGroup(proto.Message):
11381148
roles/compute.osAdminLogin should be granted to the Batch
11391149
job submitter. Otherwise, roles/compute.osLogin should be
11401150
granted to the Batch job submitter.
1151+
run_as_non_root (bool):
1152+
Optional. If not set or set to false, Batch
1153+
will use root user to execute runnables. If set
1154+
to true, Batch will make sure to run the
1155+
runnables using non-root user. Currently, the
1156+
non-root user Batch used is generated by OS
1157+
login. Reference:
1158+
https://cloud.google.com/compute/docs/oslogin
11411159
"""
11421160

11431161
class SchedulingPolicy(proto.Enum):
@@ -1213,6 +1231,10 @@ class SchedulingPolicy(proto.Enum):
12131231
proto.BOOL,
12141232
number=13,
12151233
)
1234+
run_as_non_root: bool = proto.Field(
1235+
proto.BOOL,
1236+
number=14,
1237+
)
12161238

12171239

12181240
class ServiceAccount(proto.Message):

packages/google-cloud-batch/google/cloud/batch_v1alpha/types/task.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,13 @@ class Container(proto.Message):
366366
password matches ``projects/*/secrets/*/versions/*`` then
367367
Batch will read the password from the Secret Manager;
368368
enable_image_streaming (bool):
369-
Optional. Not yet implemented.
370-
If set to true, container will run with Image
371-
streaming. The container runtime will be changed
372-
to containerd instead of docker. Currently, only
373-
imageUri, commands, entrypoint and volumes are
374-
supported and any other fields will be ignored.
369+
Optional. If set to true, container will run with Image
370+
streaming. The container runtime will be changed to
371+
containerd instead of docker. Currently, only imageUri,
372+
commands, entrypoint and volumes are supported and any other
373+
fields will be ignored. Please refer
374+
`here <https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming>`__
375+
for the feature requirements and limitations.
375376
"""
376377

377378
image_uri: str = proto.Field(

packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-batch",
11-
"version": "0.17.6"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-batch/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-batch",
11-
"version": "0.17.6"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-batch/tests/unit/gapic/batch_v1alpha/test_batch_service.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2681,13 +2681,15 @@ def test_create_job_rest(request_type):
26812681
"collocation": "collocation_value",
26822682
"max_distance": 1264,
26832683
},
2684+
"tags": ["tags_value1", "tags_value2"],
26842685
},
26852686
"labels": {},
26862687
"task_environments": {},
26872688
"task_count_per_node": 2022,
26882689
"require_hosts_file": True,
26892690
"permissive_ssh": True,
26902691
"enable_oslogin": True,
2692+
"run_as_non_root": True,
26912693
}
26922694
],
26932695
"scheduling_policy": 1,

0 commit comments

Comments
 (0)