Skip to content

Commit 4bcbb5b

Browse files
committed
feat(components): add support for persistent_resource_id in hyperparameter_tuning_job component
1 parent dc6ae51 commit 4bcbb5b

File tree

1 file changed

+3
-0
lines changed
  • components/google-cloud/google_cloud_pipeline_components/v1/hyperparameter_tuning_job

1 file changed

+3
-0
lines changed

components/google-cloud/google_cloud_pipeline_components/v1/hyperparameter_tuning_job/component.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def hyperparameter_tuning_job(
3939
encryption_spec_key_name: str = '',
4040
service_account: str = '',
4141
network: str = '',
42+
persistent_resource_id: str = _placeholders.PERSISTENT_RESOURCE_ID_PLACEHOLDER,
4243
project: str = _placeholders.PROJECT_ID_PLACEHOLDER,
4344
):
4445
# fmt: off
@@ -79,6 +80,7 @@ def hyperparameter_tuning_job(
7980
service_account: Specifies the service account for workload run-as account. Users submitting jobs must have act-as permission on this run-as account.
8081
network: The full name of the Compute Engine network to which the job should be peered. For example, `projects/12345/global/networks/myVPC`. Private services access must already be configured for the network. If left unspecified, the job is not peered with any network.
8182
project: Project to run the HyperparameterTuningJob in. Defaults to the project in which the PipelineJob is run.
83+
persistent_resource_id: The id of the PersistentResource in the same Project and Location which to run. The default value is a placeholder that will be resolved to the PipelineJob [RuntimeConfig](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.pipelineJobs#PipelineJob.RuntimeConfig)'s persistent resource id at runtime. However, if the PipelineJob doesn't set Persistent Resource as the job level runtime, the placedholder will be resolved to an empty string and the custom job will be run on demand. If this is specified, the job will be run on existing machines held by the PersistentResource instead of on-demand short-live machines. The network and CMEK configs on the job should be consistent with those on the PersistentResource, otherwise, the job will be rejected.
8284
8385
Returns:
8486
gcp_resources: Serialized JSON of `gcp_resources` [proto](https://github.com/kubeflow/pipelines/tree/master/components/google-cloud/google_cloud_pipeline_components/proto) which contains the GCP resource ID of the Hyperparameter Tuning job.
@@ -114,6 +116,7 @@ def hyperparameter_tuning_job(
114116
'base_output_directory': {
115117
'output_uri_prefix': base_output_directory
116118
},
119+
'persistent_resource_id': persistent_resource_id,
117120
},
118121
'encryption_spec': {'kms_key_name': encryption_spec_key_name},
119122
}),

0 commit comments

Comments
 (0)