Skip to content

Commit 9a0eefb

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- 9cbc1c1 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: publish client batch config schema feat: publish new error reasons docs: fix documentation formatting docs: update various comments docs: update license year PiperOrigin-RevId: 889289393 Source-Link: googleapis/googleapis@94bc991 Source-Link: googleapis/googleapis-gen@db7143a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGI3MTQzYTMzOGE3Yzc1ODM5YjQ2OThjYjNlYTZmMTAxM2I0YzNjNyJ9 -- 3b3af56 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- ceb912e by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: docs: update API common type documentation PiperOrigin-RevId: 890591600 Source-Link: googleapis/googleapis@208f198 Source-Link: googleapis/googleapis-gen@b10e9b2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjEwZTliMjVlODdlYWJlMDA0NjZiN2Q1MWI1ZWU0NzQ4YzhjNjZjOCJ9 -- 41468f3 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 8308716 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Add container_spec to Reasoning Engine public protos PiperOrigin-RevId: 891815202 Source-Link: googleapis/googleapis@32f3753 Source-Link: googleapis/googleapis-gen@6c6cec7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmM2Y2VjNzAwZTIzN2FjNWNhNzEwMDRkNjM3NjAyZDllZTEwNzkzMCJ9 -- 4e3dffc by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md -- 2f8a57c by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Add container_spec to Reasoning Engine public protos PiperOrigin-RevId: 891818094 Source-Link: googleapis/googleapis@080b57f Source-Link: googleapis/googleapis-gen@0c98fb9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGM5OGZiOTMwNjZjZmFjNDA3N2M0NTNhNDk1Mjk1NjRlMDM3YjUxNCJ9 -- 0984e34 by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md COPYBARA_INTEGRATE_REVIEW=#6488 from googleapis:owl-bot-copy 5817b88 PiperOrigin-RevId: 892428213
1 parent 3502e7e commit 9a0eefb

12 files changed

Lines changed: 124 additions & 127 deletions

File tree

.kokoro/trampoline_v2.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
# To run this script, first download few files from gcs to /dev/shm.
2727
# (/dev/shm is passed into the container as KOKORO_GFILE_DIR).
2828
#
29-
# gcloud storage cp gs://cloud-devrel-kokoro-resources/python-docs-samples/secrets_viewer_service_account.json /dev/shm
30-
# gcloud storage cp gs://cloud-devrel-kokoro-resources/python-docs-samples/automl_secrets.txt /dev/shm
29+
# gsutil cp gs://cloud-devrel-kokoro-resources/python-docs-samples/secrets_viewer_service_account.json /dev/shm
30+
# gsutil cp gs://cloud-devrel-kokoro-resources/python-docs-samples/automl_secrets.txt /dev/shm
3131
#
3232
# Then run the script.
3333
# .kokoro/trampoline_v2.sh

google/cloud/aiplatform_v1/services/migration_service/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,40 +293,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
293293
@staticmethod
294294
def dataset_path(
295295
project: str,
296-
location: str,
297296
dataset: str,
298297
) -> str:
299298
"""Returns a fully-qualified dataset string."""
300-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
299+
return "projects/{project}/datasets/{dataset}".format(
301300
project=project,
302-
location=location,
303301
dataset=dataset,
304302
)
305303

306304
@staticmethod
307305
def parse_dataset_path(path: str) -> Dict[str, str]:
308306
"""Parses a dataset path into its component segments."""
309-
m = re.match(
310-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
311-
path,
312-
)
307+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
313308
return m.groupdict() if m else {}
314309

315310
@staticmethod
316311
def dataset_path(
317312
project: str,
313+
location: str,
318314
dataset: str,
319315
) -> str:
320316
"""Returns a fully-qualified dataset string."""
321-
return "projects/{project}/datasets/{dataset}".format(
317+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
322318
project=project,
319+
location=location,
323320
dataset=dataset,
324321
)
325322

