Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/google-cloud-batch/.flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-batch/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ We support:

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

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


**********
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-batch/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
27 changes: 14 additions & 13 deletions packages/google-cloud-batch/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,24 @@ In order to use this library, you first need to go through the following steps:
Installation
~~~~~~~~~~~~

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

With `virtualenv`_, it's possible to install this library without needing system
With `venv`_, it's possible to install this library without needing system
install permissions, and without clashing with the installed system
dependencies.

.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
.. _`venv`: https://docs.python.org/3/library/venv.html


Code samples and snippets
~~~~~~~~~~~~~~~~~~~~~~~~~

Code samples and snippets live in the `samples/` folder.
Code samples and snippets live in the `samples/`_ folder.

.. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-batch/samples


Supported Python Versions
Expand All @@ -77,21 +80,19 @@ Mac/Linux

.. code-block:: console

pip install virtualenv
virtualenv <your-env>
python3 -m venv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-batch
pip install google-cloud-batch


Windows
^^^^^^^

.. code-block:: console

pip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-batch
py -m venv <your-env>
.\<your-env>\Scripts\activate
pip install google-cloud-batch

Next Steps
~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-batch/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ class TaskGroup(proto.Message):
Output only. TaskGroup name.
The system generates this field based on parent
Job name. For example:

"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
task_spec (google.cloud.batch_v1.types.TaskSpec):
Required. Tasks in the group share the same
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ class Task(proto.Message):
Task name.
The name is generated from the parent TaskGroup
name and 'id' field. For example:

"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01".
status (google.cloud.batch_v1.types.TaskStatus):
Task Status.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ class ListJobsRequest(proto.Message):
filter (str):
List filter.
order_by (str):
Sort results. Supported are "name", "name desc",
"create_time", "create_time desc", and "".
Optional. Sort results. Supported are "name", "name desc",
"create_time", and "create_time desc".
page_size (int):
Page size.
page_token (str):
Expand Down Expand Up @@ -238,8 +238,7 @@ class ListTasksRequest(proto.Message):
Filter string should be of the format
State=TaskStatus.State e.g. State=RUNNING
order_by (str):
Sort results. Supported are "name", "name desc",
"create_time", "create_time desc", and "".
Not implemented.
page_size (int):
Page size.
page_token (str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,21 +592,32 @@ class Disk(proto.Message):

Attributes:
image (str):
Name of a public or custom image used as the data source.
For example, the following are all valid URLs:
Name of an image used as the data source. For example, the
following are all valid URLs:

- Specify the image by its family name:
projects/{project}/global/images/family/{image_family}

.. raw:: html

<pre><code>projects/<var
class="apiparam">project</var>/global/images/family/<var
class="apiparam">image_family</var></code></pre>

- Specify the image version:
projects/{project}/global/images/{image_version}

.. raw:: html

<pre>projects/<var
class="apiparam">project</var>/global/images/<var
class="apiparam">image_version</var></code></pre>

You can also use Batch customized image in short names. The
following image values are supported for a boot disk:

- "batch-debian": use Batch Debian images.
- "batch-centos": use Batch CentOS images.
- "batch-cos": use Batch Container-Optimized images.
- "batch-hpc-centos": use Batch HPC CentOS images.
- ``batch-debian``: use Batch Debian images.
- ``batch-centos``: use Batch CentOS images.
- ``batch-cos``: use Batch Container-Optimized images.
- ``batch-hpc-centos``: use Batch HPC CentOS images.

This field is a member of `oneof`_ ``data_source``.
snapshot (str):
Expand Down Expand Up @@ -717,9 +728,15 @@ class Accelerator(proto.Message):
Deprecated: please use instances[0].install_gpu_drivers
instead.
driver_version (str):
The accelerator driver version that will be
installed for this type.
Not yet implemented.
Optional. The NVIDIA GPU driver version that
should be installed for this type.

You can define the specific driver version such
as "470.103.01", following the driver version
requirements in
https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver.
Batch will install the specific accelerator
driver if qualified.
"""

type_: str = proto.Field(
Expand Down Expand Up @@ -838,6 +855,12 @@ class InstancePolicyOrTemplate(proto.Message):
drivers from a third party location and install them for
GPUs specified in policy.accelerators or instance_template
on their behalf. Default is false.

For Container-Optimized Image cases, Batch will install the
accelerator driver following milestones of
https://cloud.google.com/container-optimized-os/docs/release-notes.
For non Container-Optimized Image cases, following
https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py.
"""

policy: "AllocationPolicy.InstancePolicy" = proto.Field(
Expand All @@ -861,23 +884,36 @@ class NetworkInterface(proto.Message):

Attributes:
network (str):
The URL of an existing network resource. You can specify the
network as a full or partial URL.

The URL of an existing network resource.
You can specify the network as a full or partial
URL.
For example, the following are all valid URLs:

- https://www.googleapis.com/compute/v1/projects/{project}/global/networks/{network}
- projects/{project}/global/networks/{network}
- global/networks/{network}
<pre><code>https://www.googleapis.com/compute/v1/projects/<var
class="apiparam">project</var>/global/networks/<var
class="apiparam">network</var></code></pre>
<pre><code>projects/<var
class="apiparam">project</var>/global/networks/<var
class="apiparam">network</var></code></pre>
<pre><code>global/networks/<var
class="apiparam">network</var></code></pre>
subnetwork (str):
The URL of an existing subnetwork resource in the network.
You can specify the subnetwork as a full or partial URL.

The URL of an existing subnetwork resource in
the network. You can specify the subnetwork as a
full or partial URL.
For example, the following are all valid URLs:

- https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}
- projects/{project}/regions/{region}/subnetworks/{subnetwork}
- regions/{region}/subnetworks/{subnetwork}
<pre><code>https://www.googleapis.com/compute/v1/projects/<var
class="apiparam">project</var>/regions/<var
class="apiparam">region</var>/subnetworks/<var
class="apiparam">subnetwork</var></code></pre>
<pre><code>projects/<var
class="apiparam">project</var>/regions/<var
class="apiparam">region</var>/subnetworks/<var
class="apiparam">subnetwork</var></code></pre>
<pre><code>regions/<var
class="apiparam">region</var>/subnetworks/<var
class="apiparam">subnetwork</var></code></pre>
no_external_ip_address (bool):
Default is false (with an external IP
address). Required if no external public IP
Expand Down Expand Up @@ -1009,6 +1045,7 @@ class TaskGroup(proto.Message):
Output only. TaskGroup name.
The system generates this field based on parent
Job name. For example:

"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
task_spec (google.cloud.batch_v1alpha.types.TaskSpec):
Required. Tasks in the group share the same
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ class Task(proto.Message):
Task name.
The name is generated from the parent TaskGroup
name and 'id' field. For example:

"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01".
status (google.cloud.batch_v1alpha.types.TaskStatus):
Task Status.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-batch/noxfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-batch/scripts/decrypt-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2015 Google Inc. All rights reserved.
# Copyright 2023 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down