diff --git a/samples/WIP-REMOVEME b/samples/WIP-REMOVEME new file mode 100644 index 000000000000..620ab84337e7 --- /dev/null +++ b/samples/WIP-REMOVEME @@ -0,0 +1,4 @@ +REMOVE BEFORE MERGING + +Just to trigger the samples-v2 CI Check + diff --git a/sdk/python/kfp/deprecated/_client.py b/sdk/python/kfp/deprecated/_client.py index 5d57dfe7825e..b67c60863e6c 100644 --- a/sdk/python/kfp/deprecated/_client.py +++ b/sdk/python/kfp/deprecated/_client.py @@ -393,7 +393,7 @@ def set_user_namespace(self, namespace: str): with open(Client.LOCAL_KFP_CONTEXT, 'w') as f: json.dump(self._context_setting, f) - def get_kfp_healthz(self) -> kfp_server_api.ApiGetHealthzResponse: + def get_kfp_healthz(self) -> kfp_server_api.V2beta1GetHealthzResponse: """Gets healthz info of KFP deployment. Returns: @@ -431,7 +431,7 @@ def create_experiment( self, name: str, description: str = None, - namespace: str = None) -> kfp_server_api.ApiExperiment: + namespace: str = None) -> kfp_server_api.V2beta1Experiment: """Create a new experiment. Args: @@ -515,7 +515,7 @@ def list_experiments( sort_by: str = '', namespace: Optional[str] = None, filter: Optional[str] = None - ) -> kfp_server_api.ApiListExperimentsResponse: + ) -> kfp_server_api.V2beta1ListExperimentsResponse: """List experiments. Args: @@ -557,7 +557,7 @@ def list_experiments( def get_experiment(self, experiment_id=None, experiment_name=None, - namespace=None) -> kfp_server_api.ApiExperiment: + namespace=None) -> kfp_server_api.V2beta1Experiment: """Get details of an experiment. Either experiment_id or experiment_name is required @@ -685,7 +685,7 @@ def list_pipelines( page_size: int = 10, sort_by: str = '', filter: Optional[str] = None - ) -> kfp_server_api.ApiListPipelinesResponse: + ) -> kfp_server_api.V2beta1ListPipelinesResponse: """List pipelines. Args: @@ -728,7 +728,7 @@ def run_pipeline( pipeline_root: Optional[str] = None, enable_caching: Optional[str] = None, service_account: Optional[str] = None, - ) -> kfp_server_api.ApiRun: + ) -> kfp_server_api.V2beta1Run: """Run a specified pipeline. Args: @@ -805,7 +805,7 @@ def create_recurring_run( enabled: bool = True, enable_caching: Optional[bool] = None, service_account: Optional[str] = None, - ) -> kfp_server_api.ApiJob: + ) -> kfp_server_api.V2beta1RecurringRun: """Create a recurring run. Args: @@ -935,7 +935,7 @@ def __init__(self, spec, resource_references): pipeline_json_string = json.dumps(pipeline_obj) api_params = [ - kfp_server_api.ApiParameter( + kfp_server_api.Parameter( name=sanitize_k8s_name(name=k, allow_capital_underscore=True), value=str(v) if type(v) not in (list, dict) else json.dumps(v)) for k, v in params.items() @@ -1167,7 +1167,7 @@ def list_runs( sort_by: str = '', experiment_id: Optional[str] = None, namespace: Optional[str] = None, - filter: Optional[str] = None) -> kfp_server_api.ApiListRunsResponse: + filter: Optional[str] = None) -> kfp_server_api.V2beta1ListRunsResponse: """List runs, optionally can be filtered by experiment or namespace. Args: @@ -1229,7 +1229,7 @@ def list_recurring_runs( page_size: int = 10, sort_by: str = '', experiment_id: Optional[str] = None, - filter: Optional[str] = None) -> kfp_server_api.ApiListJobsResponse: + filter: Optional[str] = None) -> kfp_server_api.V2beta1ListRecurringRunsResponse: """List recurring runs. Args: @@ -1272,7 +1272,7 @@ def list_recurring_runs( filter=filter) return response - def get_recurring_run(self, job_id: str) -> kfp_server_api.ApiJob: + def get_recurring_run(self, job_id: str) -> kfp_server_api.V2beta1RecurringRun: """Get recurring_run details. Args: @@ -1286,7 +1286,7 @@ def get_recurring_run(self, job_id: str) -> kfp_server_api.ApiJob: """ return self._job_api.get_job(id=job_id) - def get_run(self, run_id: str) -> kfp_server_api.ApiRun: + def get_run(self, run_id: str) -> kfp_server_api.V2beta1Run: """Get run details. Args: @@ -1360,7 +1360,7 @@ def upload_pipeline( pipeline_package_path: str = None, pipeline_name: str = None, description: str = None, - ) -> kfp_server_api.ApiPipeline: + ) -> kfp_server_api.V2beta1Pipeline: """Uploads the pipeline to the Kubeflow Pipelines cluster. Args: @@ -1388,7 +1388,7 @@ def upload_pipeline_version( pipeline_id: Optional[str] = None, pipeline_name: Optional[str] = None, description: Optional[str] = None, - ) -> kfp_server_api.ApiPipelineVersion: + ) -> kfp_server_api.V2beta1PipelineVersion: """Uploads a new version of the pipeline to the Kubeflow Pipelines cluster. @@ -1439,7 +1439,7 @@ def upload_pipeline_version( IPython.display.display(IPython.display.HTML(html)) return response - def get_pipeline(self, pipeline_id: str) -> kfp_server_api.ApiPipeline: + def get_pipeline(self, pipeline_id: str) -> kfp_server_api.V2beta1Pipeline: """Get pipeline details. Args: @@ -1474,7 +1474,7 @@ def list_pipeline_versions( page_size: int = 10, sort_by: str = '', filter: Optional[str] = None - ) -> kfp_server_api.ApiListPipelineVersionsResponse: + ) -> kfp_server_api.V2beta1ListPipelineVersionsResponse: """Lists pipeline versions. Args: diff --git a/sdk/python/kfp/deprecated/cli/experiment.py b/sdk/python/kfp/deprecated/cli/experiment.py index 543f66c584fd..5e9a385801ff 100644 --- a/sdk/python/kfp/deprecated/cli/experiment.py +++ b/sdk/python/kfp/deprecated/cli/experiment.py @@ -4,7 +4,7 @@ from kfp.deprecated.cli.output import print_output, OutputFormat import kfp_server_api -from kfp_server_api.models.api_experiment import ApiExperiment +from kfp_server_api.models.v2beta1_experiment import V2beta1Experiment @click.group() @@ -93,7 +93,7 @@ def delete(ctx: click.Context, experiment_id: str): click.echo("{} is deleted.".format(experiment_id)) -def _display_experiments(experiments: List[ApiExperiment], +def _display_experiments(experiments: List[V2beta1Experiment], output_format: OutputFormat): headers = ["Experiment ID", "Name", "Created at"] data = [ @@ -102,7 +102,7 @@ def _display_experiments(experiments: List[ApiExperiment], print_output(data, headers, output_format, table_format="grid") -def _display_experiment(exp: kfp_server_api.ApiExperiment, +def _display_experiment(exp: kfp_server_api.V2beta1Experiment, output_format: OutputFormat): table = [ ["ID", exp.id], diff --git a/sdk/python/kfp/deprecated/cli/pipeline.py b/sdk/python/kfp/deprecated/cli/pipeline.py index 2d03f7b1893d..1e68c4eb63f8 100644 --- a/sdk/python/kfp/deprecated/cli/pipeline.py +++ b/sdk/python/kfp/deprecated/cli/pipeline.py @@ -197,7 +197,7 @@ def delete(ctx: click.Context, pipeline_id: str): click.echo(f"{pipeline_id} is deleted") -def _print_pipelines(pipelines: List[kfp_server_api.ApiPipeline], +def _print_pipelines(pipelines: List[kfp_server_api.V2beta1Pipeline], output_format: OutputFormat): headers = ["Pipeline ID", "Name", "Uploaded at"] data = [[pipeline.id, pipeline.name, @@ -205,7 +205,7 @@ def _print_pipelines(pipelines: List[kfp_server_api.ApiPipeline], print_output(data, headers, output_format, table_format="grid") -def _print_pipeline_versions(versions: List[kfp_server_api.ApiPipelineVersion], +def _print_pipeline_versions(versions: List[kfp_server_api.V2beta1PipelineVersion], output_format: OutputFormat): headers = ["Version ID", "Version name", "Uploaded at", "Pipeline ID"] data = [[ @@ -219,7 +219,7 @@ def _print_pipeline_versions(versions: List[kfp_server_api.ApiPipelineVersion], print_output(data, headers, output_format, table_format="grid") -def _display_pipeline(pipeline: kfp_server_api.ApiPipeline, +def _display_pipeline(pipeline: kfp_server_api.V2beta1Pipeline, output_format: OutputFormat): # Pipeline information table = [["Pipeline ID", pipeline.id], ["Name", pipeline.name], @@ -247,7 +247,7 @@ def _display_pipeline(pipeline: kfp_server_api.ApiPipeline, print_output(output, [], output_format) -def _display_pipeline_version(version: kfp_server_api.ApiPipelineVersion, +def _display_pipeline_version(version: kfp_server_api.V2beta1PipelineVersion, output_format: OutputFormat): pipeline_id = next( rr for rr in version.resource_references diff --git a/sdk/python/kfp/deprecated/cli/recurring_run.py b/sdk/python/kfp/deprecated/cli/recurring_run.py index 8126e5f0479c..6e80e83d313f 100644 --- a/sdk/python/kfp/deprecated/cli/recurring_run.py +++ b/sdk/python/kfp/deprecated/cli/recurring_run.py @@ -194,14 +194,14 @@ def delete(ctx: click.Context, job_id: str): client.delete_job(job_id) -def _display_recurring_runs(recurring_runs: List[kfp_server_api.ApiJob], +def _display_recurring_runs(recurring_runs: List[kfp_server_api.V2beta1RecurringRun], output_format: OutputFormat): headers = ["Recurring Run ID", "Name"] data = [[rr.id, rr.name] for rr in recurring_runs] print_output(data, headers, output_format, table_format="grid") -def _display_recurring_run(recurring_run: kfp_server_api.ApiJob, +def _display_recurring_run(recurring_run: kfp_server_api.V2beta1RecurringRun, output_format: OutputFormat): table = [ ["Recurring Run ID", recurring_run.id], diff --git a/sdk/python/kfp/deprecated/cli/run.py b/sdk/python/kfp/deprecated/cli/run.py index 8410a1239ab1..a85c9b95096e 100644 --- a/sdk/python/kfp/deprecated/cli/run.py +++ b/sdk/python/kfp/deprecated/cli/run.py @@ -214,7 +214,7 @@ def _wait_for_run_completion(client: Client, run_id: str, timeout: int, _print_runs([run_detail.run], output_format) -def _print_runs(runs: List[kfp_server_api.ApiRun], output_format: OutputFormat): +def _print_runs(runs: List[kfp_server_api.V2beta1Run], output_format: OutputFormat): headers = ['run id', 'name', 'status', 'created at', 'experiment id'] data = [[ run.id, run.name, run.status,