Skip to content

Commit 00440f7

Browse files
TheMichaelHuGoogle Cloud Pipeline Components maintainers
authored andcommitted
fix(components): Add staging and temp locations to prophet trainer component
Signed-off-by: Michael Hu <humichael@google.com> PiperOrigin-RevId: 631958163
1 parent 5d9f4ab commit 00440f7

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

components/google-cloud/RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Upcoming release
22

33
## Release 2.15.0
4+
* Add staging and temp location parameters to prophet trainer component.
45
* Add input parameter `autorater_prompt_parameters` to `_implementation.llm.online_evaluation_pairwise` component.
56
* Mitigate bug in `v1.model_evaluation.autosxs_pipeline` where batch prediction would fail the first time it is run in a project by retrying.
67

components/google-cloud/google_cloud_pipeline_components/v1/automl/forecasting/prophet_predict_pipeline.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ deploymentSpec:
14611461
\ = client.create_dataset(dataset=dataset, exists_ok=exists_ok)\n return\
14621462
\ collections.namedtuple('Outputs', ['project_id', 'dataset_id'])(\n \
14631463
\ ref.project, ref.dataset_id)\n\n"
1464-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1464+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
14651465
exec-bigquery-delete-dataset-with-prefix:
14661466
container:
14671467
args:
@@ -1495,7 +1495,7 @@ deploymentSpec:
14951495
\ if dataset.dataset_id.startswith(dataset_prefix):\n client.delete_dataset(\n\
14961496
\ dataset=dataset.dataset_id,\n delete_contents=delete_contents)\n\
14971497
\n"
1498-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1498+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
14991499
exec-bigquery-query-job:
15001500
container:
15011501
args:
@@ -1583,7 +1583,7 @@ deploymentSpec:
15831583
\ 'datasetId': dataset_id,\n 'tableId': table_id,\n }\n\
15841584
\ if write_disposition:\n config['write_disposition'] = write_disposition\n\
15851585
\ return config\n\n"
1586-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1586+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
15871587
exec-build-job-configuration-query-2:
15881588
container:
15891589
args:
@@ -1617,7 +1617,7 @@ deploymentSpec:
16171617
\ 'datasetId': dataset_id,\n 'tableId': table_id,\n }\n\
16181618
\ if write_disposition:\n config['write_disposition'] = write_disposition\n\
16191619
\ return config\n\n"
1620-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1620+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
16211621
exec-get-first-valid:
16221622
container:
16231623
args:
@@ -1641,7 +1641,7 @@ deploymentSpec:
16411641
\ import json\n # pylint: enable=g-import-not-at-top,import-outside-toplevel,redefined-outer-name,reimported\n\
16421642
\n for value in json.loads(values):\n if value:\n return value\n\
16431643
\ raise ValueError('No valid values.')\n\n"
1644-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1644+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
16451645
exec-get-table-location:
16461646
container:
16471647
args:
@@ -1677,7 +1677,7 @@ deploymentSpec:
16771677
\ if table.startswith('bq://'):\n table = table[len('bq://'):]\n elif\
16781678
\ table.startswith('bigquery://'):\n table = table[len('bigquery://'):]\n\
16791679
\ return client.get_table(table).location\n\n"
1680-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1680+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
16811681
exec-get-table-location-2:
16821682
container:
16831683
args:
@@ -1713,7 +1713,7 @@ deploymentSpec:
17131713
\ if table.startswith('bq://'):\n table = table[len('bq://'):]\n elif\
17141714
\ table.startswith('bigquery://'):\n table = table[len('bigquery://'):]\n\
17151715
\ return client.get_table(table).location\n\n"
1716-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1716+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
17171717
exec-load-table-from-uri:
17181718
container:
17191719
args:
@@ -1754,7 +1754,7 @@ deploymentSpec:
17541754
\ source_format=source_format)\n client.load_table_from_uri(\n source_uris=csv_list,\n\
17551755
\ destination=destination,\n project=project,\n location=location,\n\
17561756
\ job_config=job_config).result()\n return destination\n\n"
1757-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1757+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
17581758
exec-make-vertex-model-artifact:
17591759
container:
17601760
args:
@@ -1778,7 +1778,7 @@ deploymentSpec:
17781778
Creates a google.VertexModel artifact.\"\"\"\n vertex_model.metadata =\
17791779
\ {'resourceName': model_resource_name}\n vertex_model.uri = (f'https://{location}-aiplatform.googleapis.com'\n\
17801780
\ f'/v1/{model_resource_name}')\n\n"
1781-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1781+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
17821782
exec-maybe-replace-with-default:
17831783
container:
17841784
args:
@@ -1800,7 +1800,7 @@ deploymentSpec:
18001800
\ *\n\ndef maybe_replace_with_default(value: str, default: str = '') ->\
18011801
\ str:\n \"\"\"Replaces string with another value if it is a dash.\"\"\"\
18021802
\n return default if not value else value\n\n"
1803-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1803+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
18041804
exec-model-batch-predict:
18051805
container:
18061806
args:
@@ -1879,7 +1879,7 @@ deploymentSpec:
18791879
\ if use_bq_prefix:\n bq_uri = 'bq://' + bq_uri\n outputs.append(bq_uri)\n\
18801880
\ return collections.namedtuple(\n 'Outputs',\n ['project_id',\
18811881
\ 'dataset_id', 'table_id', 'uri'],\n )(*outputs)\n\n"
1882-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1882+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
18831883
exec-table-to-uri-2:
18841884
container:
18851885
args:
@@ -1909,7 +1909,7 @@ deploymentSpec:
19091909
\ if use_bq_prefix:\n bq_uri = 'bq://' + bq_uri\n outputs.append(bq_uri)\n\
19101910
\ return collections.namedtuple(\n 'Outputs',\n ['project_id',\
19111911
\ 'dataset_id', 'table_id', 'uri'],\n )(*outputs)\n\n"
1912-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
1912+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
19131913
exec-validate-inputs:
19141914
container:
19151915
args:
@@ -2005,7 +2005,7 @@ deploymentSpec:
20052005
\ raise ValueError(\n 'Granularity unit should be one of the\
20062006
\ following: '\n f'{valid_data_granularity_units}, got: {data_granularity_unit}.')\n\
20072007
\n"
2008-
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240214_1325
2008+
image: us-docker.pkg.dev/vertex-ai/automl-tabular/kfp-v2-base:20240419_0625
20092009
pipelineInfo:
20102010
description: Creates a batch prediction using a Prophet model.
20112011
name: prophet-predict

components/google-cloud/google_cloud_pipeline_components/v1/automl/forecasting/prophet_trainer.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ def prophet_trainer(
180180
'--dataflow_use_public_ips=',
181181
dataflow_use_public_ips,
182182
'", "',
183+
'--dataflow_staging_dir=',
184+
root_dir,
185+
(
186+
f'/{dsl.PIPELINE_JOB_ID_PLACEHOLDER}/{dsl.PIPELINE_TASK_ID_PLACEHOLDER}/dataflow_staging", "'
187+
),
188+
'--dataflow_tmp_dir=',
189+
root_dir,
190+
(
191+
f'/{dsl.PIPELINE_JOB_ID_PLACEHOLDER}/{dsl.PIPELINE_TASK_ID_PLACEHOLDER}/dataflow_tmp", "'
192+
),
183193
'--gcp_resources_path=',
184194
gcp_resources,
185195
'", "',

components/google-cloud/google_cloud_pipeline_components/v1/automl/forecasting/prophet_trainer_pipeline.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,10 @@ deploymentSpec:
24182418
"\", \"", "--dataflow_service_account=", "{{$.inputs.parameters[''dataflow_service_account'']}}",
24192419
"\", \"", "--dataflow_subnetwork=", "{{$.inputs.parameters[''dataflow_subnetwork'']}}",
24202420
"\", \"", "--dataflow_use_public_ips=", "{{$.inputs.parameters[''dataflow_use_public_ips'']}}",
2421-
"\", \"", "--gcp_resources_path=", "{{$.outputs.parameters[''gcp_resources''].output_file}}",
2421+
"\", \"", "--dataflow_staging_dir=", "{{$.inputs.parameters[''root_dir'']}}",
2422+
"/{{$.pipeline_job_uuid}}/{{$.pipeline_task_uuid}}/dataflow_staging\", \"",
2423+
"--dataflow_tmp_dir=", "{{$.inputs.parameters[''root_dir'']}}", "/{{$.pipeline_job_uuid}}/{{$.pipeline_task_uuid}}/dataflow_tmp\",
2424+
\"", "--gcp_resources_path=", "{{$.outputs.parameters[''gcp_resources''].output_file}}",
24222425
"\", \"", "--executor_input={{$.json_escape[1]}}\"]}}]}}"]}'
24232426
command:
24242427
- python3

0 commit comments

Comments
 (0)