0

I have a series of cloudbuild steps where i am uploading a pipeline to gcp kubeflow. now i want to run that pipeline in the next step. so for that i have written a python script, what i want it to run this python script in my next cloudbuild steps.

here is my python script

import kfp,
import os,

EXPERIMENT_NAME = 'Covertype_Classifier_Training',
RUN_ID = 'Run_001',
SOURCE_TABLE = 'covertype_dataset.covertype',
DATASET_ID = 'splits',
EVALUATION_METRIC = 'accuracy',
EVALUATION_METRIC_THRESHOLD = '0.69',
MODEL_ID = 'covertype_classifier',
VERSION_ID = 'v01',
REPLACE_EXISTING_VERSION = 'True',
ARTIFACT_STORE_URI = 'gs://hostedkfp-default-e8c59nl4zo',
GCS_STAGING_PATH = '{}/staging'.format(ARTIFACT_STORE_URI),
REGION = 'us-central1',
runname=testind,
params = {,
     EXPERIMENT_NAME:'Covertype_Classifier_Training',,
     project_id:'kkkkk',,
     gcs_root:gs://hostedkfp-default-e8c59nl4zo/staging,,
     region:us-central1,,
     source_table_name :covertype_dataset.covertype,,
     dataset_id :splits,,
     evaluation_metric_name:accuracy,,
     evaluation_metric_threshold:0.69,,
     model_id:covertype_classifier,,
     version_id:v01,,
     replace_existing_version:True,
    },
,
exp_id=Covertype_Classifier_Training_4,
client = kfp.Client(host=myhost),
pipelines = client.list_pipelines(),
total_pipeline = len(pipelines.pipelines),
pipeline_id=pipelines.pipelines[total_pipeline-1].id,
kfp.run_pipeline(experiment_id=exp_id, job_name=runname, pipeline_id=pipeline_id, params=params)


itroulli
  • 2,044
  • 1
  • 10
  • 21
  • 2
    https://stackoverflow.com/questions/55022058/running-python-unit-test-in-google-cloud-build This might help. – Chihiro Fujisaki Sep 12 '20 at 07:19
  • i tried this step., but it is giving this error "Step #4: docker.io/library/python:3.7 Step #4: /usr/local/bin/python: No module named pipeline.__main__; 'pipeline' is a package and cannot be directly executed" – abhinav jha Sep 12 '20 at 07:41
  • This error was discussed here https://stackoverflow.com/questions/62707250/unittest-works-locally-but-not-on-a-remote-server-no-module-named-x-main – Jaroslav Sep 14 '20 at 10:03
  • Can you share your Cloud Build pipeline? – guillaume blaquiere Oct 01 '20 at 19:06

0 Answers0