Skip to content

Commit 5392065

Browse files
feat: [google-cloud-batch] Add TaskGroup.enable_oslogin to give the Batch job submitter the ability to run runnables as non-root controlled by IAM (googleapis#12041)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE docs: Update documentation for the network field of AllocationPolicy feat: Add TaskGroup.enable_oslogin to give the Batch job submitter the ability to run runnables as non-root controlled by IAM END_COMMIT_OVERRIDE PiperOrigin-RevId: 584258085 Source-Link: googleapis/googleapis@0f85c39 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b07e603f8671a6b281e4c3edb92ff219da25b30c Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJiMDdlNjAzZjg2NzFhNmIyODFlNGMzZWRiOTJmZjIxOWRhMjViMzBjIn0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f80a80b commit 5392065

7 files changed

Lines changed: 28 additions & 5 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.4" # {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.4" # {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.4" # {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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,11 @@ class AllocationPolicy(proto.Message):
541541
reserved.
542542
network (google.cloud.batch_v1alpha.types.AllocationPolicy.NetworkPolicy):
543543
The network policy.
544+
545+
If you define an instance template in the
546+
InstancePolicyOrTemplate field, Batch will use
547+
the network settings in the instance template
548+
instead of this field.
544549
placement (google.cloud.batch_v1alpha.types.AllocationPolicy.PlacementPolicy):
545550
The placement policy.
546551
"""
@@ -1120,6 +1125,19 @@ class TaskGroup(proto.Message):
11201125
When true, Batch will configure SSH to allow
11211126
passwordless login between VMs running the Batch
11221127
tasks in the same TaskGroup.
1128+
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.
1132+
1133+
| To control root or non-root privilege for runnable
1134+
execution, the project
1135+
| Admin user needs to configure IAM roles according to
1136+
https://cloud.google.com/compute/docs/oslogin/set-up-oslogin#configure_users.
1137+
Specifically, if a root execution is needed, the
1138+
roles/compute.osAdminLogin should be granted to the Batch
1139+
job submitter. Otherwise, roles/compute.osLogin should be
1140+
granted to the Batch job submitter.
11231141
"""
11241142

11251143
class SchedulingPolicy(proto.Enum):
@@ -1191,6 +1209,10 @@ class SchedulingPolicy(proto.Enum):
11911209
proto.BOOL,
11921210
number=12,
11931211
)
1212+
enable_oslogin: bool = proto.Field(
1213+
proto.BOOL,
1214+
number=13,
1215+
)
11941216

11951217

11961218
class ServiceAccount(proto.Message):

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.4"
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.4"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,6 +2687,7 @@ def test_create_job_rest(request_type):
26872687
"task_count_per_node": 2022,
26882688
"require_hosts_file": True,
26892689
"permissive_ssh": True,
2690+
"enable_oslogin": True,
26902691
}
26912692
],
26922693
"scheduling_policy": 1,

0 commit comments

Comments
 (0)