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

feature: human readable cloud provider #1744

Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
14 changes: 9 additions & 5 deletions nebari/cli/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
CHOOSE_CLOUD_PROVIDER = "https://nebari.dev/docs/get-started/deploy"


def enum_to_list(enum_cls):
return [e.value.lower() for e in enum_cls]
def enum_to_list(enum_cls, lower=True):
iameskild marked this conversation as resolved.
Show resolved Hide resolved
if lower:
return [e.value.lower() for e in enum_cls]
return [e.value for e in enum_cls]


def handle_init(inputs: InitInputs):
Expand Down Expand Up @@ -330,10 +332,12 @@ def guided_init_wizard(ctx: typer.Context, guided_init: str):
# try:
inputs.cloud_provider = questionary.select(
"Where would you like to deploy your Nebari cluster?",
choices=enum_to_list(ProviderEnum),
choices=enum_to_list(ProviderEnum, lower=False),
iameskild marked this conversation as resolved.
Show resolved Hide resolved
qmark=qmark,
).unsafe_ask()

inputs.cloud_provider = ProviderEnum(inputs.cloud_provider).name

if not disable_checks:
check_cloud_provider_creds(ctx, cloud_provider=inputs.cloud_provider)

Expand All @@ -345,9 +349,9 @@ def guided_init_wizard(ctx: typer.Context, guided_init: str):
- Letters from A to Z (upper and lower case) and numbers
- Maximum accepted length of the name string is 16 characters
"""
if inputs.cloud_provider == ProviderEnum.aws.value.lower():
if inputs.cloud_provider == ProviderEnum.aws.name:
name_guidelines += "- Should NOT start with the string `aws`\n"
elif inputs.cloud_provider == ProviderEnum.azure.value.lower():
elif inputs.cloud_provider == ProviderEnum.azure.name:
name_guidelines += "- Should NOT contain `-`\n"

# PROJECT NAME
Expand Down
10 changes: 5 additions & 5 deletions nebari/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class TerraformStateEnum(str, enum.Enum):

class ProviderEnum(str, enum.Enum):
local = "local"
existing = "existing"
do = "do"
aws = "aws"
gcp = "gcp"
azure = "azure"
existing = "existing K8s cluster"
do = "DigitalOcean"
aws = "Amazon Web Services (AWS)"
gcp = "Google Cloud Platform (GCP)"
azure = "Microsoft Azure"


class GitRepoEnum(str, enum.Enum):
Expand Down