Skip to content

Commit db76c5b

Browse files
authored
Merge branch 'main' into patch-1
2 parents e9ac880 + cdd557e commit db76c5b

File tree

7 files changed

+98
-26
lines changed

7 files changed

+98
-26
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# Changelog
22

33

4+
## [1.19.0](https://github.com/googleapis/python-aiplatform/compare/v1.18.3...v1.19.0) (2022-11-17)
5+
6+
7+
### Features
8+
9+
* Add Feature Store: Streaming Ingestion (write_feature_values()) and introduce Preview namespace to Vertex SDK ([bae0315](https://github.com/googleapis/python-aiplatform/commit/bae03158c06865d1b61c06a1c8af64e876ce76dd))
10+
* Add bq_dataset_id parameter to batch_serve_to_df ([bb72562](https://github.com/googleapis/python-aiplatform/commit/bb72562f4515b6ace73a735477584ca0b5a30f58))
11+
* Add annotation_labels to ImportDataConfig in aiplatform v1 dataset.proto ([43e2805](https://github.com/googleapis/python-aiplatform/commit/43e28052d798c380de6e102edbe257a0100738cd))
12+
* Add support for ordery_by in Metadata SDK list methods for Artifact, Execution and Context. ([2377606](https://github.com/googleapis/python-aiplatform/commit/23776066909b5b7f77f704722d2719e1a1733ad4))
13+
* Support global network parameter. ([c7f57ad](https://github.com/googleapis/python-aiplatform/commit/c7f57ad505b7251b9c663538e2312998445db691))
14+
15+
16+
### Bug Fixes
17+
18+
* Correct data file gcs path for import_data_text_sentiment_analysis_sample test ([86df4b5](https://github.com/googleapis/python-aiplatform/commit/86df4b5d79118caf8f45c3845c92afe6585c24e9))
19+
* Print error for schema classes ([13e2165](https://github.com/googleapis/python-aiplatform/commit/13e216518f20a32c7e18e6ea5b497a5fcb1d77a0))
20+
21+
22+
### Documentation
23+
24+
* Update README with new link for AI Platform API ([35b83d9](https://github.com/googleapis/python-aiplatform/commit/35b83d90649ec396b736469278def4aaaf80621e))
25+
426
## [1.18.3](https://github.com/googleapis/python-aiplatform/compare/v1.18.2...v1.18.3) (2022-11-01)
527

628

google/cloud/aiplatform/_pipeline_based_service/pipeline_based_service.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,21 @@ def list(
391391

392392
for pipeline_execution in filtered_pipeline_executions:
393393
if "pipeline_job_resource_name" in pipeline_execution.metadata:
394-
service_pipeline_job = cls(
395-
pipeline_execution.metadata["pipeline_job_resource_name"],
396-
project=project,
397-
location=location,
398-
credentials=credentials,
399-
)
400-
service_pipeline_jobs.append(service_pipeline_job)
394+
# This is wrapped in a try/except for cases when both
395+
# `_coponent_identifier` and `_template_name_identifier` are
396+
# set. In that case, even though all pipelines returned by the
397+
# Execution.list() call will match the `_component_identifier`,
398+
# some may not match the `_template_name_identifier`
399+
try:
400+
service_pipeline_job = cls(
401+
pipeline_execution.metadata["pipeline_job_resource_name"],
402+
project=project,
403+
location=location,
404+
credentials=credentials,
405+
)
406+
service_pipeline_jobs.append(service_pipeline_job)
407+
except ValueError:
408+
continue
401409

402410
return service_pipeline_jobs
403411

google/cloud/aiplatform/constants/prediction.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Google LLC
1+
# Copyright 2022 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -79,6 +79,12 @@
7979
]
8080

8181
TF_CONTAINER_URIS = [
82+
"us-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-10:latest",
83+
"europe-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-10:latest",
84+
"asia-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-10:latest",
85+
"us-docker.pkg.dev/vertex-ai/prediction/tf2-gpu.2-10:latest",
86+
"europe-docker.pkg.dev/vertex-ai/prediction/tf2-gpu.2-10:latest",
87+
"asia-docker.pkg.dev/vertex-ai/prediction/tf2-gpu.2-10:latest",
8288
"us-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-9:latest",
8389
"europe-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-9:latest",
8490
"asia-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-9:latest",
@@ -130,6 +136,9 @@
130136
"us-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-1:latest",
131137
"europe-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-1:latest",
132138
"asia-docker.pkg.dev/vertex-ai/prediction/tf2-cpu.2-1:latest",
139+
"us-docker.pkg.dev/vertex-ai/prediction/tf2-gpu.2-1:latest",
140+
"europe-docker.pkg.dev/vertex-ai/prediction/tf2-gpu.2-1:latest",
141+
"asia-docker.pkg.dev/vertex-ai/prediction/tf2-gpu.2-1:latest",
133142
"us-docker.pkg.dev/vertex-ai/prediction/tf-cpu.1-15:latest",
134143
"europe-docker.pkg.dev/vertex-ai/prediction/tf-cpu.1-15:latest",
135144
"asia-docker.pkg.dev/vertex-ai/prediction/tf-cpu.1-15:latest",

google/cloud/aiplatform/training_utils/cloud_profiler/plugins/tensorflow/tf_profiler.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717

1818
"""A plugin to handle remote tensoflow profiler sessions for Vertex AI."""
1919

20-
from google.cloud.aiplatform.training_utils.cloud_profiler import cloud_profiler_utils
20+
from google.cloud.aiplatform.training_utils.cloud_profiler import (
21+
cloud_profiler_utils,
22+
)
2123

2224
try:
2325
import tensorflow as tf
24-
from tensorboard_plugin_profile.profile_plugin import ProfilePlugin
26+
from tensorboard_plugin_profile.profile_plugin import (
27+
ProfilePlugin,
28+
)
2529
except ImportError as err:
2630
raise ImportError(cloud_profiler_utils.import_error_msg) from err
2731

@@ -36,10 +40,14 @@
3640
import tensorboard.plugins.base_plugin as tensorboard_base_plugin
3741
from werkzeug import Response
3842

39-
from google.cloud.aiplatform.tensorboard.plugins.tf_profiler import profile_uploader
43+
from google.cloud.aiplatform.tensorboard.plugins.tf_profiler import (
44+
profile_uploader,
45+
)
4046
from google.cloud.aiplatform.training_utils import environment_variables
4147
from google.cloud.aiplatform.training_utils.cloud_profiler import wsgi_types
42-
from google.cloud.aiplatform.training_utils.cloud_profiler.plugins import base_plugin
48+
from google.cloud.aiplatform.training_utils.cloud_profiler.plugins import (
49+
base_plugin,
50+
)
4351
from google.cloud.aiplatform.training_utils.cloud_profiler.plugins.tensorflow import (
4452
tensorboard_api,
4553
)
@@ -68,8 +76,7 @@ def _get_tf_versioning() -> Optional[Version]:
6876
versioning = version.split(".")
6977
if len(versioning) != 3:
7078
return
71-
72-
return Version(int(versioning[0]), int(versioning[1]), int(versioning[2]))
79+
return Version(int(versioning[0]), int(versioning[1]), versioning[2])
7380

7481

7582
def _is_compatible_version(version: Version) -> bool:
@@ -228,7 +235,7 @@ def warn_tensorboard_env_var(var_name: str):
228235
Required. The name of the missing environment variable.
229236
"""
230237
logging.warning(
231-
f"Environment variable `{var_name}` must be set. " + _BASE_TB_ENV_WARNING
238+
"Environment variable `%s` must be set. %s", var_name, _BASE_TB_ENV_WARNING
232239
)
233240

234241

google/cloud/aiplatform/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# limitations under the License.
1616
#
1717

18-
__version__ = "1.18.3"
18+
__version__ = "1.19.0"

tests/unit/aiplatform/test_cloud_profiler.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@
3131
from google.api_core import exceptions
3232
from google.cloud import aiplatform
3333
from google.cloud.aiplatform import training_utils
34-
from google.cloud.aiplatform.tensorboard.plugins.tf_profiler import profile_uploader
35-
from google.cloud.aiplatform.training_utils.cloud_profiler.plugins import base_plugin
34+
from google.cloud.aiplatform.tensorboard.plugins.tf_profiler import (
35+
profile_uploader,
36+
)
37+
from google.cloud.aiplatform.training_utils.cloud_profiler.plugins import (
38+
base_plugin,
39+
)
3640
from google.cloud.aiplatform.training_utils.cloud_profiler.plugins.tensorflow import (
3741
tf_profiler,
3842
)
@@ -175,15 +179,21 @@ def tf_import_mock(name, *args, **kwargs):
175179
def testCanInitializeTFVersion(self):
176180
import tensorflow
177181

178-
with mock.patch.object(tensorflow, "__version__", return_value="1.2.3.4"):
182+
with mock.patch.object(tensorflow, "__version__", "1.2.3.4"):
179183
assert not TFProfiler.can_initialize()
180184

181185
def testCanInitializeOldTFVersion(self):
182186
import tensorflow
183187

184-
with mock.patch.object(tensorflow, "__version__", return_value="2.3.0"):
188+
with mock.patch.object(tensorflow, "__version__", "2.3.0"):
185189
assert not TFProfiler.can_initialize()
186190

191+
def testCanInitializeRcTFVersion(self):
192+
import tensorflow as tf
193+
194+
with mock.patch.object(tf, "__version__", "2.4.0-rc2"):
195+
assert TFProfiler.can_initialize()
196+
187197
def testCanInitializeNoProfilePlugin(self):
188198
orig_find_spec = importlib.util.find_spec
189199

tests/unit/aiplatform/test_pipeline_based_service.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -596,15 +596,9 @@ def test_create_and_submit_pipeline_job(
596596
== test_backing_pipeline_job.resource_name
597597
)
598598

599-
@pytest.mark.parametrize(
600-
"job_spec_json",
601-
[_TEST_PIPELINE_JOB],
602-
)
603599
def test_list_pipeline_based_service(
604600
self,
605601
mock_pipeline_based_service_get,
606-
mock_load_yaml_and_json,
607-
job_spec_json,
608602
get_execution_mock,
609603
list_executions_mock,
610604
):
@@ -635,3 +629,25 @@ def test_list_pipeline_based_service(
635629
# only 1 of the 2 executions in list_executions_mock matches the
636630
# properties of FakePipelineBasedService
637631
assert len(test_list_request) == 1
632+
633+
def test_list_pipeline_based_service_with_template_name_identifier(
634+
self,
635+
mock_pipeline_based_service_get,
636+
get_execution_mock,
637+
list_executions_mock,
638+
):
639+
aiplatform.init(
640+
project=_TEST_PROJECT,
641+
location=_TEST_LOCATION,
642+
credentials=_TEST_CREDENTIALS,
643+
)
644+
645+
self.FakePipelineBasedService._template_name_identifier = (
646+
_TEST_INVALID_PIPELINE_NAME_IDENTIFIER
647+
)
648+
649+
test_list_request = self.FakePipelineBasedService.list()
650+
651+
# None of the mock pipelines match the `_template_name_identifier`
652+
# set above, so the returned list should be empty
653+
assert len(test_list_request) == 0

0 commit comments

Comments
 (0)