From 17dab4fa8894c0001264ca545e2d709414db2f0a Mon Sep 17 00:00:00 2001 From: asmijafar20 Date: Tue, 30 Aug 2022 21:41:32 +0530 Subject: [PATCH 1/2] Nebari cli: Add files _init.py and main.py --- qhub/cli/_init.py | 7 ++++++- qhub/cli/main.py | 37 +++++++++++++++++++++++++++++++------ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/qhub/cli/_init.py b/qhub/cli/_init.py index dc0e07565..82377350b 100644 --- a/qhub/cli/_init.py +++ b/qhub/cli/_init.py @@ -1,11 +1,16 @@ import os import typer +from rich import print from qhub.schema import ProviderEnum def check_cloud_provider_creds(cloud_provider: str): + + print("[green]Initializing the Nebari 🚀 [/green]") + print("\n[green]Note: Values that the user assign for each arguments will be reflected in the [red]config.yaml[/red] file. Later you can update by using[blue] nebari update[/blue] command [/green]") + cloud_provider = cloud_provider.lower() @@ -14,7 +19,7 @@ def check_cloud_provider_creds(cloud_provider: str): or not os.environ.get("AWS_SECRET_ACCESS_KEY") ): print( - "\nUnable to location AWS credentials, please generate your AWS keys at this link: aws.com/..." + "Unable to location AWS credentials, please generate your AWS keys at this link:[blue] https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create.html[/blue]" ) os.environ["AWS_ACCESS_KEY_ID"] = typer.prompt( "Please enter your AWS_ACCESS_KEY_ID", diff --git a/qhub/cli/main.py b/qhub/cli/main.py index daa077d90..15c4747f3 100644 --- a/qhub/cli/main.py +++ b/qhub/cli/main.py @@ -26,14 +26,12 @@ def init( None, "--project-name", "--project", - "-p", prompt=True, ), domain_name: str = typer.Option( None, "--domain-name", "--domain", - "-d", prompt=True, ), auth_provider: str = typer.Option( @@ -41,15 +39,42 @@ def init( prompt=True, # callback=auth_provider_options ), + namespace: str = typer.Option( + "dev", + prompt=True, + # callback=auth_provider_options + ), + repository: str = typer.Option( + None, + prompt=True, + # callback=auth_provider_options + ), + ci_provider: str = typer.Option( + "github-actions", + prompt=True, + # callback=auth_provider_options + ), + terraform_state: str = typer.Option( + "remote", + prompt=True, + # callback=auth_provider_options + ), + kubernetes_version: str = typer.Option( + "latest", + prompt=True, + # callback=auth_provider_options + ), + ssl_cert: str = typer.Option( + "email", + prompt=True, + # callback=auth_provider_options + ), ): """ Initialize the nebari-config.yaml file. """ - print(f"Cloud provider: {cloud_provider}") - print(f"Project name: {project_name}") - print(f"Domain name: {domain_name}") - print(f"Auth provider: {auth_provider}") + @app.command() From 7d460b690704151ceeb0123f5975315f43f91a6c Mon Sep 17 00:00:00 2001 From: iameskild Date: Fri, 2 Sep 2022 16:11:04 -0700 Subject: [PATCH 2/2] run pre-commit --- qhub/cli/_init.py | 7 ++++--- qhub/cli/main.py | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qhub/cli/_init.py b/qhub/cli/_init.py index 82377350b..23fa6eaed 100644 --- a/qhub/cli/_init.py +++ b/qhub/cli/_init.py @@ -7,10 +7,11 @@ def check_cloud_provider_creds(cloud_provider: str): - + print("[green]Initializing the Nebari 🚀 [/green]") - print("\n[green]Note: Values that the user assign for each arguments will be reflected in the [red]config.yaml[/red] file. Later you can update by using[blue] nebari update[/blue] command [/green]") - + print( + "\n[green]Note: Values that the user assign for each arguments will be reflected in the [red]config.yaml[/red] file. Later you can update by using[blue] nebari update[/blue] command [/green]" + ) cloud_provider = cloud_provider.lower() diff --git a/qhub/cli/main.py b/qhub/cli/main.py index 15c4747f3..f56cb0198 100644 --- a/qhub/cli/main.py +++ b/qhub/cli/main.py @@ -74,7 +74,6 @@ def init( Initialize the nebari-config.yaml file. """ - @app.command()