Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): Enable containerizing v2 Python components #6417

Merged
merged 27 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
30de018
Refactor and move all v2 related code to under the v2 namespace.
neuromage Aug 16, 2021
fb323f5
Update setup.py.
neuromage Aug 16, 2021
46890ac
update tests.
neuromage Aug 16, 2021
cf8d685
revert accidental change of gcpc
neuromage Aug 17, 2021
d856a95
Fix component entrypoint.
neuromage Aug 17, 2021
d3dc294
Update goldens.
neuromage Aug 17, 2021
08502e3
fix tests.
neuromage Aug 17, 2021
100f9bf
fix merge conflict.
neuromage Aug 17, 2021
bd191f7
revert gcpc change.
neuromage Aug 17, 2021
19a7b37
fix tests.
neuromage Aug 17, 2021
29f4a6b
fix tests.
neuromage Aug 17, 2021
2d02d73
Add type aliases for moved files.
neuromage Aug 18, 2021
405705c
Merge branch 'master' into hermetic-v2
neuromage Aug 18, 2021
a958234
merge and update goldens.
neuromage Aug 18, 2021
ff3d8ff
Add a CLI command to help containerize and build v2 components.
neuromage Aug 16, 2021
2e2bb27
Flesh out the CLI for Docker.
neuromage Aug 24, 2021
778ad48
Merge branch 'master' into component-builder
neuromage Aug 24, 2021
677748a
update comments.
neuromage Aug 24, 2021
e52e0a6
Support multiple component files in the same directory.
neuromage Aug 24, 2021
fce2013
address pr comments.
neuromage Aug 25, 2021
88812bc
Let user specify just the directory containing components.
neuromage Oct 12, 2021
38ba681
Clean up.
neuromage Oct 12, 2021
3707ae4
Merge branch 'master' into component-builder
neuromage Oct 12, 2021
6455327
fix merge error.
neuromage Oct 12, 2021
02ab4c0
Fix docker import error for tests.
neuromage Oct 12, 2021
7abaa31
Update release notes.
neuromage Oct 12, 2021
bc371eb
address PR comments.
neuromage Oct 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions sdk/python/kfp/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,43 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import click
import logging
import sys

import click
import typer

from kfp._client import Client
from kfp.cli.run import run
from kfp.cli.pipeline import pipeline
from kfp.cli.diagnose_me_cli import diagnose_me
from kfp.cli.experiment import experiment
from kfp.cli.output import OutputFormat
from kfp.cli import components


@click.group()
@click.option('--endpoint', help='Endpoint of the KFP API service to connect.')
@click.option('--iap-client-id', help='Client ID for IAP protected endpoint.')
@click.option('-n', '--namespace', default='kubeflow', show_default=True,
@click.option('-n',
'--namespace',
default='kubeflow',
show_default=True,
help='Kubernetes namespace to connect to the KFP API.')
@click.option('--other-client-id', help='Client ID for IAP protected endpoint to obtain the refresh token.')
@click.option('--other-client-secret', help='Client ID for IAP protected endpoint to obtain the refresh token.')
@click.option('--output', type=click.Choice(list(map(lambda x: x.name, OutputFormat))),
default=OutputFormat.table.name, show_default=True,
@click.option(
'--other-client-id',
help='Client ID for IAP protected endpoint to obtain the refresh token.')
@click.option(
'--other-client-secret',
help='Client ID for IAP protected endpoint to obtain the refresh token.')
@click.option('--output',
type=click.Choice(list(map(lambda x: x.name, OutputFormat))),
default=OutputFormat.table.name,
show_default=True,
help='The formatting style for command output.')
@click.pass_context
def cli(ctx, endpoint, iap_client_id, namespace, other_client_id, other_client_secret, output):
def cli(ctx, endpoint, iap_client_id, namespace, other_client_id,
other_client_secret, output):
"""kfp is the command line interface to KFP service.

Feature stage:
Expand All @@ -43,7 +58,8 @@ def cli(ctx, endpoint, iap_client_id, namespace, other_client_id, other_client_s
if ctx.invoked_subcommand == 'diagnose_me':
# Do not create a client for diagnose_me
return
ctx.obj['client'] = Client(endpoint, iap_client_id, namespace, other_client_id, other_client_secret)
ctx.obj['client'] = Client(endpoint, iap_client_id, namespace,
other_client_id, other_client_secret)
ctx.obj['namespace'] = namespace
ctx.obj['output'] = output

Expand All @@ -52,8 +68,9 @@ def main():
logging.basicConfig(format='%(message)s', level=logging.INFO)
cli.add_command(run)
cli.add_command(pipeline)
cli.add_command(diagnose_me,'diagnose_me')
cli.add_command(diagnose_me, 'diagnose_me')
cli.add_command(experiment)
cli.add_command(typer.main.get_command(components.app))
try:
cli(obj={}, auto_envvar_prefix='KFP')
except Exception as e:
Expand Down
Loading