-
Notifications
You must be signed in to change notification settings - Fork 0
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
Code for create application #71
Conversation
@utkarsh867 this is what I got so far |
Great! Let me get through quickly. |
@yawjalik There are two scenarios here for the Docker image that we should handle.
All that happening automatic, without user prompt will be insane. The only catch to this I see is that Dockerhub images don't need a URL. Not sure how we can handle that. @98sean98 You have any ideas how to resolve this? |
Updates:
TODO:
|
Pretty good work.
in my experience, these are the requirements that aws, azure, and gcp sort of demand |
|
deploifai/cli/application/create.py
Outdated
click.secho(f"\nApplication {application['name']} created successfully", fg="green") | ||
|
||
# Poll for deployment status every 10 seconds | ||
click.echo("Checking deployment status (this will take some time)... ", nl=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Deploying application (this will take a few minutes, and it's safe to CTRL+C) ..."
deploifai/cli/application/create.py
Outdated
# Format env | ||
formatted_env = [] | ||
for env_var in env: | ||
key, val = env_var.split("=", maxsplit=1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catch python ValueError
when env_var
fails to unpack into a key-value pair, this would indicate that this env_var
is faulty.
Print this env_var
for the user, and abort the command
deploifai/cli/application/create.py
Outdated
@click.option( | ||
"--env", | ||
help="Environment variables for the container (e.g. --env path/to/env OR --env VAR1=VAL1 --env VAR2=VAL2)", | ||
multiple=True, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add another --env-file
option to read env files. This should be able to accept multiple files as well.
If the user uses both --env
and --env-file
options, just read everything and aggregate into one list.
deploifai/cli/application/create.py
Outdated
{ | ||
"type": "list", | ||
"name": "config", | ||
"message": "Choose a size for the application", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a size of the application ({provider})
@98sean98 removed config stuff and should be ready for merge? Any other issues? |
Implementing the command
deploifai application create NAME [FLAGS]
Users can specify these using flags:
-i
--image
-t
or--tag
-p
or--port
If not provided, users will be prompted along with other details: