Skip to content

Commit 797f01d

Browse files
1 parent 6fa15c7 commit 797f01d

File tree

2,658 files changed

+607
-2204000
lines changed

Some content is hidden

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

2,658 files changed

+607
-2204000
lines changed

.github/release-trigger.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
enabled: true
2-
multiScmName: python-aiplatform

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -230,40 +230,40 @@ def parse_annotated_dataset_path(path: str) -> Dict[str, str]:
230230
@staticmethod
231231
def dataset_path(
232232
project: str,
233-
location: str,
234233
dataset: str,
235234
) -> str:
236235
"""Returns a fully-qualified dataset string."""
237-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
236+
return "projects/{project}/datasets/{dataset}".format(
238237
project=project,
239-
location=location,
240238
dataset=dataset,
241239
)
242240

243241
@staticmethod
244242
def parse_dataset_path(path: str) -> Dict[str, str]:
245243
"""Parses a dataset path into its component segments."""
246-
m = re.match(
247-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
248-
path,
249-
)
244+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
250245
return m.groupdict() if m else {}
251246

252247
@staticmethod
253248
def dataset_path(
254249
project: str,
250+
location: str,
255251
dataset: str,
256252
) -> str:
257253
"""Returns a fully-qualified dataset string."""
258-
return "projects/{project}/datasets/{dataset}".format(
254+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
259255
project=project,
256+
location=location,
260257
dataset=dataset,
261258
)
262259

263260
@staticmethod
264261
def parse_dataset_path(path: str) -> Dict[str, str]:
265262
"""Parses a dataset path into its component segments."""
266-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
263+
m = re.match(
264+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
265+
path,
266+
)
267267
return m.groupdict() if m else {}
268268

269269
@staticmethod

google/cloud/aiplatform_v1/services/schedule_service/async_client.py

+4
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ class ScheduleServiceAsyncClient:
105105
parse_pipeline_job_path = staticmethod(
106106
ScheduleServiceClient.parse_pipeline_job_path
107107
)
108+
reservation_path = staticmethod(ScheduleServiceClient.reservation_path)
109+
parse_reservation_path = staticmethod(ScheduleServiceClient.parse_reservation_path)
108110
schedule_path = staticmethod(ScheduleServiceClient.schedule_path)
109111
parse_schedule_path = staticmethod(ScheduleServiceClient.parse_schedule_path)
112+
subnetwork_path = staticmethod(ScheduleServiceClient.subnetwork_path)
113+
parse_subnetwork_path = staticmethod(ScheduleServiceClient.parse_subnetwork_path)
110114
common_billing_account_path = staticmethod(
111115
ScheduleServiceClient.common_billing_account_path
112116
)

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

+44
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,28 @@ def parse_pipeline_job_path(path: str) -> Dict[str, str]:
392392
)
393393
return m.groupdict() if m else {}
394394

395+
@staticmethod
396+
def reservation_path(
397+
project_id_or_number: str,
398+
zone: str,
399+
reservation_name: str,
400+
) -> str:
401+
"""Returns a fully-qualified reservation string."""
402+
return "projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}".format(
403+
project_id_or_number=project_id_or_number,
404+
zone=zone,
405+
reservation_name=reservation_name,
406+
)
407+
408+
@staticmethod
409+
def parse_reservation_path(path: str) -> Dict[str, str]:
410+
"""Parses a reservation path into its component segments."""
411+
m = re.match(
412+
r"^projects/(?P<project_id_or_number>.+?)/zones/(?P<zone>.+?)/reservations/(?P<reservation_name>.+?)$",
413+
path,
414+
)
415+
return m.groupdict() if m else {}
416+
395417
@staticmethod
396418
def schedule_path(
397419
project: str,
@@ -414,6 +436,28 @@ def parse_schedule_path(path: str) -> Dict[str, str]:
414436
)
415437
return m.groupdict() if m else {}
416438

