Compare commits

...
Author SHA1 Message Date
Andrew Ferlitsch f09872155c port: kfp2 2023-10-02 22:54:12 +00:00
@@ -152,8 +152,8 @@
"source": [
"! pip3 install --upgrade --quiet google-cloud-aiplatform \\\n",
" google-cloud-storage \\\n",
" 'kfp<2' \\\n",
" 'google-cloud-pipeline-components<2'"
" kfp \\\n",
" google-cloud-pipeline-components"
]
},
{
@@ -379,7 +379,7 @@
},
"outputs": [],
"source": [
"! gsutil mb -l $REGION -p $PROJECT_ID $BUCKET_URI"
"! gsutil mb -l {REGION} -p {PROJECT_ID} {BUCKET_URI}"
]
},
{
@@ -556,15 +556,18 @@
"\n",
"@kfp.dsl.pipeline(name=\"automl-tab-training-v2\")\n",
"def pipeline(project: str = PROJECT_ID, region: str = REGION):\n",
" from google_cloud_pipeline_components import aiplatform as gcc_aip\n",
" from google_cloud_pipeline_components.v1.automl.training_job import \\\n",
" AutoMLTabularTrainingJobRunOp\n",
" from google_cloud_pipeline_components.v1.dataset import \\\n",
" TabularDatasetCreateOp\n",
" from google_cloud_pipeline_components.v1.endpoint import (EndpointCreateOp,\n",
" ModelDeployOp)\n",
"\n",
" dataset_create_op = gcc_aip.TabularDatasetCreateOp(\n",
" dataset_create_op = TabularDatasetCreateOp(\n",
" project=project, display_name=\"housing\", gcs_source=gcs_csv_path\n",
" )\n",
"\n",
" training_op = gcc_aip.AutoMLTabularTrainingJobRunOp(\n",
" training_op = AutoMLTabularTrainingJobRunOp(\n",
" project=project,\n",
" display_name=\"train-automl-cal_housing\",\n",
" optimization_prediction_type=\"regression\",\n",
@@ -622,7 +625,7 @@
"\n",
"compiler.Compiler().compile(\n",
" pipeline_func=pipeline,\n",
" package_path=\"tabular_regression_pipeline.json\",\n",
" package_path=\"tabular_regression_pipeline.yaml\",\n",
")"
]
},
@@ -649,14 +652,14 @@
"\n",
"job = aip.PipelineJob(\n",
" display_name=DISPLAY_NAME,\n",
" template_path=\"tabular_regression_pipeline.json\",\n",
" template_path=\"tabular_regression_pipeline.yaml\",\n",
" pipeline_root=PIPELINE_ROOT,\n",
" enable_caching=False,\n",
")\n",
"\n",
"job.run()\n",
"\n",
"! rm tabular_regression_pipeline.json"
"! rm tabular_regression_pipeline.yaml"
]
},
{