From 9a5c4be4c9b8b374043365e8f5c4efa838db6272 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 18 Apr 2023 13:17:02 -0700 Subject: [PATCH] Copybara import of the project: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -- eacdcb5bb07c9fbd764cb529475e9c3fa5b32786 by Owl Bot : feat: added ignore_dependent_resources to DeleteCaPoolRequest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest PiperOrigin-RevId: 522096199 Source-Link: https://github.com/googleapis/googleapis/commit/d9592ed448f89a398fac1a613b22d81a1f5f7ffe Source-Link: https://github.com/googleapis/googleapis-gen/commit/0ab428e3934981db9c8c7bf17b1fea5d74682afb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGFiNDI4ZTM5MzQ5ODFkYjljOGM3YmYxN2IxZmVhNWQ3NDY4MmFmYiJ9 -- 040ae7993ba335eef6aaaf499b2832a922097b3b by Owl Bot : 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 886f8459b9d043a9b27b0baf23a85cf69b0c0c77 by Owl Bot : feat: add notification_channels in aiplatform v1beta1 model_monitoring.proto PiperOrigin-RevId: 523180073 Source-Link: https://github.com/googleapis/googleapis/commit/a793ce31e6a71027fbad8a8157b22a4b488ea77c Source-Link: https://github.com/googleapis/googleapis-gen/commit/c904f381ad20d373cb91bf687b932f6f48a8f0b9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzkwNGYzODFhZDIwZDM3M2NiOTFiZjY4N2I5MzJmNmY0OGE4ZjBiOSJ9 -- 778d132b2b36af10d659035cbc3ff0021ce3c3e2 by Owl Bot : 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 3da480042300ba8d46f56ad4a066036af163bccb by Owl Bot : chore: Provide .NET-specific generator settings PiperOrigin-RevId: 523994764 Source-Link: https://github.com/googleapis/googleapis/commit/b346628423b50cad43eb9b83a02a3d40403c38cc Source-Link: https://github.com/googleapis/googleapis-gen/commit/a42e2f926664160d4966f84199d848b9a79347b1 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTQyZTJmOTI2NjY0MTYwZDQ5NjZmODQxOTlkODQ4YjlhNzkzNDdiMSJ9 -- b1367f46798ecb9f6ff082513120b6fc9f1bb4e6 by Owl Bot : 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- ffaaee907fed34e54dd5371b3b5322eaaa8e6e48 by Owl Bot : feat: add is_default to Tensorboard in aiplatform v1 tensorboard.proto and v1beta1 tensorboard.proto PiperOrigin-RevId: 524384228 Source-Link: https://github.com/googleapis/googleapis/commit/6774ccbbc3f182f6ae3a32dca29e1da489ad8a8f Source-Link: https://github.com/googleapis/googleapis-gen/commit/d80853df782b8d3863a2334bad7c809bf86f00bb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDgwODUzZGY3ODJiOGQzODYzYTIzMzRiYWQ3YzgwOWJmODZmMDBiYiJ9 -- e1613bddb8bd0f02f0ee8466d4b72e90262b9843 by Owl Bot : 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 6b3ea4eaf25fff6849d7f6992870dc4e29b24635 by Owl Bot : feat: Add PeeredNetworkIpRange to NetworkConfigs message feat: Add NpmPackages to Artifact and Results messages and new SHA512 hash type docs: Various doc updates Committer: @giangnguyen PiperOrigin-RevId: 525153459 Source-Link: https://github.com/googleapis/googleapis/commit/0c7c7dff7fedc43ba4989363333c175a1da401a2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8d2d20f50c585775e506b61bb43e9e4922795354 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGQyZDIwZjUwYzU4NTc3NWU1MDZiNjFiYjQzZTllNDkyMjc5NTM1NCJ9 -- abd6061eab7edc99e1b620440fe33f0504365d41 by Owl Bot : 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md COPYBARA_INTEGRATE_REVIEW=https://github.com/googleapis/python-aiplatform/pull/2066 from googleapis:owl-bot-copy e3890f1a3685d98d4eb7490decfbf093ffe3e647 PiperOrigin-RevId: 525232649 --- .../services/migration_service/client.py | 18 ++--- .../cloud/aiplatform_v1/types/tensorboard.py | 12 +++ .../services/job_service/async_client.py | 4 + .../services/job_service/client.py | 20 +++++ .../types/model_monitoring.py | 8 ++ .../aiplatform_v1beta1/types/tensorboard.py | 12 +++ noxfile.py | 2 +- ...t_metadata_google.cloud.aiplatform.v1.json | 2 +- ...adata_google.cloud.aiplatform.v1beta1.json | 2 +- .../aiplatform_v1/test_migration_service.py | 26 +++---- .../aiplatform_v1/test_tensorboard_service.py | 4 + .../aiplatform_v1beta1/test_job_service.py | 75 ++++++++++++------- .../test_tensorboard_service.py | 4 + 13 files changed, 138 insertions(+), 51 deletions(-) diff --git a/google/cloud/aiplatform_v1/services/migration_service/client.py b/google/cloud/aiplatform_v1/services/migration_service/client.py index b43dcee16e..c42427af48 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/client.py @@ -230,40 +230,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, - location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/locations/{location}/datasets/{dataset}".format( + return "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", - path, - ) + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def dataset_path( project: str, + location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( + return "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod diff --git a/google/cloud/aiplatform_v1/types/tensorboard.py b/google/cloud/aiplatform_v1/types/tensorboard.py index c8ce1105fa..f979b0b39b 100644 --- a/google/cloud/aiplatform_v1/types/tensorboard.py +++ b/google/cloud/aiplatform_v1/types/tensorboard.py @@ -84,6 +84,14 @@ class Tensorboard(proto.Message): Used to perform a consistent read-modify-write updates. If not set, a blind "overwrite" update happens. + is_default (bool): + Used to indicate if the TensorBoard instance + is the default one. Each project & region can + have at most one default TensorBoard instance. + Creation of a default TensorBoard instance and + updating an existing TensorBoard instance to be + default will mark all other TensorBoard + instances (if any) as non default. """ name: str = proto.Field( @@ -130,6 +138,10 @@ class Tensorboard(proto.Message): proto.STRING, number=9, ) + is_default: bool = proto.Field( + proto.BOOL, + number=12, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py index 4be06a9574..f6ca7d5f68 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py @@ -137,6 +137,10 @@ class JobServiceAsyncClient: ) network_path = staticmethod(JobServiceClient.network_path) parse_network_path = staticmethod(JobServiceClient.parse_network_path) + notification_channel_path = staticmethod(JobServiceClient.notification_channel_path) + parse_notification_channel_path = staticmethod( + JobServiceClient.parse_notification_channel_path + ) tensorboard_path = staticmethod(JobServiceClient.tensorboard_path) parse_tensorboard_path = staticmethod(JobServiceClient.parse_tensorboard_path) trial_path = staticmethod(JobServiceClient.trial_path) diff --git a/google/cloud/aiplatform_v1beta1/services/job_service/client.py b/google/cloud/aiplatform_v1beta1/services/job_service/client.py index 8295020698..d103372c51 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/client.py @@ -457,6 +457,26 @@ def parse_network_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def notification_channel_path( + project: str, + notification_channel: str, + ) -> str: + """Returns a fully-qualified notification_channel string.""" + return "projects/{project}/notificationChannels/{notification_channel}".format( + project=project, + notification_channel=notification_channel, + ) + + @staticmethod + def parse_notification_channel_path(path: str) -> Dict[str, str]: + """Parses a notification_channel path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/notificationChannels/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def tensorboard_path( project: str, diff --git a/google/cloud/aiplatform_v1beta1/types/model_monitoring.py b/google/cloud/aiplatform_v1beta1/types/model_monitoring.py index d47e2eb6e0..336aa03739 100644 --- a/google/cloud/aiplatform_v1beta1/types/model_monitoring.py +++ b/google/cloud/aiplatform_v1beta1/types/model_monitoring.py @@ -401,6 +401,10 @@ class ModelMonitoringAlertConfig(proto.Message): [google.cloud.aiplatform.logging.ModelMonitoringAnomaliesLogEntry][]. This can be further sinked to Pub/Sub or any other services supported by Cloud Logging. + notification_channels (MutableSequence[str]): + Resource names of the NotificationChannels to send alert. + Must be of the format + ``projects//notificationChannels/`` """ class EmailAlertConfig(proto.Message): @@ -426,6 +430,10 @@ class EmailAlertConfig(proto.Message): proto.BOOL, number=2, ) + notification_channels: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=3, + ) class ThresholdConfig(proto.Message): diff --git a/google/cloud/aiplatform_v1beta1/types/tensorboard.py b/google/cloud/aiplatform_v1beta1/types/tensorboard.py index 52809838d3..ac07f07d5b 100644 --- a/google/cloud/aiplatform_v1beta1/types/tensorboard.py +++ b/google/cloud/aiplatform_v1beta1/types/tensorboard.py @@ -84,6 +84,14 @@ class Tensorboard(proto.Message): Used to perform a consistent read-modify-write updates. If not set, a blind "overwrite" update happens. + is_default (bool): + Used to indicate if the TensorBoard instance + is the default one. Each project & region can + have at most one default TensorBoard instance. + Creation of a default TensorBoard instance and + updating an existing TensorBoard instance to be + default will mark all other TensorBoard + instances (if any) as non default. """ name: str = proto.Field( @@ -130,6 +138,10 @@ class Tensorboard(proto.Message): proto.STRING, number=9, ) + is_default: bool = proto.Field( + proto.BOOL, + number=12, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/noxfile.py b/noxfile.py index f61152d82c..2e7154fd4e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -255,7 +255,7 @@ def system(session): if system_test_folder_exists: session.run( "py.test", - "-v", # TODO(b/275569167) revert this flag once bug is fixed + "--quiet", f"--junitxml=system_{session.python}_sponge_log.xml", system_test_folder_path, *session.posargs, diff --git a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json index de0979b370..a1b733c2b2 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-aiplatform", - "version": "1.24.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json index d4db6c231d..5d1d8817ed 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-aiplatform", - "version": "1.24.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/tests/unit/gapic/aiplatform_v1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1/test_migration_service.py index 8fc5db291f..9055645a91 100644 --- a/tests/unit/gapic/aiplatform_v1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_migration_service.py @@ -2030,22 +2030,19 @@ def test_parse_dataset_path(): def test_dataset_path(): project = "squid" - location = "clam" - dataset = "whelk" - expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + dataset = "clam" + expected = "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, location, dataset) + actual = MigrationServiceClient.dataset_path(project, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "octopus", - "location": "oyster", - "dataset": "nudibranch", + "project": "whelk", + "dataset": "octopus", } path = MigrationServiceClient.dataset_path(**expected) @@ -2055,19 +2052,22 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "cuttlefish" - dataset = "mussel" - expected = "projects/{project}/datasets/{dataset}".format( + project = "oyster" + location = "nudibranch" + dataset = "cuttlefish" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "winkle", + "project": "mussel", + "location": "winkle", "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) diff --git a/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py b/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py index ae657165cb..1469bf12ff 100644 --- a/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py @@ -1007,6 +1007,7 @@ def test_get_tensorboard(request_type, transport: str = "grpc"): blob_storage_path_prefix="blob_storage_path_prefix_value", run_count=989, etag="etag_value", + is_default=True, ) response = client.get_tensorboard(request) @@ -1023,6 +1024,7 @@ def test_get_tensorboard(request_type, transport: str = "grpc"): assert response.blob_storage_path_prefix == "blob_storage_path_prefix_value" assert response.run_count == 989 assert response.etag == "etag_value" + assert response.is_default is True def test_get_tensorboard_empty_call(): @@ -1066,6 +1068,7 @@ async def test_get_tensorboard_async( blob_storage_path_prefix="blob_storage_path_prefix_value", run_count=989, etag="etag_value", + is_default=True, ) ) response = await client.get_tensorboard(request) @@ -1083,6 +1086,7 @@ async def test_get_tensorboard_async( assert response.blob_storage_path_prefix == "blob_storage_path_prefix_value" assert response.run_count == 989 assert response.etag == "etag_value" + assert response.is_default is True @pytest.mark.asyncio diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py index e3a6c84e8b..a4ea1e4fa7 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py @@ -12014,10 +12014,33 @@ def test_parse_network_path(): assert expected == actual -def test_tensorboard_path(): +def test_notification_channel_path(): project = "cuttlefish" - location = "mussel" - tensorboard = "winkle" + notification_channel = "mussel" + expected = "projects/{project}/notificationChannels/{notification_channel}".format( + project=project, + notification_channel=notification_channel, + ) + actual = JobServiceClient.notification_channel_path(project, notification_channel) + assert expected == actual + + +def test_parse_notification_channel_path(): + expected = { + "project": "winkle", + "notification_channel": "nautilus", + } + path = JobServiceClient.notification_channel_path(**expected) + + # Check that the path construction is reversible. + actual = JobServiceClient.parse_notification_channel_path(path) + assert expected == actual + + +def test_tensorboard_path(): + project = "scallop" + location = "abalone" + tensorboard = "squid" expected = ( "projects/{project}/locations/{location}/tensorboards/{tensorboard}".format( project=project, @@ -12031,9 +12054,9 @@ def test_tensorboard_path(): def test_parse_tensorboard_path(): expected = { - "project": "nautilus", - "location": "scallop", - "tensorboard": "abalone", + "project": "clam", + "location": "whelk", + "tensorboard": "octopus", } path = JobServiceClient.tensorboard_path(**expected) @@ -12043,10 +12066,10 @@ def test_parse_tensorboard_path(): def test_trial_path(): - project = "squid" - location = "clam" - study = "whelk" - trial = "octopus" + project = "oyster" + location = "nudibranch" + study = "cuttlefish" + trial = "mussel" expected = ( "projects/{project}/locations/{location}/studies/{study}/trials/{trial}".format( project=project, @@ -12061,10 +12084,10 @@ def test_trial_path(): def test_parse_trial_path(): expected = { - "project": "oyster", - "location": "nudibranch", - "study": "cuttlefish", - "trial": "mussel", + "project": "winkle", + "location": "nautilus", + "study": "scallop", + "trial": "abalone", } path = JobServiceClient.trial_path(**expected) @@ -12074,7 +12097,7 @@ def test_parse_trial_path(): def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "squid" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -12084,7 +12107,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "clam", } path = JobServiceClient.common_billing_account_path(**expected) @@ -12094,7 +12117,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "whelk" expected = "folders/{folder}".format( folder=folder, ) @@ -12104,7 +12127,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "octopus", } path = JobServiceClient.common_folder_path(**expected) @@ -12114,7 +12137,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "oyster" expected = "organizations/{organization}".format( organization=organization, ) @@ -12124,7 +12147,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "nudibranch", } path = JobServiceClient.common_organization_path(**expected) @@ -12134,7 +12157,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "cuttlefish" expected = "projects/{project}".format( project=project, ) @@ -12144,7 +12167,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "mussel", } path = JobServiceClient.common_project_path(**expected) @@ -12154,8 +12177,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "winkle" + location = "nautilus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -12166,8 +12189,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "scallop", + "location": "abalone", } path = JobServiceClient.common_location_path(**expected) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py index be803bc82c..d6c8ff55b5 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py @@ -1004,6 +1004,7 @@ def test_get_tensorboard(request_type, transport: str = "grpc"): blob_storage_path_prefix="blob_storage_path_prefix_value", run_count=989, etag="etag_value", + is_default=True, ) response = client.get_tensorboard(request) @@ -1020,6 +1021,7 @@ def test_get_tensorboard(request_type, transport: str = "grpc"): assert response.blob_storage_path_prefix == "blob_storage_path_prefix_value" assert response.run_count == 989 assert response.etag == "etag_value" + assert response.is_default is True def test_get_tensorboard_empty_call(): @@ -1063,6 +1065,7 @@ async def test_get_tensorboard_async( blob_storage_path_prefix="blob_storage_path_prefix_value", run_count=989, etag="etag_value", + is_default=True, ) ) response = await client.get_tensorboard(request) @@ -1080,6 +1083,7 @@ async def test_get_tensorboard_async( assert response.blob_storage_path_prefix == "blob_storage_path_prefix_value" assert response.run_count == 989 assert response.etag == "etag_value" + assert response.is_default is True @pytest.mark.asyncio