Skip to content

Commit

Permalink
feat: add InstancePolicy.reservation field for restricting jobs to a …
Browse files Browse the repository at this point in the history
…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://github.com/googleapis/googleapis/commit/de6760b2ef8ba8481646b14c2d52460ab8f97cc2

Source-Link: https://github.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://github.com/googleapis/googleapis/commit/b7aec3f18645057e9aca1f3e24de36e2ea33b906

Source-Link: https://github.com/googleapis/googleapis-gen/commit/84ca8d09ae6eaf7293572d787f2f1a96d7f295ee
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhdGNoLy5Pd2xCb3QueWFtbCIsImgiOiI4NGNhOGQwOWFlNmVhZjcyOTM1NzJkNzg3ZjJmMWE5NmQ3ZjI5NWVlIn0=
END_NESTED_COMMIT
  • Loading branch information
gcf-owl-bot[bot] authored Oct 4, 2023
1 parent 84f4480 commit 523ee16
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 15 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.1" # {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.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
10 changes: 10 additions & 0 deletions packages/google-cloud-batch/google/cloud/batch_v1/types/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ class Disk(proto.Message):
- ``batch-centos``: use Batch CentOS images.
- ``batch-cos``: use Batch Container-Optimized images.
- ``batch-hpc-centos``: use Batch HPC CentOS images.
- ``batch-hpc-rocky``: use Batch HPC Rocky Linux images.
This field is a member of `oneof`_ ``data_source``.
snapshot (str):
Expand Down Expand Up @@ -665,6 +666,11 @@ class InstancePolicy(proto.Message):
disk is a disk that can be of a device with a
file system or a raw storage drive that is not
ready for data storage and accessing.
reservation (str):
Optional. If specified, VMs will consume only
the specified reservation. If not specified
(default), VMs will consume any applicable
reservation.
"""

machine_type: str = proto.Field(
Expand Down Expand Up @@ -697,6 +703,10 @@ class InstancePolicy(proto.Message):
number=6,
message="AllocationPolicy.AttachedDisk",
)
reservation: str = proto.Field(
proto.STRING,
number=7,
)

class InstancePolicyOrTemplate(proto.Message):
r"""InstancePolicyOrTemplate lets you define the type of
Expand Down
17 changes: 13 additions & 4 deletions packages/google-cloud-batch/google/cloud/batch_v1/types/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,19 @@ class Container(proto.Message):
entrypoint (str):
Overrides the ``ENTRYPOINT`` specified in the container.
volumes (MutableSequence[str]):
Volumes to mount (bind mount) from the host
machine files or directories into the container,
formatted to match docker run's --volume option,
e.g. /foo:/bar, or /foo:/bar:ro
Volumes to mount (bind mount) from the host machine files or
directories into the container, formatted to match docker
run's --volume option, e.g. /foo:/bar, or /foo:/bar:ro
If the ``TaskSpec.Volumes`` field is specified but this
field is not, Batch will mount each volume from the host
machine to the container with the same mount path by
default. In this case, the default mount option for
containers will be read-only (ro) for existing persistent
disks and read-write (rw) for other volume types, regardless
of the original mount options specified in
``TaskSpec.Volumes``. If you need different mount settings,
you can explicitly configure them in this field.
options (str):
Arbitrary additional options to include in
the "docker run" command when running this
Expand Down
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.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ class Disk(proto.Message):
- ``batch-centos``: use Batch CentOS images.
- ``batch-cos``: use Batch Container-Optimized images.
- ``batch-hpc-centos``: use Batch HPC CentOS images.
- ``batch-hpc-rocky``: use Batch HPC Rocky Linux images.
This field is a member of `oneof`_ ``data_source``.
snapshot (str):
Expand Down Expand Up @@ -788,8 +789,8 @@ class InstancePolicy(proto.Message):
file system or a raw storage drive that is not
ready for data storage and accessing.
reservation (str):
If specified, VMs will consume only the
specified reservation. If not specified
Optional. If specified, VMs will consume only
the specified reservation. If not specified
(default), VMs will consume any applicable
reservation.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,19 @@ class Container(proto.Message):
entrypoint (str):
Overrides the ``ENTRYPOINT`` specified in the container.
volumes (MutableSequence[str]):
Volumes to mount (bind mount) from the host
machine files or directories into the container,
formatted to match docker run's --volume option,
e.g. /foo:/bar, or /foo:/bar:ro
Volumes to mount (bind mount) from the host machine files or
directories into the container, formatted to match docker
run's --volume option, e.g. /foo:/bar, or /foo:/bar:ro
If the ``TaskSpec.Volumes`` field is specified but this
field is not, Batch will mount each volume from the host
machine to the container with the same mount path by
default. In this case, the default mount option for
containers will be read-only (ro) for existing persistent
disks and read-write (rw) for other volume types, regardless
of the original mount options specified in
``TaskSpec.Volumes``. If you need different mount settings,
you can explicitly configure them in this field.
options (str):
Arbitrary additional options to include in
the "docker run" command when running this
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.1"
"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.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2628,6 +2628,7 @@ def test_create_job_rest(request_type):
"device_name": "device_name_value",
}
],
"reservation": "reservation_value",
},
"instance_template": "instance_template_value",
"install_gpu_drivers": True,
Expand Down Expand Up @@ -2979,6 +2980,7 @@ def test_create_job_rest_bad_request(
"device_name": "device_name_value",
}
],
"reservation": "reservation_value",
},
"instance_template": "instance_template_value",
"install_gpu_drivers": True,
Expand Down

0 comments on commit 523ee16

Please sign in to comment.