Skip to content

Commit 9379366

Browse files
docs: [google-cloud-batch] add caution messages for container runnable username and password fields (#12330)
BEGIN_COMMIT_OVERRIDE docs: refine proto comment for run_as_non_root docs: add caution messages for container runnable username and password fields END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. --- docs: refine proto comment for run_as_non_root PiperOrigin-RevId: 608664745 Source-Link: googleapis/googleapis@254e61a Source-Link: googleapis/googleapis-gen@4526911 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI0NTI2OTExYzdkZDU4NjJkMTgzNzI1NTRkZGQ4MjBmOTQ4MjdmMzNhIn0= BEGIN_NESTED_COMMIT docs: [google-cloud-batch] refine proto comment for run_as_non_root docs: add caution messages for container runnable username and password fields PiperOrigin-RevId: 608240389 Source-Link: googleapis/googleapis@6f599f0 Source-Link: googleapis/googleapis-gen@6af0d38 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI2YWYwZDM4ZDk1M2U3YTVmOTQyN2Q2NTBlYmNkMzcyNmZlMjg2ZGNlIn0= END_NESTED_COMMIT --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <[email protected]>
1 parent 86743c8 commit 9379366

File tree

4 files changed

+90
-32
lines changed

4 files changed

+90
-32
lines changed

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -981,19 +981,18 @@ class TaskGroup(proto.Message):
981981
When true, Batch will populate a file with a list of all VMs
982982
assigned to the TaskGroup and set the BATCH_HOSTS_FILE
983983
environment variable to the path of that file. Defaults to
984-
false.
984+
false. The host file supports up to 1000 VMs.
985985
permissive_ssh (bool):
986986
When true, Batch will configure SSH to allow
987987
passwordless login between VMs running the Batch
988988
tasks in the same TaskGroup.
989989
run_as_non_root (bool):
990-
Optional. If not set or set to false, Batch
991-
will use root user to execute runnables. If set
992-
to true, Batch will make sure to run the
993-
runnables using non-root user. Currently, the
994-
non-root user Batch used is generated by OS
995-
login. Reference:
996-
https://cloud.google.com/compute/docs/oslogin
990+
Optional. If not set or set to false, Batch uses the root
991+
user to execute runnables. If set to true, Batch runs the
992+
runnables using a non-root user. Currently, the non-root
993+
user Batch used is generated by OS Login. For more
994+
information, see `About OS
995+
Login <https://cloud.google.com/compute/docs/oslogin>`__.
997996
"""
998997

999998
class SchedulingPolicy(proto.Enum):

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

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,43 @@ class Container(proto.Message):
318318
each other, network cannot be specified in the
319319
``container.options`` field.
320320
username (str):
321-
Optional username for logging in to a docker registry. If
322-
username matches ``projects/*/secrets/*/versions/*`` then
323-
Batch will read the username from the Secret Manager.
321+
Required if the container image is from a private Docker
322+
registry. The username to login to the Docker registry that
323+
contains the image.
324+
325+
You can either specify the username directly by using plain
326+
text or specify an encrypted username by using a Secret
327+
Manager secret: ``projects/*/secrets/*/versions/*``.
328+
However, using a secret is recommended for enhanced
329+
security.
330+
331+
Caution: If you specify the username using plain text, you
332+
risk the username being exposed to any users who can view
333+
the job or its logs. To avoid this risk, specify a secret
334+
that contains the username instead.
335+
336+
Learn more about `Secret
337+
Manager <https://cloud.google.com/secret-manager/docs/>`__
338+
and `using Secret Manager with
339+
Batch <https://cloud.google.com/batch/docs/create-run-job-secret-manager>`__.
324340
password (str):
325-
Optional password for logging in to a docker registry. If
326-
password matches ``projects/*/secrets/*/versions/*`` then
327-
Batch will read the password from the Secret Manager;
341+
Required if the container image is from a private Docker
342+
registry. The password to login to the Docker registry that
343+
contains the image.
344+
345+
For security, it is strongly recommended to specify an
346+
encrypted password by using a Secret Manager secret:
347+
``projects/*/secrets/*/versions/*``.
348+
349+
Warning: If you specify the password using plain text, you
350+
risk the password being exposed to any users who can view
351+
the job or its logs. To avoid this risk, specify a secret
352+
that contains the password instead.
353+
354+
Learn more about `Secret
355+
Manager <https://cloud.google.com/secret-manager/docs/>`__
356+
and `using Secret Manager with
357+
Batch <https://cloud.google.com/batch/docs/create-run-job-secret-manager>`__.
328358
enable_image_streaming (bool):
329359
Optional. If set to true, this container runnable uses Image
330360
streaming.
@@ -406,7 +436,7 @@ class Script(proto.Message):
406436
script using bash, ``#!/bin/bash`` should be the first line
407437
of the file. To execute the script using\ ``Python3``,
408438
``#!/usr/bin/env python3`` should be the first line of the
409-
file.) Otherwise, the file will by default be excuted by
439+
file.) Otherwise, the file will by default be executed by
410440
``/bin/sh``.
411441
412442
This field is a member of `oneof`_ ``command``.
@@ -418,7 +448,7 @@ class Script(proto.Message):
418448
example, to execute the script using bash, ``#!/bin/bash\n``
419449
should be added. To execute the script using\ ``Python3``,
420450
``#!/usr/bin/env python3\n`` should be added.) Otherwise,
421-
the script will by default be excuted by ``/bin/sh``.
451+
the script will by default be executed by ``/bin/sh``.
422452
423453
This field is a member of `oneof`_ ``command``.
424454
"""

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,19 +1136,18 @@ class TaskGroup(proto.Message):
11361136
When true, Batch will populate a file with a list of all VMs
11371137
assigned to the TaskGroup and set the BATCH_HOSTS_FILE
11381138
environment variable to the path of that file. Defaults to
1139-
false.
1139+
false. The host file supports up to 1000 VMs.
11401140
permissive_ssh (bool):
11411141
When true, Batch will configure SSH to allow
11421142
passwordless login between VMs running the Batch
11431143
tasks in the same TaskGroup.
11441144
run_as_non_root (bool):
1145-
Optional. If not set or set to false, Batch
1146-
will use root user to execute runnables. If set
1147-
to true, Batch will make sure to run the
1148-
runnables using non-root user. Currently, the
1149-
non-root user Batch used is generated by OS
1150-
login. Reference:
1151-
https://cloud.google.com/compute/docs/oslogin
1145+
Optional. If not set or set to false, Batch uses the root
1146+
user to execute runnables. If set to true, Batch runs the
1147+
runnables using a non-root user. Currently, the non-root
1148+
user Batch used is generated by OS Login. For more
1149+
information, see `About OS
1150+
Login <https://cloud.google.com/compute/docs/oslogin>`__.
11521151
"""
11531152

11541153
class SchedulingPolicy(proto.Enum):

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

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,43 @@ class Container(proto.Message):
358358
each other, network cannot be specified in the
359359
``container.options`` field.
360360
username (str):
361-
Optional username for logging in to a docker registry. If
362-
username matches ``projects/*/secrets/*/versions/*`` then
363-
Batch will read the username from the Secret Manager.
361+
Required if the container image is from a private Docker
362+
registry. The username to login to the Docker registry that
363+
contains the image.
364+
365+
You can either specify the username directly by using plain
366+
text or specify an encrypted username by using a Secret
367+
Manager secret: ``projects/*/secrets/*/versions/*``.
368+
However, using a secret is recommended for enhanced
369+
security.
370+
371+
Caution: If you specify the username using plain text, you
372+
risk the username being exposed to any users who can view
373+
the job or its logs. To avoid this risk, specify a secret
374+
that contains the username instead.
375+
376+
Learn more about `Secret
377+
Manager <https://cloud.google.com/secret-manager/docs/>`__
378+
and `using Secret Manager with
379+
Batch <https://cloud.google.com/batch/docs/create-run-job-secret-manager>`__.
364380
password (str):
365-
Optional password for logging in to a docker registry. If
366-
password matches ``projects/*/secrets/*/versions/*`` then
367-
Batch will read the password from the Secret Manager;
381+
Required if the container image is from a private Docker
382+
registry. The password to login to the Docker registry that
383+
contains the image.
384+
385+
For security, it is strongly recommended to specify an
386+
encrypted password by using a Secret Manager secret:
387+
``projects/*/secrets/*/versions/*``.
388+
389+
Warning: If you specify the password using plain text, you
390+
risk the password being exposed to any users who can view
391+
the job or its logs. To avoid this risk, specify a secret
392+
that contains the password instead.
393+
394+
Learn more about `Secret
395+
Manager <https://cloud.google.com/secret-manager/docs/>`__
396+
and `using Secret Manager with
397+
Batch <https://cloud.google.com/batch/docs/create-run-job-secret-manager>`__.
368398
enable_image_streaming (bool):
369399
Optional. If set to true, this container runnable uses Image
370400
streaming.
@@ -446,7 +476,7 @@ class Script(proto.Message):
446476
script using bash, ``#!/bin/bash`` should be the first line
447477
of the file. To execute the script using\ ``Python3``,
448478
``#!/usr/bin/env python3`` should be the first line of the
449-
file.) Otherwise, the file will by default be excuted by
479+
file.) Otherwise, the file will by default be executed by
450480
``/bin/sh``.
451481
452482
This field is a member of `oneof`_ ``command``.
@@ -458,7 +488,7 @@ class Script(proto.Message):
458488
example, to execute the script using bash, ``#!/bin/bash\n``
459489
should be added. To execute the script using\ ``Python3``,
460490
``#!/usr/bin/env python3\n`` should be added.) Otherwise,
461-
the script will by default be excuted by ``/bin/sh``.
491+
the script will by default be executed by ``/bin/sh``.
462492
463493
This field is a member of `oneof`_ ``command``.
464494
"""

0 commit comments

Comments
 (0)