From 8561b02450c00900ad60e5c7c001676a31471234 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 3 Jun 2023 21:40:31 +0000 Subject: [PATCH 1/3] build(deps): bump cryptography to 41.0.0 [autoapprove] (#114) Source-Link: https://togithub.com/googleapis/synthtool/commit/d0f51a0c2a9a6bcca86911eabea9e484baadf64b Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/requirements.txt | 42 +++++++++++++++++++-------------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 32b3c48..02a4ded 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:9bc5fa3b62b091f60614c08a7fb4fd1d3e1678e326f34dd66ce1eefb5dc3267b -# created: 2023-05-25T14:56:16.294623272Z + digest: sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc +# created: 2023-06-03T21:25:37.968717478Z diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 3b8d7ee..c7929db 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -113,28 +113,26 @@ commonmark==0.9.1 \ --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \ --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 # via rich -cryptography==39.0.1 \ - --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ - --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ - --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ - --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ - --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ - --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ - --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ - --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ - --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ - --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ - --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ - --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ - --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ - --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ - --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ - --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ - --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ - --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ - --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ - --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ - --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 +cryptography==41.0.0 \ + --hash=sha256:0ddaee209d1cf1f180f1efa338a68c4621154de0afaef92b89486f5f96047c55 \ + --hash=sha256:14754bcdae909d66ff24b7b5f166d69340ccc6cb15731670435efd5719294895 \ + --hash=sha256:344c6de9f8bda3c425b3a41b319522ba3208551b70c2ae00099c205f0d9fd3be \ + --hash=sha256:34d405ea69a8b34566ba3dfb0521379b210ea5d560fafedf9f800a9a94a41928 \ + --hash=sha256:3680248309d340fda9611498a5319b0193a8dbdb73586a1acf8109d06f25b92d \ + --hash=sha256:3c5ef25d060c80d6d9f7f9892e1d41bb1c79b78ce74805b8cb4aa373cb7d5ec8 \ + --hash=sha256:4ab14d567f7bbe7f1cdff1c53d5324ed4d3fc8bd17c481b395db224fb405c237 \ + --hash=sha256:5c1f7293c31ebc72163a9a0df246f890d65f66b4a40d9ec80081969ba8c78cc9 \ + --hash=sha256:6b71f64beeea341c9b4f963b48ee3b62d62d57ba93eb120e1196b31dc1025e78 \ + --hash=sha256:7d92f0248d38faa411d17f4107fc0bce0c42cae0b0ba5415505df72d751bf62d \ + --hash=sha256:8362565b3835ceacf4dc8f3b56471a2289cf51ac80946f9087e66dc283a810e0 \ + --hash=sha256:84a165379cb9d411d58ed739e4af3396e544eac190805a54ba2e0322feb55c46 \ + --hash=sha256:88ff107f211ea696455ea8d911389f6d2b276aabf3231bf72c8853d22db755c5 \ + --hash=sha256:9f65e842cb02550fac96536edb1d17f24c0a338fd84eaf582be25926e993dde4 \ + --hash=sha256:a4fc68d1c5b951cfb72dfd54702afdbbf0fb7acdc9b7dc4301bbf2225a27714d \ + --hash=sha256:b7f2f5c525a642cecad24ee8670443ba27ac1fab81bba4cc24c7b6b41f2d0c75 \ + --hash=sha256:b846d59a8d5a9ba87e2c3d757ca019fa576793e8758174d3868aecb88d6fc8eb \ + --hash=sha256:bf8fc66012ca857d62f6a347007e166ed59c0bc150cefa49f28376ebe7d992a2 \ + --hash=sha256:f5d0bf9b252f30a31664b6f64432b4730bb7038339bd18b1fafe129cfc2be9be # via # gcp-releasetool # secretstorage From 23d3a5ebe524426507283087b7f2529ad9de65dd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:53:55 +0000 Subject: [PATCH 2/3] feat(v1): Add support for scheduling_policy (#115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: implement minCpuPlatform --- feat: Enable scheduling_policy in v1 --- feat: update TaskGroup doc PiperOrigin-RevId: 540043151 Source-Link: https://github.com/googleapis/googleapis/commit/50a39ef600abf842ce8a749894f674b301253091 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5bdc561934be9a4ad3244358288bae8ea65b8bd1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWJkYzU2MTkzNGJlOWE0YWQzMjQ0MzU4Mjg4YmFlOGVhNjViOGJkMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat(v1): Add support for scheduling_policy docs(v1): Minor clarifications for TaskGroup and min_cpu_platform PiperOrigin-RevId: 540265821 Source-Link: https://github.com/googleapis/googleapis/commit/71856b9fcb496e11bdbbe52d3d8030c7334519e1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f194a119b94d3b1b96043e74ea6fef7eb42eb798 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE5NGExMTliOTRkM2IxYjk2MDQzZTc0ZWE2ZmVmN2ViNDJlYjc5OCJ9 * 🦉 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 | 35 ++++++++++++++++--- google/cloud/batch_v1alpha/types/job.py | 8 ++--- ...nippet_metadata_google.cloud.batch.v1.json | 2 +- ...t_metadata_google.cloud.batch.v1alpha.json | 2 +- .../unit/gapic/batch_v1/test_batch_service.py | 2 ++ 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/google/cloud/batch_v1/types/job.py b/google/cloud/batch_v1/types/job.py index a509f7b..08888e8 100644 --- a/google/cloud/batch_v1/types/job.py +++ b/google/cloud/batch_v1/types/job.py @@ -622,7 +622,6 @@ class InstancePolicy(proto.Message): The minimum CPU platform. See https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - Not yet implemented. provisioning_model (google.cloud.batch_v1.types.AllocationPolicy.ProvisioningModel): The provisioning model. accelerators (MutableSequence[google.cloud.batch_v1.types.AllocationPolicy.Accelerator]): @@ -841,8 +840,8 @@ class PlacementPolicy(proto.Message): class TaskGroup(proto.Message): - r"""A TaskGroup contains one or multiple Tasks that share the - same Runnable but with different runtime parameters. + r"""A TaskGroup defines one or more Tasks that all share the same + TaskSpec. Attributes: name (str): @@ -860,6 +859,9 @@ class TaskGroup(proto.Message): Max number of tasks that can run in parallel. Default to min(task_count, 1000). Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + scheduling_policy (google.cloud.batch_v1.types.TaskGroup.SchedulingPolicy): + Scheduling policy for Tasks in the TaskGroup. The default + value is AS_SOON_AS_POSSIBLE. task_environments (MutableSequence[google.cloud.batch_v1.types.Environment]): An array of environment variable mappings, which are passed to Tasks with matching indices. If task_environments is used @@ -873,8 +875,6 @@ class TaskGroup(proto.Message): Tasks in the Task's parent TaskGroup, and the specific Task's index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - - task_environments supports up to 200 entries. task_count_per_node (int): Max number of tasks that can be run on a VM at the same time. If not specified, the system @@ -891,6 +891,26 @@ class TaskGroup(proto.Message): tasks in the same TaskGroup. """ + class SchedulingPolicy(proto.Enum): + r"""How Tasks in the TaskGroup should be scheduled relative to + each other. + + Values: + SCHEDULING_POLICY_UNSPECIFIED (0): + Unspecified. + AS_SOON_AS_POSSIBLE (1): + Run Tasks as soon as resources are available. + + Tasks might be executed in parallel depending on parallelism + and task_count values. + IN_ORDER (2): + Run Tasks sequentially with increased task + index. + """ + SCHEDULING_POLICY_UNSPECIFIED = 0 + AS_SOON_AS_POSSIBLE = 1 + IN_ORDER = 2 + name: str = proto.Field( proto.STRING, number=1, @@ -908,6 +928,11 @@ class TaskGroup(proto.Message): proto.INT64, number=5, ) + scheduling_policy: SchedulingPolicy = proto.Field( + proto.ENUM, + number=6, + enum=SchedulingPolicy, + ) task_environments: MutableSequence[task.Environment] = proto.RepeatedField( proto.MESSAGE, number=9, diff --git a/google/cloud/batch_v1alpha/types/job.py b/google/cloud/batch_v1alpha/types/job.py index ea83fd1..ce1d06c 100644 --- a/google/cloud/batch_v1alpha/types/job.py +++ b/google/cloud/batch_v1alpha/types/job.py @@ -743,7 +743,6 @@ class InstancePolicy(proto.Message): The minimum CPU platform. See https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - Not yet implemented. provisioning_model (google.cloud.batch_v1alpha.types.AllocationPolicy.ProvisioningModel): The provisioning model. accelerators (MutableSequence[google.cloud.batch_v1alpha.types.AllocationPolicy.Accelerator]): @@ -993,8 +992,8 @@ class PlacementPolicy(proto.Message): class TaskGroup(proto.Message): - r"""A TaskGroup contains one or multiple Tasks that share the - same Runnable but with different runtime parameters. + r"""A TaskGroup defines one or more Tasks that all share the same + TaskSpec. Attributes: name (str): @@ -1039,8 +1038,6 @@ class TaskGroup(proto.Message): Tasks in the Task's parent TaskGroup, and the specific Task's index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - - task_environments supports up to 200 entries. task_count_per_node (int): Max number of tasks that can be run on a VM at the same time. If not specified, the system @@ -1072,7 +1069,6 @@ class SchedulingPolicy(proto.Enum): IN_ORDER (2): Run Tasks sequentially with increased task index. - Not yet implemented. """ SCHEDULING_POLICY_UNSPECIFIED = 0 AS_SOON_AS_POSSIBLE = 1 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 1c3fed7..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.11.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 d9dd8c3..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.11.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/tests/unit/gapic/batch_v1/test_batch_service.py b/tests/unit/gapic/batch_v1/test_batch_service.py index 4f7842f..e4f31a4 100644 --- a/tests/unit/gapic/batch_v1/test_batch_service.py +++ b/tests/unit/gapic/batch_v1/test_batch_service.py @@ -2582,6 +2582,7 @@ def test_create_job_rest(request_type): }, "task_count": 1083, "parallelism": 1174, + "scheduling_policy": 1, "task_environments": {}, "task_count_per_node": 2022, "require_hosts_file": True, @@ -2931,6 +2932,7 @@ def test_create_job_rest_bad_request( }, "task_count": 1083, "parallelism": 1174, + "scheduling_policy": 1, "task_environments": {}, "task_count_per_node": 2022, "require_hosts_file": True, From 9a55b6bfcde7044f4de23f9d1afe7bceee5a0e06 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 14 Jun 2023 13:13:16 -0400 Subject: [PATCH 3/3] chore(main): release 0.12.0 (#116) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ 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 +- .../snippet_metadata_google.cloud.batch.v1alpha.json | 2 +- 7 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 78e7f27..8032c17 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.11.0" + ".": "0.12.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index f3827d0..531e223 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.12.0](https://github.com/googleapis/python-batch/compare/v0.11.0...v0.12.0) (2023-06-14) + + +### Features + +* **v1:** Add support for scheduling_policy ([23d3a5e](https://github.com/googleapis/python-batch/commit/23d3a5ebe524426507283087b7f2529ad9de65dd)) + + +### Documentation + +* Minor clarifications for TaskGroup and min_cpu_platform ([23d3a5e](https://github.com/googleapis/python-batch/commit/23d3a5ebe524426507283087b7f2529ad9de65dd)) + ## [0.11.0](https://github.com/googleapis/python-batch/compare/v0.10.0...v0.11.0) (2023-05-25) diff --git a/google/cloud/batch/gapic_version.py b/google/cloud/batch/gapic_version.py index 111c83c..d02e7cb 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.11.0" # {x-release-please-version} +__version__ = "0.12.0" # {x-release-please-version} diff --git a/google/cloud/batch_v1/gapic_version.py b/google/cloud/batch_v1/gapic_version.py index 111c83c..d02e7cb 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.11.0" # {x-release-please-version} +__version__ = "0.12.0" # {x-release-please-version} diff --git a/google/cloud/batch_v1alpha/gapic_version.py b/google/cloud/batch_v1alpha/gapic_version.py index 111c83c..d02e7cb 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.11.0" # {x-release-please-version} +__version__ = "0.12.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..5f4faeb 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.12.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..23c3c16 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.12.0" }, "snippets": [ {