Skip to content

Commit 523ee16

Browse files
feat: add InstancePolicy.reservation field for restricting jobs to a specific reservation (#11778)
- [ ] Regenerate this pull request now. BEGIN_COMMIT_OVERRIDE add InstancePolicy.reservation field for restricting jobs to a specific reservation feat: Add the support for the batch hpc rocky linux image feat: add InstancePolicy.reservation field for restricting jobs to a specific reservation docs: elaborate the usage of Container.volumes proto field END_COMMIT_OVERRIDE --- docs: elaborate the usage of Container.volumes proto field PiperOrigin-RevId: 570165566 Source-Link: https://togithub.com/googleapis/googleapis/commit/de6760b2ef8ba8481646b14c2d52460ab8f97cc2 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/8a604d8c78f2c7f150277ea3b2f53f82962abb55 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI4YTYwNGQ4Yzc4ZjJjN2YxNTAyNzdlYTNiMmY1M2Y4Mjk2MmFiYjU1In0= BEGIN_NESTED_COMMIT feat: Add the support for the batch hpc rocky linux image feat: add InstancePolicy.reservation field for restricting jobs to a specific reservation docs: elaborate the usage of Container.volumes proto field PiperOrigin-RevId: 570148633 Source-Link: https://togithub.com/googleapis/googleapis/commit/b7aec3f18645057e9aca1f3e24de36e2ea33b906 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/84ca8d09ae6eaf7293572d787f2f1a96d7f295ee Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI4NGNhOGQwOWFlNmVhZjcyOTM1NzJkNzg3ZjJmMWE5NmQ3ZjI5NWVlIn0= END_NESTED_COMMIT
1 parent 84f4480 commit 523ee16

File tree

10 files changed

+46
-15
lines changed

10 files changed

+46
-15
lines changed

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.1" # {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.1" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ class Disk(proto.Message):
491491
- ``batch-centos``: use Batch CentOS images.
492492
- ``batch-cos``: use Batch Container-Optimized images.
493493
- ``batch-hpc-centos``: use Batch HPC CentOS images.
494+
- ``batch-hpc-rocky``: use Batch HPC Rocky Linux images.
494495
495496
This field is a member of `oneof`_ ``data_source``.
496497
snapshot (str):
@@ -665,6 +666,11 @@ class InstancePolicy(proto.Message):
665666
disk is a disk that can be of a device with a
666667
file system or a raw storage drive that is not
667668
ready for data storage and accessing.
669+
reservation (str):
670+
Optional. If specified, VMs will consume only
671+
the specified reservation. If not specified
672+
(default), VMs will consume any applicable
673+
reservation.
668674
"""
669675

670676
machine_type: str = proto.Field(
@@ -697,6 +703,10 @@ class InstancePolicy(proto.Message):
697703
number=6,
698704
message="AllocationPolicy.AttachedDisk",
699705
)
706+
reservation: str = proto.Field(
707+
proto.STRING,
708+
number=7,
709+
)
700710

701711
class InstancePolicyOrTemplate(proto.Message):
702712
r"""InstancePolicyOrTemplate lets you define the type of

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,19 @@ class Container(proto.Message):
287287
entrypoint (str):
288288
Overrides the ``ENTRYPOINT`` specified in the container.
289289
volumes (MutableSequence[str]):
290-
Volumes to mount (bind mount) from the host
291-
machine files or directories into the container,
292-
formatted to match docker run's --volume option,
293-
e.g. /foo:/bar, or /foo:/bar:ro
290+
Volumes to mount (bind mount) from the host machine files or
291+
directories into the container, formatted to match docker
292+
run's --volume option, e.g. /foo:/bar, or /foo:/bar:ro
293+
294+
If the ``TaskSpec.Volumes`` field is specified but this
295+
field is not, Batch will mount each volume from the host
296+
machine to the container with the same mount path by
297+
default. In this case, the default mount option for
298+
containers will be read-only (ro) for existing persistent
299+
disks and read-write (rw) for other volume types, regardless
300+
of the original mount options specified in
301+
``TaskSpec.Volumes``. If you need different mount settings,
302+
you can explicitly configure them in this field.
294303
options (str):
295304
Arbitrary additional options to include in
296305
the "docker run" command when running this

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.1" # {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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ class Disk(proto.Message):
611611
- ``batch-centos``: use Batch CentOS images.
612612
- ``batch-cos``: use Batch Container-Optimized images.
613613
- ``batch-hpc-centos``: use Batch HPC CentOS images.
614+
- ``batch-hpc-rocky``: use Batch HPC Rocky Linux images.
614615
615616
This field is a member of `oneof`_ ``data_source``.
616617
snapshot (str):
@@ -788,8 +789,8 @@ class InstancePolicy(proto.Message):
788789
file system or a raw storage drive that is not
789790
ready for data storage and accessing.
790791
reservation (str):
791-
If specified, VMs will consume only the
792-
specified reservation. If not specified
792+
Optional. If specified, VMs will consume only
793+
the specified reservation. If not specified
793794
(default), VMs will consume any applicable
794795
reservation.
795796
"""

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,19 @@ class Container(proto.Message):
334334
entrypoint (str):
335335
Overrides the ``ENTRYPOINT`` specified in the container.
336336
volumes (MutableSequence[str]):
337-
Volumes to mount (bind mount) from the host
338-
machine files or directories into the container,
339-
formatted to match docker run's --volume option,
340-
e.g. /foo:/bar, or /foo:/bar:ro
337+
Volumes to mount (bind mount) from the host machine files or
338+
directories into the container, formatted to match docker
339+
run's --volume option, e.g. /foo:/bar, or /foo:/bar:ro
340+
341+
If the ``TaskSpec.Volumes`` field is specified but this
342+
field is not, Batch will mount each volume from the host
343+
machine to the container with the same mount path by
344+
default. In this case, the default mount option for
345+
containers will be read-only (ro) for existing persistent
346+
disks and read-write (rw) for other volume types, regardless
347+
of the original mount options specified in
348+
``TaskSpec.Volumes``. If you need different mount settings,
349+
you can explicitly configure them in this field.
341350
options (str):
342351
Arbitrary additional options to include in
343352
the "docker run" command when running this

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

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2628,6 +2628,7 @@ def test_create_job_rest(request_type):
26282628
"device_name": "device_name_value",
26292629
}
26302630
],
2631+
"reservation": "reservation_value",
26312632
},
26322633
"instance_template": "instance_template_value",
26332634
"install_gpu_drivers": True,
@@ -2979,6 +2980,7 @@ def test_create_job_rest_bad_request(
29792980
"device_name": "device_name_value",
29802981
}
29812982
],
2983+
"reservation": "reservation_value",
29822984
},
29832985
"instance_template": "instance_template_value",
29842986
"install_gpu_drivers": True,

0 commit comments

Comments
 (0)