From 04d600b2d36405f34799306c5d24287c75e31595 Mon Sep 17 00:00:00 2001 From: Chen Sun Date: Tue, 29 Oct 2024 11:51:53 -0700 Subject: [PATCH] fix(components): Fix create_custom_training_job_from_component default location Signed-off-by: Chen Sun PiperOrigin-RevId: 691105600 --- components/google-cloud/RELEASE.md | 1 + .../v1/custom_job/component.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/google-cloud/RELEASE.md b/components/google-cloud/RELEASE.md index 3cc17345d65..3d7f7727617 100644 --- a/components/google-cloud/RELEASE.md +++ b/components/google-cloud/RELEASE.md @@ -2,6 +2,7 @@ * Remove default prediction column names in `v1.model_evaluation.regression_component` component to fix pipeline errors when using bigquery data source. * Add reservation_affinition support in `v1.create_custom_training_job_from_component`. * Deprecate `preview.custom_job` module. +* Fix default location in `v1.create_custom_training_job_from_component`. ## Release 2.17.0 * Fix Gemini batch prediction support to `v1.model_evaluation.autosxs_pipeline` after output schema change. diff --git a/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/component.py b/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/component.py index 4ef6e0afc00..7063c189d26 100644 --- a/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/component.py +++ b/components/google-cloud/google_cloud_pipeline_components/v1/custom_job/component.py @@ -24,7 +24,7 @@ def custom_training_job( display_name: str, gcp_resources: dsl.OutputPath(str), - location: str = 'us-central1', + location: str = _placeholders.LOCATION_PLACEHOLDER, worker_pool_specs: List[Dict[str, str]] = [], timeout: str = '604800s', restart_job_on_worker_restart: bool = False, @@ -43,7 +43,7 @@ def custom_training_job( """Launch a Vertex AI [custom training job](https://cloud.google.com/vertex-ai/docs/training/create-custom-job) using the [CustomJob](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.customJobs) API. See [Create custom training jobs ](https://cloud.google.com/vertex-ai/docs/training/create-custom-job) for more information. Args: - location: Location for creating the custom training job. If not set, default to us-central1. + location: Location for creating the custom training job. If not set, default to the location where the PipelineJob is run. display_name: The name of the CustomJob. worker_pool_specs: Serialized json spec of the worker pools including machine type and Docker image. All worker pools except the first one are optional and can be skipped by providing an empty value. See [more information](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/CustomJobSpec#WorkerPoolSpec). timeout: The maximum job running time. The default is 7 days. A duration in seconds with up to nine fractional digits, terminated by 's', for example: "3.5s".