326323
@staticmethod
327324
def parse_dataset_path(path: str) -> Dict[str, str]:
328325
"""Parses a dataset path into its component segments."""
329-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
326+
m = re.match(
327+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
328+
path,
329+
)
330330
return m.groupdict() if m else {}
331331

332332
@staticmethod

google/cloud/aiplatform_v1/types/reasoning_engine.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,23 @@
3838
class ReasoningEngineSpec(proto.Message):
3939
r"""ReasoningEngine configurations
4040
41+
This message has `oneof`_ fields (mutually exclusive fields).
42+
For each oneof, at most one member field can be set at the same time.
43+
Setting any member of the oneof automatically clears all other
44+
members.
45+
4146
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
4247
4348
Attributes:
4449
source_code_spec (google.cloud.aiplatform_v1.types.ReasoningEngineSpec.SourceCodeSpec):
4550
Deploy from source code files with a defined
4651
entrypoint.
4752
53+
This field is a member of `oneof`_ ``deployment_source``.
54+
container_spec (google.cloud.aiplatform_v1.types.ReasoningEngineSpec.ContainerSpec):
55+
Deploy from a container image with a defined
56+
entrypoint and commands.
57+
4858
This field is a member of `oneof`_ ``deployment_source``.
4959
service_account (str):
5060
Optional. The service account that the
@@ -390,12 +400,35 @@ class PythonSpec(proto.Message):
390400
message="ReasoningEngineSpec.SourceCodeSpec.ImageSpec",
391401
)
392402

403+
class ContainerSpec(proto.Message):
404+
r"""Specification for deploying from a container image.
405+
406+
Attributes:
407+
image_uri (str):
408+
Required. The Artifact Registry Docker image
409+
URI (e.g.,
410+
us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag)
411+
of the container image that is to be run on each
412+
worker replica.
413+
"""
414+
415+
image_uri: str = proto.Field(
416+
proto.STRING,
417+
number=1,
418+
)
419+
393420
source_code_spec: SourceCodeSpec = proto.Field(
394421
proto.MESSAGE,
395422
number=11,
396423
oneof="deployment_source",
397424
message=SourceCodeSpec,
398425
)
426+
container_spec: ContainerSpec = proto.Field(
427+
proto.MESSAGE,
428+
number=15,
429+
oneof="deployment_source",
430+
message=ContainerSpec,
431+
)
399432
service_account: str = proto.Field(
400433
proto.STRING,
401434
number=1,

google/cloud/aiplatform_v1beta1/services/migration_service/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,40 +271,40 @@ def parse_annotated_dataset_path(path: str) -> Dict[str, str]:
271271
@staticmethod
272272
def dataset_path(
273273
project: str,
274+
location: str,
274275
dataset: str,
275276
) -> str:
276277
"""Returns a fully-qualified dataset string."""
277-
return "projects/{project}/datasets/{dataset}".format(
278+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
278279
project=project,
280+
location=location,
279281
dataset=dataset,
280282
)
281283

282284
@staticmethod
283285
def parse_dataset_path(path: str) -> Dict[str, str]:
284286
"""Parses a dataset path into its component segments."""
285-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
287+
m = re.match(
288+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
289+
path,
290+
)
286291
return m.groupdict() if m else {}
287292

288293
@staticmethod
289294
def dataset_path(
290295
project: str,
291-
location: str,
292296
dataset: str,
293297
) -> str:
294298
"""Returns a fully-qualified dataset string."""
295-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
299+
return "projects/{project}/datasets/{dataset}".format(
296300
project=project,
297-
location=location,
298301
dataset=dataset,
299302
)
300303

301304
@staticmethod
302305
def parse_dataset_path(path: str) -> Dict[str, str]:
303306
"""Parses a dataset path into its component segments."""
304-
m = re.match(
305-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
306-
path,
307-
)
307+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
308308
return m.groupdict() if m else {}
309309

310310
@staticmethod

google/cloud/aiplatform_v1beta1/types/reasoning_engine.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,23 @@
4040
class ReasoningEngineSpec(proto.Message):
4141
r"""ReasoningEngine configurations
4242
43+
This message has `oneof`_ fields (mutually exclusive fields).
44+
For each oneof, at most one member field can be set at the same time.
45+
Setting any member of the oneof automatically clears all other
46+
members.
47+
4348
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
4449
4550
Attributes:
4651
source_code_spec (google.cloud.aiplatform_v1beta1.types.ReasoningEngineSpec.SourceCodeSpec):
4752
Deploy from source code files with a defined
4853
entrypoint.
4954
55+
This field is a member of `oneof`_ ``deployment_source``.
56+
container_spec (google.cloud.aiplatform_v1beta1.types.ReasoningEngineSpec.ContainerSpec):
57+
Deploy from a container image with a defined
58+
entrypoint and commands.
59+
5060
This field is a member of `oneof`_ ``deployment_source``.
5161
service_account (str):
5262
Optional. The service account that the
@@ -392,12 +402,35 @@ class PythonSpec(proto.Message):
392402
message="ReasoningEngineSpec.SourceCodeSpec.ImageSpec",
393403
)
394404

