Skip to content

Commit d65fe2f

Browse files
authored
Merge branch 'main' into owl-bot-copy
2 parents 38352a6 + 203cb47 commit d65fe2f

File tree

72 files changed

+2480
-548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2480
-548
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:7a40313731a7cb1454eef6b33d3446ebb121836738dc3ab3d2d3ded5268c35b6
16+
digest: sha256:ddf4551385d566771dc713090feb7b4c1164fb8a698fe52bbe7670b24236565b

.kokoro/docker/docs/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ RUN apt-get update \
6060
&& rm -rf /var/lib/apt/lists/* \
6161
&& rm -f /var/cache/apt/archives/*.deb
6262

63-
###################### Install python 3.8.11
63+
###################### Install python 3.9.13
6464

65-
# Download python 3.8.11
66-
RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz
65+
# Download python 3.9.13
66+
RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz
6767

6868
# Extract files
69-
RUN tar -xvf Python-3.8.11.tgz
69+
RUN tar -xvf Python-3.9.13.tgz
7070

71-
# Install python 3.8.11
72-
RUN ./Python-3.8.11/configure --enable-optimizations
71+
# Install python 3.9.13
72+
RUN ./Python-3.9.13/configure --enable-optimizations
7373
RUN make altinstall
7474

7575
###################### Install pip

.kokoro/requirements.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
gcp-docuploader
2-
gcp-releasetool
2+
gcp-releasetool>=1.10.5 # required for compatibility with cryptography>=39.x
33
importlib-metadata
44
typing-extensions
55
twine
66
wheel
77
setuptools
8-
nox
8+
nox>=2022.11.21 # required to remove dependency on py
9+
charset-normalizer<3
10+
click<8.1.0

.kokoro/requirements.txt

Lines changed: 194 additions & 173 deletions
Large diffs are not rendered by default.

.kokoro/samples/python3.11/common.cfg

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Specify which tests to run
11+
env_vars: {
12+
key: "RUN_TESTS_SESSION"
13+
value: "py-3.11"
14+
}
15+
16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "ucaip-sample-tests"
20+
}
21+
22+
env_vars: {
23+
key: "TRAMPOLINE_BUILD_FILE"
24+
value: "github/python-aiplatform/.kokoro/test-samples.sh"
25+
}
26+
27+
# Configure the docker image for kokoro-trampoline.
28+
env_vars: {
29+
key: "TRAMPOLINE_IMAGE"
30+
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
31+
}
32+
33+
# Download secrets for samples
34+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
35+
36+
# Download trampoline resources.
37+
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"
38+
39+
# Use the trampoline script to run in docker.
40+
build_file: "python-aiplatform/.kokoro/trampoline_v2.sh"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
7+
8+
env_vars: {
9+
key: "TRAMPOLINE_BUILD_FILE"
10+
value: "github/python-aiplatform/.kokoro/test-samples-against-head.sh"
11+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "False"
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
rev: 22.3.0
2626
hooks:
2727
- id: black
28-
- repo: https://gitlab.com/pycqa/flake8
28+
- repo: https://github.com/pycqa/flake8
2929
rev: 3.9.2
3030
hooks:
3131
- id: flake8

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.26.0"
2+
".": "1.28.0"
33
}

CHANGELOG.md

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

33

4+
## [1.28.0](https://github.com/googleapis/python-aiplatform/compare/v1.27.1...v1.28.0) (2023-07-08)
5+
6+
7+
### Features
8+
9+
* LLM - Released the Chat models to GA ([22aa26d](https://github.com/googleapis/python-aiplatform/commit/22aa26daabbaaa84f84d3cad524f2b6e8c53e77d))
10+
11+
## [1.27.1](https://github.com/googleapis/python-aiplatform/compare/v1.27.0...v1.27.1) (2023-07-06)
12+
13+
14+
### Features
15+
16+
* Add sdk support for xai example-based explanations ([f9ca1d5](https://github.com/googleapis/python-aiplatform/commit/f9ca1d52a6789f93b4eca9596c04f52a2ca75513))
17+
18+
19+
### Miscellaneous Chores
20+
21+
* Release 1.27.1 ([2159f29](https://github.com/googleapis/python-aiplatform/commit/2159f29e8322aef33cfa27df52a57f7cc7722868))
22+
23+
## [1.27.0](https://github.com/googleapis/python-aiplatform/compare/v1.26.1...v1.27.0) (2023-06-30)
24+
25+
26+
### Features
27+
28+
* Add submit for CustomTrainingJob and CustomContainerTrainingJob which won't block until complete. ([d6476d0](https://github.com/googleapis/python-aiplatform/commit/d6476d0ed1440f58301d8be0b9043b13aa8d910d))
29+
* LLM - Added support for `learning_rate` in tuning ([c6cdd10](https://github.com/googleapis/python-aiplatform/commit/c6cdd108b5f3469340ca16bc6ef56efc55723ce3))
30+
* LLM - Released the Codey models to GA ([89609c9](https://github.com/googleapis/python-aiplatform/commit/89609c9007684e5cbc4b3e5c30d26c0d5539aa39))
31+
32+
33+
### Bug Fixes
34+
35+
* Fix aiplatform.init bug by replacing experiment_name with experiment ([c60773a](https://github.com/googleapis/python-aiplatform/commit/c60773a7db8ce7a59d2cb5787dc90937776c0b8f))
36+
* Fix error when calling update_state() after ExperimentRun.list() ([cb255ec](https://github.com/googleapis/python-aiplatform/commit/cb255ec514995e193df7122dbf67bbd4011e6630))
37+
* LLM - Exported the `ChatMessage` class ([7bf7634](https://github.com/googleapis/python-aiplatform/commit/7bf7634e97dfe56c3130264eeb62a9b5d6b55cac))
38+
* LLM - Fixed the chat models failing due to safetyAttributes format ([459ba86](https://github.com/googleapis/python-aiplatform/commit/459ba86396ab9260fd7b28a1524c051b7ad300a5))
39+
* Vizier - Fixed pyvizier client study creation errors ([16299d1](https://github.com/googleapis/python-aiplatform/commit/16299d14b8f209218d6576614f773c1bcbd21d64))
40+
41+
42+
### Documentation
43+
44+
* Fixed a docstring for _Dataset ([b68a941](https://github.com/googleapis/python-aiplatform/commit/b68a941853f9c38b0ff30f5d07cea1d7fb0700a6))
45+
* Fixed a docstring for TimeSeriesDataset ([a7dfce2](https://github.com/googleapis/python-aiplatform/commit/a7dfce217eebbef0877053b9c0f6f6127b556e82))
46+
* Populate GA LLM SDK Pydocs ([e248285](https://github.com/googleapis/python-aiplatform/commit/e248285b5da4c33a68ccd6198ce7b1d8ab20febf))
47+
* Update scheduled pipelines client max_run_count docstring with allowed values. ([750e161](https://github.com/googleapis/python-aiplatform/commit/750e16179e1a53bc916ae6db93cd28cfd3f911fe))
48+
49+
## [1.26.1](https://github.com/googleapis/python-aiplatform/compare/v1.26.0...v1.26.1) (2023-06-21)
50+
51+
52+
### Features
53+
54+
* Add additional scheduled pipelines client getters and unit tests. ([9371b4f](https://github.com/googleapis/python-aiplatform/commit/9371b4fd3f7529636fc323a7914960d0c6a70db4))
55+
* Add PipelineJobSchedule update method and unit tests. ([69c5f60](https://github.com/googleapis/python-aiplatform/commit/69c5f60bfea5308589a58c2b9ad9f392b3a1283e))
56+
* Add tunable parameters for Model Garden model training to the "AutoMLImageTrainingJob" in SDK. ([50646be](https://github.com/googleapis/python-aiplatform/commit/50646be154b2be6c4738858af2440ad207c4020a))
57+
* LLM - Added batch prediction ([2235305](https://github.com/googleapis/python-aiplatform/commit/2235305c7714835ff331e5294f90a6a23e31391d))
58+
* LLM - Exposed the chat history ([bf0e20b](https://github.com/googleapis/python-aiplatform/commit/bf0e20b497675125e0bc5abc10455b06f7a0c019))
59+
* LLM - Exposed the safety attributes ([01ba3ca](https://github.com/googleapis/python-aiplatform/commit/01ba3cabf522a500a29c4120a264e204a660482a))
60+
61+
62+
### Bug Fixes
63+
64+
* Change scheduled pipelines client dashboard uri to view created schedules. Note: uri will not work until scheduler UI is GA. ([d4d8613](https://github.com/googleapis/python-aiplatform/commit/d4d86135ae1593eaffe782d1e197c2a844e6f28a))
65+
* Fix bug where scheduled pipeline jobs were not running. ([4e7d11a](https://github.com/googleapis/python-aiplatform/commit/4e7d11a072c2b3bdb8e6233ff879ec2c31a626ea))
66+
* Remove Schedule read mask because ListSchedules does not support it. ([1fda417](https://github.com/googleapis/python-aiplatform/commit/1fda4172baaf200414d95e7217bfef0e500cc16a))
67+
68+
69+
### Miscellaneous Chores
70+
71+
* Release 1.26.1 ([42567d2](https://github.com/googleapis/python-aiplatform/commit/42567d2ba7dc14d7fbfea2a4afb71cb701582012))
72+
73+
74+
### Documentation
75+
76+
* Update scheduled pipelines client wait() docstring. ([a7d92e5](https://github.com/googleapis/python-aiplatform/commit/a7d92e51ceab2e7c0f72aec1a19404c7c17c65a5))
77+
478
## [1.26.0](https://github.com/googleapis/python-aiplatform/compare/v1.25.0...v1.26.0) (2023-06-07)
579

680

docs/vertexai/services.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ Vertex AI SDK
66
:show-inheritance:
77
:inherited-members:
88

9+
.. automodule:: vertexai.language_models
10+
:members:
11+
:show-inheritance:
12+
:inherited-members:
13+
914
.. automodule:: vertexai.preview.language_models
1015
:members:
1116
:show-inheritance:

google/cloud/aiplatform/datasets/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ def create(
187187
request_metadata (Sequence[Tuple[str, str]]):
188188
Strings which should be sent along with the request as metadata.
189189
labels (Dict[str, str]):
190-
Optional. Labels with user-defined metadata to organize your Tensorboards.
190+
Optional. Labels with user-defined metadata to organize your datasets.
191191
Label keys and values can be no longer than 64 characters
192192
(Unicode codepoints), can only contain lowercase letters, numeric
193193
characters, underscores and dashes. International characters are allowed.
194-
No more than 64 user labels can be associated with one Tensorboard
194+
No more than 64 user labels can be associated with one Dataset
195195
(System labels are excluded).
196196
See https://goo.gl/xmQnxf for more information and examples of labels.
197197
System reserved label keys are prefixed with "aiplatform.googleapis.com/"

google/cloud/aiplatform/datasets/time_series_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def create(
7878
request_metadata (Sequence[Tuple[str, str]]):
7979
Strings which should be sent along with the request as metadata.
8080
labels (Dict[str, str]):
81-
Optional. Labels with user-defined metadata to organize your Tensorboards.
81+
Optional. Labels with user-defined metadata to organize your datasets.
8282
Label keys and values can be no longer than 64 characters
8383
(Unicode codepoints), can only contain lowercase letters, numeric
8484
characters, underscores and dashes. International characters are allowed.
85-
No more than 64 user labels can be associated with one Tensorboard
85+
No more than 64 user labels can be associated with one TimeSeriesDataset
8686
(System labels are excluded).
8787
See https://goo.gl/xmQnxf for more information and examples of labels.
8888
System reserved label keys are prefixed with "aiplatform.googleapis.com/"

google/cloud/aiplatform/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.26.0" # {x-release-please-version}
16+
__version__ = "1.28.0" # {x-release-please-version}

google/cloud/aiplatform/initializer.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import logging
2121
import pkg_resources # Note this is used after copybara replacement
2222
import os
23-
from typing import List, Optional, Type, Union
23+
from typing import List, Optional, Type, TypeVar, Union
2424

2525
from google.api_core import client_options
2626
from google.api_core import gapic_v1
@@ -41,6 +41,11 @@
4141
encryption_spec_v1beta1 as gca_encryption_spec_v1beta1,
4242
)
4343

44+
_TVertexAiServiceClientWithOverride = TypeVar(
45+
"_TVertexAiServiceClientWithOverride",
46+
bound=utils.VertexAiServiceClientWithOverride,
47+
)
48+
4449

4550
class _Config:
4651
"""Stores common parameters and options for API calls."""
@@ -368,14 +373,14 @@ def common_location_path(
368373

369374
def create_client(
370375
self,
371-
client_class: Type[utils.VertexAiServiceClientWithOverride],
376+
client_class: Type[_TVertexAiServiceClientWithOverride],
372377
credentials: Optional[auth_credentials.Credentials] = None,
373378
location_override: Optional[str] = None,
374379
prediction_client: bool = False,
375380
api_base_path_override: Optional[str] = None,
376381
api_path_override: Optional[str] = None,
377382
appended_user_agent: Optional[List[str]] = None,
378-
) -> utils.VertexAiServiceClientWithOverride:
383+
) -> _TVertexAiServiceClientWithOverride:
379384
"""Instantiates a given VertexAiServiceClient with optional
380385
overrides.
381386

google/cloud/aiplatform/metadata/resource.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ def update(
297297
Custom credentials to use to update this resource. Overrides
298298
credentials set in aiplatform.init.
299299
"""
300+
if not hasattr(self, "_threading_lock"):
301+
self._threading_lock = threading.Lock()
300302

301303
with self._threading_lock:
302304
gca_resource = deepcopy(self._gca_resource)

google/cloud/aiplatform/preview/pipelinejob/pipeline_jobs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def create_schedule(
9898
max_run_count (int):
9999
Optional. Maximum run count of the schedule.
100100
If specified, The schedule will be completed when either started_run_count >= max_run_count or when end_time is reached.
101+
Must be positive and <= 2^63-1.
101102
max_concurrent_run_count (int):
102103
Optional. Maximum number of runs that can be started concurrently for this PipelineJobSchedule.
103104
service_account (str):

google/cloud/aiplatform/preview/pipelinejobschedule/pipeline_job_schedules.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ def __init__(
104104
"parent": self._parent,
105105
"pipeline_job": {
106106
"runtime_config": runtime_config,
107-
"pipeline_spec": {"fields": pipeline_job.pipeline_spec},
107+
"pipeline_spec": pipeline_job.pipeline_spec,
108108
},
109109
}
110+
if "template_uri" in pipeline_job._gca_resource:
111+
create_pipeline_job_request["pipeline_job"][
112+
"template_uri"
113+
] = pipeline_job._gca_resource.template_uri
110114
pipeline_job_schedule_args = {
111115
"display_name": display_name,
112116
"create_pipeline_job_request": create_pipeline_job_request,
@@ -145,6 +149,7 @@ def create(
145149
max_run_count (int):
146150
Optional. Maximum run count of the schedule.
147151
If specified, The schedule will be completed when either started_run_count >= max_run_count or when end_time is reached.
152+
Must be positive and <= 2^63-1.
148153
max_concurrent_run_count (int):
149154
Optional. Maximum number of runs that can be started concurrently for this PipelineJobSchedule.
150155
service_account (str):
@@ -204,6 +209,7 @@ def _create(
204209
max_run_count (int):
205210
Optional. Maximum run count of the schedule.
206211
If specified, The schedule will be completed when either started_run_count >= max_run_count or when end_time is reached.
212+
Must be positive and <= 2^63-1.
207213
max_concurrent_run_count (int):
208214
Optional. Maximum number of runs that can be started concurrently for this PipelineJobSchedule.
209215
service_account (str):
@@ -402,6 +408,7 @@ def update(
402408
max_run_count (int):
403409
Optional. Maximum run count of the schedule.
404410
If specified, The schedule will be completed when either started_run_count >= max_run_count or when end_time is reached.
411+
Must be positive and <= 2^63-1.
405412
max_concurrent_run_count (int):
406413
Optional. Maximum number of runs that can be started concurrently for this PipelineJobSchedule.
407414

google/cloud/aiplatform/preview/schedule/schedules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def done(self) -> bool:
140140
return self.state in _SCHEDULE_COMPLETE_STATES
141141

142142
def wait(self) -> None:
143-
"""Wait for this Schedule to complete."""
143+
"""Wait for all runs scheduled by this Schedule to complete."""
144144
if self._latest_future is None:
145145
self._block_until_complete()
146146
else:

google/cloud/aiplatform/releases.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Use this file when you need to force a patch release with release-please.
22
Edit line 4 below with the version for the release.
33

4-
1.26.1
4+
1.27.1

google/cloud/aiplatform/tensorboard/uploader_tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def start_upload_tb_log(
111111
Args:
112112
tensorboard_experiment_name (str): Required. Name of this tensorboard
113113
experiment. Unique to the given
114-
projects/{project}/locations/{location}/tensorboards/{tensorboard_id}. If it's already set by
114+
projects/{project}/locations/{location}/tensorboards/{tensorboard_id}.
115115
logdir (str): Required. path of the log directory to upload
116116
tensorboard_id (str): Optional. TensorBoard ID. If not set, tensorboard_id in aiplatform.init will be used.
117117
project (str): Optional. Project the TensorBoard is in. If not set, project set in aiplatform.init will be used.

0 commit comments

Comments
 (0)