Skip to content

Commit

Permalink
feat: [google-cloud-batch] Add TaskGroup.enable_oslogin to give the B…
Browse files Browse the repository at this point in the history
…atch job submitter the ability to run runnables as non-root controlled by IAM (#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:
googleapis/googleapis-gen@b07e603
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiJiMDdlNjAzZjg2NzFhNmIyODFlNGMzZWRiOTJmZjIxOWRhMjViMzBjIn0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 21, 2023
1 parent f80a80b commit 5392065
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.17.4" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.17.4" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.17.4" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,11 @@ class AllocationPolicy(proto.Message):
reserved.
network (google.cloud.batch_v1alpha.types.AllocationPolicy.NetworkPolicy):
The network policy.
If you define an instance template in the
InstancePolicyOrTemplate field, Batch will use
the network settings in the instance template
instead of this field.
placement (google.cloud.batch_v1alpha.types.AllocationPolicy.PlacementPolicy):
The placement policy.
"""
Expand Down Expand Up @@ -1120,6 +1125,19 @@ class TaskGroup(proto.Message):
When true, Batch will configure SSH to allow
passwordless login between VMs running the Batch
tasks in the same TaskGroup.
enable_oslogin (bool):
Optional. When true, Batch will use the OS Login generated
POSIX account to exeucute the runnables instead of the
default root user.
| To control root or non-root privilege for runnable
execution, the project
| Admin user needs to configure IAM roles according to
https://cloud.google.com/compute/docs/oslogin/set-up-oslogin#configure_users.
Specifically, if a root execution is needed, the
roles/compute.osAdminLogin should be granted to the Batch
job submitter. Otherwise, roles/compute.osLogin should be
granted to the Batch job submitter.
"""

class SchedulingPolicy(proto.Enum):
Expand Down Expand Up @@ -1191,6 +1209,10 @@ class SchedulingPolicy(proto.Enum):
proto.BOOL,
number=12,
)
enable_oslogin: bool = proto.Field(
proto.BOOL,
number=13,
)


class ServiceAccount(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-batch",
"version": "0.17.4"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-batch",
"version": "0.17.4"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2687,6 +2687,7 @@ def test_create_job_rest(request_type):
"task_count_per_node": 2022,
"require_hosts_file": True,
"permissive_ssh": True,
"enable_oslogin": True,
}
],
"scheduling_policy": 1,
Expand Down

0 comments on commit 5392065

Please sign in to comment.