From 02a52a41856540e3bb1ba541fc8d51da939a499e Mon Sep 17 00:00:00 2001 From: "Jonny Browning (Datatonic)" <78856444+browningjp-datatonic@users.noreply.github.com> Date: Thu, 17 Mar 2022 22:25:39 +0000 Subject: [PATCH] fix(sdk): no longer require KFP client for kfp components build (#7430) * fix(sdk): no longer require KFP client for kfp components build * docs(sdk): added release note for kfp components build fix --- sdk/RELEASE.md | 1 + sdk/python/kfp/deprecated/cli/cli.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/RELEASE.md b/sdk/RELEASE.md index 8cf698d19e..1dce416818 100644 --- a/sdk/RELEASE.md +++ b/sdk/RELEASE.md @@ -79,6 +79,7 @@ * Add verify_ssl for Kubeflow client [\#7174](https://github.com/kubeflow/pipelines/pull/7174) * Depends on `typing-extensions>=3.7.4,<5; python_version<"3.9"` [\#7288](https://github.com/kubeflow/pipelines/pull/7288) * Depends on `google-api-core>=1.31.5, >=2.3.2` [\#7377](https://github.com/kubeflow/pipelines/pull/7377) +* Fix bug that required KFP API server for `kfp components build` command to work [\#7430](https://github.com/kubeflow/pipelines/pull/7430) ## Documentation Updates diff --git a/sdk/python/kfp/deprecated/cli/cli.py b/sdk/python/kfp/deprecated/cli/cli.py index 3867e6958a..5771b7b9f5 100644 --- a/sdk/python/kfp/deprecated/cli/cli.py +++ b/sdk/python/kfp/deprecated/cli/cli.py @@ -27,6 +27,10 @@ from kfp.deprecated.cli.experiment import experiment from kfp.deprecated.cli.output import OutputFormat from kfp.deprecated.cli import components +_NO_CLIENT_COMMANDS = [ + 'diagnose_me', + 'components' +] @click.group() @click.option('--endpoint', help='Endpoint of the KFP API service to connect.') @@ -57,8 +61,8 @@ def cli(ctx: click.Context, endpoint: str, iap_client_id: str, namespace: str, Feature stage: [Alpha](https://github.com/kubeflow/pipelines/blob/07328e5094ac2981d3059314cc848fbb71437a76/docs/release/feature-stages.md#alpha) """ - if ctx.invoked_subcommand == 'diagnose_me': - # Do not create a client for diagnose_me + if ctx.invoked_subcommand in _NO_CLIENT_COMMANDS: + # Do not create a client for these subcommands return ctx.obj['client'] = Client(endpoint, iap_client_id, namespace, other_client_id, other_client_secret)