439+
@staticmethod
440+
def subnetwork_path(
441+
project: str,
442+
region: str,
443+
subnetwork: str,
444+
) -> str:
445+
"""Returns a fully-qualified subnetwork string."""
446+
return "projects/{project}/regions/{region}/subnetworks/{subnetwork}".format(
447+
project=project,
448+
region=region,
449+
subnetwork=subnetwork,
450+
)
451+
452+
@staticmethod
453+
def parse_subnetwork_path(path: str) -> Dict[str, str]:
454+
"""Parses a subnetwork path into its component segments."""
455+
m = re.match(
456+
r"^projects/(?P<project>.+?)/regions/(?P<region>.+?)/subnetworks/(?P<subnetwork>.+?)$",
457+
path,
458+
)
459+
return m.groupdict() if m else {}
460+
417461
@staticmethod
418462
def common_billing_account_path(
419463
billing_account: str,

google/cloud/aiplatform_v1/types/notebook_execution_job.py

+44
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec
2323
from google.cloud.aiplatform_v1.types import job_state as gca_job_state
24+
from google.cloud.aiplatform_v1.types import machine_resources
25+
from google.cloud.aiplatform_v1.types import network_spec as gca_network_spec
2426
from google.protobuf import duration_pb2 # type: ignore
2527
from google.protobuf import timestamp_pb2 # type: ignore
2628
from google.rpc import status_pb2 # type: ignore
@@ -64,6 +66,11 @@ class NotebookExecutionJob(proto.Message):
6466
The NotebookRuntimeTemplate to source compute
6567
configuration from.
6668
69+
This field is a member of `oneof`_ ``environment_spec``.
70+
custom_environment_spec (google.cloud.aiplatform_v1.types.NotebookExecutionJob.CustomEnvironmentSpec):
71+
The custom compute configuration for an
72+
execution job.
73+
6774
This field is a member of `oneof`_ ``environment_spec``.
6875
gcs_output_uri (str):
6976
The Cloud Storage location to upload the result to. Format:
@@ -186,6 +193,37 @@ class DirectNotebookSource(proto.Message):
186193
number=1,
187194
)
188195

196+
class CustomEnvironmentSpec(proto.Message):
197+
r"""Compute configuration to use for an execution job.
198+
199+
Attributes:
200+
machine_spec (google.cloud.aiplatform_v1.types.MachineSpec):
201+
The specification of a single machine for the
202+
execution job.
203+
persistent_disk_spec (google.cloud.aiplatform_v1.types.PersistentDiskSpec):
204+
The specification of a persistent disk to
205+
attach for the execution job.
206+
network_spec (google.cloud.aiplatform_v1.types.NetworkSpec):
207+
The network configuration to use for the
208+
execution job.
209+
"""
210+
211+
machine_spec: machine_resources.MachineSpec = proto.Field(
212+
proto.MESSAGE,
213+
number=1,
214+
message=machine_resources.MachineSpec,
215+
)
216+
persistent_disk_spec: machine_resources.PersistentDiskSpec = proto.Field(
217+
proto.MESSAGE,
218+
number=2,
219+
message=machine_resources.PersistentDiskSpec,
220+
)
221+
network_spec: gca_network_spec.NetworkSpec = proto.Field(
222+
proto.MESSAGE,
223+
number=3,
224+
message=gca_network_spec.NetworkSpec,
225+
)
226+
189227
dataform_repository_source: DataformRepositorySource = proto.Field(
190228
proto.MESSAGE,
191229
number=3,
@@ -209,6 +247,12 @@ class DirectNotebookSource(proto.Message):
209247
number=14,
210248
oneof="environment_spec",
211249
)
250+
custom_environment_spec: CustomEnvironmentSpec = proto.Field(
251+
proto.MESSAGE,
252+
number=16,
253+
oneof="environment_spec",
254+
message=CustomEnvironmentSpec,
255+
)
212256
gcs_output_uri: str = proto.Field(
213257
proto.STRING,
214258
number=8,

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -252,40 +252,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
252252
@staticmethod
253253
def dataset_path(
254254
project: str,
255+
location: str,
255256
dataset: str,
256257
) -> str:
257258
"""Returns a fully-qualified dataset string."""
258-
return "projects/{project}/datasets/{dataset}".format(
259+
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
259260
project=project,
261+
location=location,
260262
dataset=dataset,
261263
)
262264

263265
@staticmethod
264266
def parse_dataset_path(path: str) -> Dict[str, str]:
265267
"""Parses a dataset path into its component segments."""
266-
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
268+
m = re.match(
269+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
270+
path,
271+
)
267272
return m.groupdict() if m else {}
268273

269274
@staticmethod
270275
def dataset_path(
271276
project: str,
272-
location: str,
273277
dataset: str,
274278
) -> str:
275279
"""Returns a fully-qualified dataset string."""
276-
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
280+
return "projects/{project}/datasets/{dataset}".format(
277281
project=project,
278-
location=location,
279282
dataset=dataset,
280283
)
281284

282285
@staticmethod
283286
def parse_dataset_path(path: str) -> Dict[str, str]:
284287
"""Parses a dataset path into its component segments."""
285-
m = re.match(
286-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
287-
path,
288-
)
288+
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
289289
return m.groupdict() if m else {}
290290

291291
@staticmethod

google/cloud/aiplatform_v1beta1/services/schedule_service/async_client.py

+2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ class ScheduleServiceAsyncClient:
136136
parse_reservation_path = staticmethod(ScheduleServiceClient.parse_reservation_path)
137137
schedule_path = staticmethod(ScheduleServiceClient.schedule_path)
138138
parse_schedule_path = staticmethod(ScheduleServiceClient.parse_schedule_path)
139+
subnetwork_path = staticmethod(ScheduleServiceClient.subnetwork_path)
140+
parse_subnetwork_path = staticmethod(ScheduleServiceClient.parse_subnetwork_path)
139141
common_billing_account_path = staticmethod(
140142
ScheduleServiceClient.common_billing_account_path
141143
)

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

+22
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,28 @@ def parse_schedule_path(path: str) -> Dict[str, str]:
571571
)
572572
return m.groupdict() if m else {}
573573

