From 15bcd145e9874cffa8fc288891a14a67ef775b3a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 13:12:13 +0000 Subject: [PATCH 1/6] chore: remove pinned Sphinx version [autoapprove] (#117) Source-Link: https://togithub.com/googleapis/synthtool/commit/909573ce9da2819eeb835909c795d29aea5c724e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ddf4551385d566771dc713090feb7b4c1164fb8a698fe52bbe7670b24236565b --- .github/.OwlBot.lock.yaml | 4 ++-- noxfile.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 02a4ded..1b3cb6c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc -# created: 2023-06-03T21:25:37.968717478Z + digest: sha256:ddf4551385d566771dc713090feb7b4c1164fb8a698fe52bbe7670b24236565b +# created: 2023-06-27T13:04:21.96690344Z diff --git a/noxfile.py b/noxfile.py index 95e58c5..6b57c24 100644 --- a/noxfile.py +++ b/noxfile.py @@ -305,10 +305,9 @@ def docfx(session): session.install("-e", ".") session.install( - "sphinx==4.0.1", + "gcp-sphinx-docfx-yaml", "alabaster", "recommonmark", - "gcp-sphinx-docfx-yaml", ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) From c777188a7a7629fa10926e4a757e21050dcbe49e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:32:54 +0000 Subject: [PATCH 2/6] chore: store artifacts in placer [autoapprove] (#118) Source-Link: https://togithub.com/googleapis/synthtool/commit/cb960373d12d20f8dc38beee2bf884d49627165e Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d816f26f728ac8b24248741e7d4c461c09764ef9f7be3684d557c9632e46dbd --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/release/common.cfg | 9 +++++++++ noxfile.py | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 1b3cb6c..98994f4 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:ddf4551385d566771dc713090feb7b4c1164fb8a698fe52bbe7670b24236565b -# created: 2023-06-27T13:04:21.96690344Z + digest: sha256:2d816f26f728ac8b24248741e7d4c461c09764ef9f7be3684d557c9632e46dbd +# created: 2023-06-28T17:03:33.371210701Z diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index a608425..b380848 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -38,3 +38,12 @@ env_vars: { key: "SECRET_MANAGER_KEYS" value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } + +# Store the packages we uploaded to PyPI. That way, we have a record of exactly +# what we published, which we can use to generate SBOMs and attestations. +action { + define_artifacts { + regex: "github/python-batch/**/*.tar.gz" + strip_prefix: "github/python-batch" + } +} diff --git a/noxfile.py b/noxfile.py index 6b57c24..7d411fe 100644 --- a/noxfile.py +++ b/noxfile.py @@ -379,6 +379,7 @@ def prerelease_deps(session): "grpcio!=1.52.0rc1", "grpcio-status", "google-api-core", + "google-auth", "proto-plus", "google-cloud-testutils", # dependencies of google-cloud-testutils" @@ -391,7 +392,6 @@ def prerelease_deps(session): # Remaining dependencies other_deps = [ "requests", - "google-auth", ] session.install(*other_deps) From cc9d65ad9329a3e8b281834fe32ea56ce28b5599 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 08:36:06 -0400 Subject: [PATCH 3/6] docs(v1): Add image shortcut example for Batch HPC CentOS Image (#119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Add image shortcut example for Batch HPC CentOS Image PiperOrigin-RevId: 545368122 Source-Link: https://github.com/googleapis/googleapis/commit/dcd6ad773716ebea65c9a19eebf3020ffc2ec92d Source-Link: https://github.com/googleapis/googleapis-gen/commit/d332a89f5cdf54df54d106bf9da098ccd9b98ee0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDMzMmE4OWY1Y2RmNTRkZjU0ZDEwNmJmOWRhMDk4Y2NkOWI5OGVlMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- google/cloud/batch_v1/types/job.py | 3 ++- .../snippet_metadata_google.cloud.batch.v1.json | 2 +- .../snippet_metadata_google.cloud.batch.v1alpha.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/google/cloud/batch_v1/types/job.py b/google/cloud/batch_v1/types/job.py index 08888e8..1608f2e 100644 --- a/google/cloud/batch_v1/types/job.py +++ b/google/cloud/batch_v1/types/job.py @@ -197,7 +197,7 @@ class State(proto.Enum): Values: STATE_UNSPECIFIED (0): - No description available. + Job state unspecified. QUEUED (1): Job is admitted (validated and persisted) and waiting for resources. @@ -487,6 +487,7 @@ class Disk(proto.Message): - "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): diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json index 5f4faeb..e2df106 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.12.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json index 23c3c16..4862cc9 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.12.0" + "version": "0.1.0" }, "snippets": [ { From fa1e00bedc7386ab6119ab79c11ec03607bb6da7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 09:53:48 -0400 Subject: [PATCH 4/6] feat(v1alpha): Add gpu driver version field (#121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add gpu driver version field docs: Add image shortcut example for Batch HPC CentOS Image PiperOrigin-RevId: 545417413 Source-Link: https://github.com/googleapis/googleapis/commit/8cd04fb3a4ffe73d7aaa1d33d69a0c2c5ad6576e Source-Link: https://github.com/googleapis/googleapis-gen/commit/fd64df7fd952b3ee2240b7ebffffe17e53fe34b4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmQ2NGRmN2ZkOTUyYjNlZTIyNDBiN2ViZmZmZmUxN2U1M2ZlMzRiNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- google/cloud/batch_v1alpha/types/job.py | 11 ++++++++++- tests/unit/gapic/batch_v1alpha/test_batch_service.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/google/cloud/batch_v1alpha/types/job.py b/google/cloud/batch_v1alpha/types/job.py index ce1d06c..bb10613 100644 --- a/google/cloud/batch_v1alpha/types/job.py +++ b/google/cloud/batch_v1alpha/types/job.py @@ -281,7 +281,7 @@ class State(proto.Enum): Values: STATE_UNSPECIFIED (0): - No description available. + Job state unspecified. QUEUED (1): Job is admitted (validated and persisted) and waiting for resources. @@ -606,6 +606,7 @@ class Disk(proto.Message): - "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): @@ -715,6 +716,10 @@ class Accelerator(proto.Message): install_gpu_drivers (bool): 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. """ type_: str = proto.Field( @@ -729,6 +734,10 @@ class Accelerator(proto.Message): proto.BOOL, number=3, ) + driver_version: str = proto.Field( + proto.STRING, + number=4, + ) class InstancePolicy(proto.Message): r"""InstancePolicy describes an instance type and resources diff --git a/tests/unit/gapic/batch_v1alpha/test_batch_service.py b/tests/unit/gapic/batch_v1alpha/test_batch_service.py index e481c4a..d1aa93f 100644 --- a/tests/unit/gapic/batch_v1alpha/test_batch_service.py +++ b/tests/unit/gapic/batch_v1alpha/test_batch_service.py @@ -2625,6 +2625,7 @@ def test_create_job_rest(request_type): "type_": "type__value", "count": 553, "install_gpu_drivers": True, + "driver_version": "driver_version_value", } ], "boot_disk": { @@ -3008,6 +3009,7 @@ def test_create_job_rest_bad_request( "type_": "type__value", "count": 553, "install_gpu_drivers": True, + "driver_version": "driver_version_value", } ], "boot_disk": { From 57f49ccd10494f5ad26a592cd35e4f73bcdcdc8d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 14:04:56 -0400 Subject: [PATCH 5/6] fix: Add async context manager return types (#122) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Add async context manager return types chore: Mock return_value should not populate oneof message fields chore: Support snippet generation for services that only support REST transport chore: Update gapic-generator-python to v1.11.0 PiperOrigin-RevId: 545430278 Source-Link: https://github.com/googleapis/googleapis/commit/601b5326107eeb74800b426d1f9933faa233258a Source-Link: https://github.com/googleapis/googleapis-gen/commit/b3f18d0f6560a855022fd058865e7620479d7af9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjNmMThkMGY2NTYwYTg1NTAyMmZkMDU4ODY1ZTc2MjA0NzlkN2FmOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../batch_v1/services/batch_service/async_client.py | 2 +- .../services/batch_service/transports/rest.py | 2 +- .../services/batch_service/async_client.py | 2 +- .../services/batch_service/transports/rest.py | 2 +- tests/unit/gapic/batch_v1/test_batch_service.py | 12 ++++++++---- tests/unit/gapic/batch_v1alpha/test_batch_service.py | 12 ++++++++---- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/google/cloud/batch_v1/services/batch_service/async_client.py b/google/cloud/batch_v1/services/batch_service/async_client.py index 0258035..9bbf7a3 100644 --- a/google/cloud/batch_v1/services/batch_service/async_client.py +++ b/google/cloud/batch_v1/services/batch_service/async_client.py @@ -1252,7 +1252,7 @@ async def list_locations( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "BatchServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/batch_v1/services/batch_service/transports/rest.py b/google/cloud/batch_v1/services/batch_service/transports/rest.py index 7679d6c..3fba50f 100644 --- a/google/cloud/batch_v1/services/batch_service/transports/rest.py +++ b/google/cloud/batch_v1/services/batch_service/transports/rest.py @@ -1253,7 +1253,7 @@ def __call__( request_kwargs = json_format.MessageToDict(request) transcoded_request = path_template.transcode(http_options, **request_kwargs) - body = json.loads(json.dumps(transcoded_request["body"])) + body = json.dumps(transcoded_request["body"]) uri = transcoded_request["uri"] method = transcoded_request["method"] diff --git a/google/cloud/batch_v1alpha/services/batch_service/async_client.py b/google/cloud/batch_v1alpha/services/batch_service/async_client.py index fc31ab2..b4ef0d0 100644 --- a/google/cloud/batch_v1alpha/services/batch_service/async_client.py +++ b/google/cloud/batch_v1alpha/services/batch_service/async_client.py @@ -1252,7 +1252,7 @@ async def list_locations( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "BatchServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/batch_v1alpha/services/batch_service/transports/rest.py b/google/cloud/batch_v1alpha/services/batch_service/transports/rest.py index 6749823..eb84d63 100644 --- a/google/cloud/batch_v1alpha/services/batch_service/transports/rest.py +++ b/google/cloud/batch_v1alpha/services/batch_service/transports/rest.py @@ -1253,7 +1253,7 @@ def __call__( request_kwargs = json_format.MessageToDict(request) transcoded_request = path_template.transcode(http_options, **request_kwargs) - body = json.loads(json.dumps(transcoded_request["body"])) + body = json.dumps(transcoded_request["body"]) uri = transcoded_request["uri"] method = transcoded_request["method"] diff --git a/tests/unit/gapic/batch_v1/test_batch_service.py b/tests/unit/gapic/batch_v1/test_batch_service.py index e4f31a4..caf1ef9 100644 --- a/tests/unit/gapic/batch_v1/test_batch_service.py +++ b/tests/unit/gapic/batch_v1/test_batch_service.py @@ -1840,9 +1840,11 @@ async def test_list_jobs_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_jobs(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2492,9 +2494,11 @@ async def test_list_tasks_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_tasks(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token diff --git a/tests/unit/gapic/batch_v1alpha/test_batch_service.py b/tests/unit/gapic/batch_v1alpha/test_batch_service.py index d1aa93f..e356560 100644 --- a/tests/unit/gapic/batch_v1alpha/test_batch_service.py +++ b/tests/unit/gapic/batch_v1alpha/test_batch_service.py @@ -1852,9 +1852,11 @@ async def test_list_jobs_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_jobs(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -2504,9 +2506,11 @@ async def test_list_tasks_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_tasks(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token From a09a35447b3f5d6dd7aaac5508e35982a8a06502 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 11:02:22 -0400 Subject: [PATCH 6/6] chore(main): release 0.13.0 (#120) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ google/cloud/batch/gapic_version.py | 2 +- google/cloud/batch_v1/gapic_version.py | 2 +- google/cloud/batch_v1alpha/gapic_version.py | 2 +- ...snippet_metadata_google.cloud.batch.v1.json | 2 +- ...et_metadata_google.cloud.batch.v1alpha.json | 2 +- 7 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8032c17..ed21d28 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.12.0" + ".": "0.13.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 531e223..a273507 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [0.13.0](https://github.com/googleapis/python-batch/compare/v0.12.0...v0.13.0) (2023-07-04) + + +### Features + +* **v1alpha:** Add gpu driver version field ([fa1e00b](https://github.com/googleapis/python-batch/commit/fa1e00bedc7386ab6119ab79c11ec03607bb6da7)) + + +### Bug Fixes + +* Add async context manager return types ([#122](https://github.com/googleapis/python-batch/issues/122)) ([57f49cc](https://github.com/googleapis/python-batch/commit/57f49ccd10494f5ad26a592cd35e4f73bcdcdc8d)) + + +### Documentation + +* **v1:** Add image shortcut example for Batch HPC CentOS Image ([#119](https://github.com/googleapis/python-batch/issues/119)) ([cc9d65a](https://github.com/googleapis/python-batch/commit/cc9d65ad9329a3e8b281834fe32ea56ce28b5599)) +* **v1alpha:** Add image shortcut example for Batch HPC CentOS Image ([fa1e00b](https://github.com/googleapis/python-batch/commit/fa1e00bedc7386ab6119ab79c11ec03607bb6da7)) + ## [0.12.0](https://github.com/googleapis/python-batch/compare/v0.11.0...v0.12.0) (2023-06-14) diff --git a/google/cloud/batch/gapic_version.py b/google/cloud/batch/gapic_version.py index d02e7cb..42e0462 100644 --- a/google/cloud/batch/gapic_version.py +++ b/google/cloud/batch/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.12.0" # {x-release-please-version} +__version__ = "0.13.0" # {x-release-please-version} diff --git a/google/cloud/batch_v1/gapic_version.py b/google/cloud/batch_v1/gapic_version.py index d02e7cb..42e0462 100644 --- a/google/cloud/batch_v1/gapic_version.py +++ b/google/cloud/batch_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.12.0" # {x-release-please-version} +__version__ = "0.13.0" # {x-release-please-version} diff --git a/google/cloud/batch_v1alpha/gapic_version.py b/google/cloud/batch_v1alpha/gapic_version.py index d02e7cb..42e0462 100644 --- a/google/cloud/batch_v1alpha/gapic_version.py +++ b/google/cloud/batch_v1alpha/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "0.12.0" # {x-release-please-version} +__version__ = "0.13.0" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json index e2df106..1b82edb 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.1.0" + "version": "0.13.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json index 4862cc9..9358ed1 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.batch.v1alpha.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-batch", - "version": "0.1.0" + "version": "0.13.0" }, "snippets": [ {