405+
class ContainerSpec(proto.Message):
406+
r"""Specification for deploying from a container image.
407+
408+
Attributes:
409+
image_uri (str):
410+
Required. The Artifact Registry Docker image
411+
URI (e.g.,
412+
us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag)
413+
of the container image that is to be run on each
414+
worker replica.
415+
"""
416+
417+
image_uri: str = proto.Field(
418+
proto.STRING,
419+
number=1,
420+
)
421+
395422
source_code_spec: SourceCodeSpec = proto.Field(
396423
proto.MESSAGE,
397424
number=11,
398425
oneof="deployment_source",
399426
message=SourceCodeSpec,
400427
)
428+
container_spec: ContainerSpec = proto.Field(
429+
proto.MESSAGE,
430+
number=15,
431+
oneof="deployment_source",
432+
message=ContainerSpec,
433+
)
401434
service_account: str = proto.Field(
402435
proto.STRING,
403436
number=1,

samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-aiplatform",
11-
"version": "1.143.0"
11+
"version": "0.0.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-aiplatform",
11-
"version": "1.143.0"
11+
"version": "0.0.0"
1212
},
1313
"snippets": [
1414
{

tests/unit/gapic/aiplatform_v1/test_migration_service.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5623,22 +5623,19 @@ def test_parse_dataset_path():
56235623

56245624
def test_dataset_path():
56255625
project = "squid"
5626-
location = "clam"
5627-
dataset = "whelk"
5628-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
5626+
dataset = "clam"
5627+
expected = "projects/{project}/datasets/{dataset}".format(
56295628
project=project,
5630-
location=location,
56315629
dataset=dataset,
56325630
)
5633-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
5631+
actual = MigrationServiceClient.dataset_path(project, dataset)
56345632
assert expected == actual
56355633

56365634

56375635
def test_parse_dataset_path():
56385636
expected = {
5639-
"project": "octopus",
5640-
"location": "oyster",
5641-
"dataset": "nudibranch",
5637+
"project": "whelk",
5638+
"dataset": "octopus",
56425639
}
56435640
path = MigrationServiceClient.dataset_path(**expected)
56445641

@@ -5648,19 +5645,22 @@ def test_parse_dataset_path():
56485645

56495646

56505647
def test_dataset_path():
5651-
project = "cuttlefish"
5652-
dataset = "mussel"
5653-
expected = "projects/{project}/datasets/{dataset}".format(
5648+
project = "oyster"
5649+
location = "nudibranch"
5650+
dataset = "cuttlefish"
5651+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
56545652
project=project,
5653+
location=location,
56555654
dataset=dataset,
56565655
)
5657-
actual = MigrationServiceClient.dataset_path(project, dataset)
5656+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
56585657
assert expected == actual
56595658

56605659

56615660
def test_parse_dataset_path():
56625661
expected = {
5663-
"project": "winkle",
5662+
"project": "mussel",
5663+
"location": "winkle",
56645664
"dataset": "nautilus",
56655665
}
56665666
path = MigrationServiceClient.dataset_path(**expected)

tests/unit/gapic/aiplatform_v1/test_reasoning_engine_service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4826,6 +4826,7 @@ def test_create_reasoning_engine_rest_call_success(request_type):
48264826
},
48274827
"image_spec": {"build_args": {}},
48284828
},
4829+
"container_spec": {"image_uri": "image_uri_value"},
48294830
"service_account": "service_account_value",
48304831
"package_spec": {
48314832
"pickle_object_gcs_uri": "pickle_object_gcs_uri_value",
@@ -5372,6 +5373,7 @@ def test_update_reasoning_engine_rest_call_success(request_type):
53725373
},
53735374
"image_spec": {"build_args": {}},
53745375
},
5376+
"container_spec": {"image_uri": "image_uri_value"},
53755377
"service_account": "service_account_value",
53765378
"package_spec": {
53775379
"pickle_object_gcs_uri": "pickle_object_gcs_uri_value",
@@ -6540,6 +6542,7 @@ async def test_create_reasoning_engine_rest_asyncio_call_success(request_type):
65406542
},
65416543
"image_spec": {"build_args": {}},
65426544
},
6545+
"container_spec": {"image_uri": "image_uri_value"},
65436546
"service_account": "service_account_value",
65446547
"package_spec": {
65456548
"pickle_object_gcs_uri": "pickle_object_gcs_uri_value",
@@ -7140,6 +7143,7 @@ async def test_update_reasoning_engine_rest_asyncio_call_success(request_type):
71407143
},
71417144
"image_spec": {"build_args": {}},
71427145
},
7146+
"container_spec": {"image_uri": "image_uri_value"},
71437147
"service_account": "service_account_value",
71447148
"package_spec": {
71457149
"pickle_object_gcs_uri": "pickle_object_gcs_uri_value",

tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5599,19 +5599,22 @@ def test_parse_annotated_dataset_path():
55995599

56005600
def test_dataset_path():
56015601
project = "cuttlefish"
5602-
dataset = "mussel"
5603-
expected = "projects/{project}/datasets/{dataset}".format(
5602+
location = "mussel"
5603+
dataset = "winkle"
5604+
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
56045605
project=project,
5606+
location=location,
56055607
dataset=dataset,
56065608
)
5607-
actual = MigrationServiceClient.dataset_path(project, dataset)
5609+
actual = MigrationServiceClient.dataset_path(project, location, dataset)
56085610
assert expected == actual
56095611

56105612

56115613
def test_parse_dataset_path():
56125614
expected = {
5613-
"project": "winkle",
5614-
"dataset": "nautilus",
5615+
"project": "nautilus",
5616+
"location": "scallop",
5617+
"dataset": "abalone",
56155618
}
56165619
path = MigrationServiceClient.dataset_path(**expected)
56175620

@@ -5621,22 +5624,19 @@ def test_parse_dataset_path():
56215624

56225625

56235626
def test_dataset_path():
5624-
project = "scallop"
5625-
location = "abalone"
5626-
dataset = "squid"
5627-
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
5627+
project = "squid"
5628+
dataset = "clam"
5629+
expected = "projects/{project}/datasets/{dataset}".format(
56285630
project=project,
5629-
location=location,
56305631
dataset=dataset,
56315632
)
5632-
actual = MigrationServiceClient.dataset_path(project, location, dataset)
5633+
actual = MigrationServiceClient.dataset_path(project, dataset)
56335634
assert expected == actual
56345635

56355636

56365637
def test_parse_dataset_path():
56375638
expected = {
5638-
"project": "clam",
5639-
"location": "whelk",
5639+
"project": "whelk",
56405640
"dataset": "octopus",
56415641
}
56425642
path = MigrationServiceClient.dataset_path(**expected)

0 commit comments

Comments
 (0)