574+
@staticmethod
575+
def subnetwork_path(
576+
project: str,
577+
region: str,
578+
subnetwork: str,
579+
) -> str:
580+
"""Returns a fully-qualified subnetwork string."""
581+
return "projects/{project}/regions/{region}/subnetworks/{subnetwork}".format(
582+
project=project,
583+
region=region,
584+
subnetwork=subnetwork,
585+
)
586+
587+
@staticmethod
588+
def parse_subnetwork_path(path: str) -> Dict[str, str]:
589+
"""Parses a subnetwork path into its component segments."""
590+
m = re.match(
591+
r"^projects/(?P<project>.+?)/regions/(?P<region>.+?)/subnetworks/(?P<subnetwork>.+?)$",
592+
path,
593+
)
594+
return m.groupdict() if m else {}
595+
574596
@staticmethod
575597
def common_billing_account_path(
576598
billing_account: str,

google/cloud/aiplatform_v1beta1/types/notebook_execution_job.py

+44
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
from google.cloud.aiplatform_v1beta1.types import encryption_spec as gca_encryption_spec
2323
from google.cloud.aiplatform_v1beta1.types import job_state as gca_job_state
24+
from google.cloud.aiplatform_v1beta1.types import machine_resources
25+
from google.cloud.aiplatform_v1beta1.types import network_spec as gca_network_spec
2426
from google.protobuf import duration_pb2 # type: ignore
2527
from google.protobuf import timestamp_pb2 # type: ignore
2628
from google.rpc import status_pb2 # type: ignore
@@ -64,6 +66,11 @@ class NotebookExecutionJob(proto.Message):
6466
The NotebookRuntimeTemplate to source compute
6567
configuration from.
6668
69+
This field is a member of `oneof`_ ``environment_spec``.
70+
custom_environment_spec (google.cloud.aiplatform_v1beta1.types.NotebookExecutionJob.CustomEnvironmentSpec):
71+
The custom compute configuration for an
72+
execution job.
73+
6774
This field is a member of `oneof`_ ``environment_spec``.
6875
gcs_output_uri (str):
6976
The Cloud Storage location to upload the result to. Format:
@@ -186,6 +193,37 @@ class DirectNotebookSource(proto.Message):
186193
number=1,
187194
)
188195

196+
class CustomEnvironmentSpec(proto.Message):
197+
r"""Compute configuration to use for an execution job.
198+
199+
Attributes:
200+
machine_spec (google.cloud.aiplatform_v1beta1.types.MachineSpec):
201+
The specification of a single machine for the
202+
execution job.
203+
persistent_disk_spec (google.cloud.aiplatform_v1beta1.types.PersistentDiskSpec):
204+
The specification of a persistent disk to
205+
attach for the execution job.
206+
network_spec (google.cloud.aiplatform_v1beta1.types.NetworkSpec):
207+
The network configuration to use for the
208+
execution job.
209+
"""
210+
211+
machine_spec: machine_resources.MachineSpec = proto.Field(
212+
proto.MESSAGE,
213+
number=1,
214+
message=machine_resources.MachineSpec,
215+
)
216+
persistent_disk_spec: machine_resources.PersistentDiskSpec = proto.Field(
217+
proto.MESSAGE,
218+
number=2,
219+
message=machine_resources.PersistentDiskSpec,
220+
)
221+
network_spec: gca_network_spec.NetworkSpec = proto.Field(
222+
proto.MESSAGE,
223+
number=3,
224+
message=gca_network_spec.NetworkSpec,
225+
)
226+
189227
dataform_repository_source: DataformRepositorySource = proto.Field(
190228
proto.MESSAGE,
191229
number=3,
@@ -209,6 +247,12 @@ class DirectNotebookSource(proto.Message):
209247
number=14,
210248
oneof="environment_spec",
211249
)
250+
custom_environment_spec: CustomEnvironmentSpec = proto.Field(
251+
proto.MESSAGE,
252+
number=16,
253+
oneof="environment_spec",
254+
message=CustomEnvironmentSpec,
255+
)
212256
gcs_output_uri: str = proto.Field(
213257
proto.STRING,
214258
number=8,

0 commit comments

Comments
 (0)