Skip to content

Commit 2528a8e

Browse files
feat: Enable gpu driver version field on v1alpha (#11509)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 4ccdde0 commit 2528a8e

File tree

12 files changed

+86
-46
lines changed

12 files changed

+86
-46
lines changed

packages/google-cloud-batch/.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

packages/google-cloud-batch/CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ We support:
236236

237237
Supported versions can be found in our ``noxfile.py`` `config`_.
238238

239-
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/noxfile.py
239+
.. _config: https://github.com/googleapis/google-cloud-python/blob/main/packages/google-cloud-batch/noxfile.py
240240

241241

242242
**********

packages/google-cloud-batch/MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright 2020 Google LLC
3+
# Copyright 2023 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

packages/google-cloud-batch/README.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,24 @@ In order to use this library, you first need to go through the following steps:
3636
Installation
3737
~~~~~~~~~~~~
3838

39-
Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to
40-
create isolated Python environments. The basic problem it addresses is one of
41-
dependencies and versions, and indirectly permissions.
39+
Install this library in a virtual environment using `venv`_. `venv`_ is a tool that
40+
creates isolated Python environments. These isolated environments can have separate
41+
versions of Python packages, which allows you to isolate one project's dependencies
42+
from the dependencies of other projects.
4243

43-
With `virtualenv`_, it's possible to install this library without needing system
44+
With `venv`_, it's possible to install this library without needing system
4445
install permissions, and without clashing with the installed system
4546
dependencies.
4647

47-
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
48+
.. _`venv`: https://docs.python.org/3/library/venv.html
4849

4950

5051
Code samples and snippets
5152
~~~~~~~~~~~~~~~~~~~~~~~~~
5253

53-
Code samples and snippets live in the `samples/` folder.
54+
Code samples and snippets live in the `samples/`_ folder.
55+
56+
.. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-batch/samples
5457

5558

5659
Supported Python Versions
@@ -77,21 +80,19 @@ Mac/Linux
7780

7881
.. code-block:: console
7982
80-
pip install virtualenv
81-
virtualenv <your-env>
83+
python3 -m venv <your-env>
8284
source <your-env>/bin/activate
83-
<your-env>/bin/pip install google-cloud-batch
85+
pip install google-cloud-batch
8486
8587
8688
Windows
8789
^^^^^^^
8890

8991
.. code-block:: console
9092
91-
pip install virtualenv
92-
virtualenv <your-env>
93-
<your-env>\Scripts\activate
94-
<your-env>\Scripts\pip.exe install google-cloud-batch
93+
py -m venv <your-env>
94+
.\<your-env>\Scripts\activate
95+
pip install google-cloud-batch
9596
9697
Next Steps
9798
~~~~~~~~~~

packages/google-cloud-batch/docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2021 Google LLC
2+
# Copyright 2023 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ class TaskGroup(proto.Message):
849849
Output only. TaskGroup name.
850850
The system generates this field based on parent
851851
Job name. For example:
852+
852853
"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
853854
task_spec (google.cloud.batch_v1.types.TaskSpec):
854855
Required. Tasks in the group share the same

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ class Task(proto.Message):
571571
Task name.
572572
The name is generated from the parent TaskGroup
573573
name and 'id' field. For example:
574+
574575
"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01".
575576
status (google.cloud.batch_v1.types.TaskStatus):
576577
Task Status.

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ class ListJobsRequest(proto.Message):
164164
filter (str):
165165
List filter.
166166
order_by (str):
167-
Sort results. Supported are "name", "name desc",
168-
"create_time", "create_time desc", and "".
167+
Optional. Sort results. Supported are "name", "name desc",
168+
"create_time", and "create_time desc".
169169
page_size (int):
170170
Page size.
171171
page_token (str):
@@ -238,8 +238,7 @@ class ListTasksRequest(proto.Message):
238238
Filter string should be of the format
239239
State=TaskStatus.State e.g. State=RUNNING
240240
order_by (str):
241-
Sort results. Supported are "name", "name desc",
242-
"create_time", "create_time desc", and "".
241+
Not implemented.
243242
page_size (int):
244243
Page size.
245244
page_token (str):

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

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -592,21 +592,32 @@ class Disk(proto.Message):
592592
593593
Attributes:
594594
image (str):
595-
Name of a public or custom image used as the data source.
596-
For example, the following are all valid URLs:
595+
Name of an image used as the data source. For example, the
596+
following are all valid URLs:
597597
598598
- Specify the image by its family name:
599-
projects/{project}/global/images/family/{image_family}
599+
600+
.. raw:: html
601+
602+
<pre><code>projects/<var
603+
class="apiparam">project</var>/global/images/family/<var
604+
class="apiparam">image_family</var></code></pre>
605+
600606
- Specify the image version:
601-
projects/{project}/global/images/{image_version}
607+
608+
.. raw:: html
609+
610+
<pre>projects/<var
611+
class="apiparam">project</var>/global/images/<var
612+
class="apiparam">image_version</var></code></pre>
602613
603614
You can also use Batch customized image in short names. The
604615
following image values are supported for a boot disk:
605616
606-
- "batch-debian": use Batch Debian images.
607-
- "batch-centos": use Batch CentOS images.
608-
- "batch-cos": use Batch Container-Optimized images.
609-
- "batch-hpc-centos": use Batch HPC CentOS images.
617+
- ``batch-debian``: use Batch Debian images.
618+
- ``batch-centos``: use Batch CentOS images.
619+
- ``batch-cos``: use Batch Container-Optimized images.
620+
- ``batch-hpc-centos``: use Batch HPC CentOS images.
610621
611622
This field is a member of `oneof`_ ``data_source``.
612623
snapshot (str):
@@ -717,9 +728,15 @@ class Accelerator(proto.Message):
717728
Deprecated: please use instances[0].install_gpu_drivers
718729
instead.
719730
driver_version (str):
720-
The accelerator driver version that will be
721-
installed for this type.
722-
Not yet implemented.
731+
Optional. The NVIDIA GPU driver version that
732+
should be installed for this type.
733+
734+
You can define the specific driver version such
735+
as "470.103.01", following the driver version
736+
requirements in
737+
https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
738+
Batch will install the specific accelerator
739+
driver if qualified.
723740
"""
724741

725742
type_: str = proto.Field(
@@ -838,6 +855,12 @@ class InstancePolicyOrTemplate(proto.Message):
838855
drivers from a third party location and install them for
839856
GPUs specified in policy.accelerators or instance_template
840857
on their behalf. Default is false.
858+
859+
For Container-Optimized Image cases, Batch will install the
860+
accelerator driver following milestones of
861+
https://cloud.google.com/container-optimized-os/docs/release-notes.
862+
For non Container-Optimized Image cases, following
863+
https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
841864
"""
842865

843866
policy: "AllocationPolicy.InstancePolicy" = proto.Field(
@@ -861,23 +884,36 @@ class NetworkInterface(proto.Message):
861884
862885
Attributes:
863886
network (str):
864-
The URL of an existing network resource. You can specify the
865-
network as a full or partial URL.
866-
887+
The URL of an existing network resource.
888+
You can specify the network as a full or partial
889+
URL.
867890
For example, the following are all valid URLs:
868891
869-
- https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
870-
- projects/{project}/global/networks/{network}
871-
- global/networks/{network}
892+
<pre><code>https://www.googleapis.com/compute/v1/projects/<var
893+
class="apiparam">project</var>/global/networks/<var
894+
class="apiparam">network</var></code></pre>
895+
<pre><code>projects/<var
896+
class="apiparam">project</var>/global/networks/<var
897+
class="apiparam">network</var></code></pre>
898+
<pre><code>global/networks/<var
899+
class="apiparam">network</var></code></pre>
872900
subnetwork (str):
873-
The URL of an existing subnetwork resource in the network.
874-
You can specify the subnetwork as a full or partial URL.
875-
901+
The URL of an existing subnetwork resource in
902+
the network. You can specify the subnetwork as a
903+
full or partial URL.
876904
For example, the following are all valid URLs:
877905
878-
- https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
879-
- projects/{project}/regions/{region}/subnetworks/{subnetwork}
880-
- regions/{region}/subnetworks/{subnetwork}
906+
<pre><code>https://www.googleapis.com/compute/v1/projects/<var
907+
class="apiparam">project</var>/regions/<var
908+
class="apiparam">region</var>/subnetworks/<var
909+
class="apiparam">subnetwork</var></code></pre>
910+
<pre><code>projects/<var
911+
class="apiparam">project</var>/regions/<var
912+
class="apiparam">region</var>/subnetworks/<var
913+
class="apiparam">subnetwork</var></code></pre>
914+
<pre><code>regions/<var
915+
class="apiparam">region</var>/subnetworks/<var
916+
class="apiparam">subnetwork</var></code></pre>
881917
no_external_ip_address (bool):
882918
Default is false (with an external IP
883919
address). Required if no external public IP
@@ -1009,6 +1045,7 @@ class TaskGroup(proto.Message):
10091045
Output only. TaskGroup name.
10101046
The system generates this field based on parent
10111047
Job name. For example:
1048+
10121049
"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
10131050
task_spec (google.cloud.batch_v1alpha.types.TaskSpec):
10141051
Required. Tasks in the group share the same

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ class Task(proto.Message):
601601
Task name.
602602
The name is generated from the parent TaskGroup
603603
name and 'id' field. For example:
604+
604605
"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01".
605606
status (google.cloud.batch_v1alpha.types.TaskStatus):
606607
Task Status.

0 commit comments

Comments
 (0)