hosting v1

This commit is contained in:
simon 2024-10-10 16:30:01 -07:00
parent 614cfcb74d
commit 33e351f4ba

View File

@ -477,12 +477,6 @@ def makemigrations(
@cli.command() @cli.command()
def deploy( def deploy(
key: Optional[str] = typer.Option(
None,
"-k",
"--deployment-key",
help="The name of the deployment. Domain name safe characters only.",
),
app_name: str = typer.Option( app_name: str = typer.Option(
config.app_name, config.app_name,
"--app-name", "--app-name",
@ -493,32 +487,19 @@ def deploy(
list(), list(),
"-r", "-r",
"--region", "--region",
help="The regions to deploy to.", help="The regions to deploy to. For multiple envs, repeat this option, e.g. --region sjc --region iad",
), ),
envs: List[str] = typer.Option( envs: List[str] = typer.Option(
list(), list(),
"--env", "--env",
help="The environment variables to set: <key>=<value>. For multiple envs, repeat this option, e.g. --env k1=v2 --env k2=v2.", help="The environment variables to set: <key>=<value>. For multiple envs, repeat this option, e.g. --env k1=v2 --env k2=v2.",
), ),
cpus: Optional[int] = typer.Option( vmtype: Optional[str] = typer.Option(
None, help="The number of CPUs to allocate.", hidden=True None, "--vmtype", help="Vm type. Run reflex apps vmtype list to get options."
), ),
memory_mb: Optional[int] = typer.Option( hostname: Optional[str] = typer.Option(
None, help="The amount of memory to allocate.", hidden=True
),
auto_start: Optional[bool] = typer.Option(
None, None,
help="Whether to auto start the instance.", "--hostname",
hidden=True,
),
auto_stop: Optional[bool] = typer.Option(
None,
help="Whether to auto stop the instance.",
hidden=True,
),
frontend_hostname: Optional[str] = typer.Option(
None,
"--frontend-hostname",
help="The hostname of the frontend.", help="The hostname of the frontend.",
hidden=True, hidden=True,
), ),
@ -526,19 +507,10 @@ def deploy(
True, True,
help="Whether to list configuration options and ask for confirmation.", help="Whether to list configuration options and ask for confirmation.",
), ),
with_metrics: Optional[str] = typer.Option( envfile: Optional[str] = typer.Option(
None, None,
help="Setting for metrics scraping for the deployment. Setup required in user code.", "--envfile",
hidden=True, help="The path to an env file to use. Will override any envs set manually.",
),
with_tracing: Optional[str] = typer.Option(
None,
help="Setting to export tracing for the deployment. Setup required in user code.",
hidden=True,
),
upload_db_file: bool = typer.Option(
False,
help="Whether to include local sqlite db files when uploading to hosting service.",
hidden=True, hidden=True,
), ),
loglevel: constants.LogLevel = typer.Option( loglevel: constants.LogLevel = typer.Option(
@ -565,12 +537,7 @@ def deploy(
hosting_cli.deploy( hosting_cli.deploy(
app_name=app_name, app_name=app_name,
export_fn=lambda zip_dest_dir, export_fn=lambda zip_dest_dir, api_url, deploy_url, frontend, backend, zipping: export_utils.export(
api_url,
deploy_url,
frontend,
backend,
zipping: export_utils.export(
zip_dest_dir=zip_dest_dir, zip_dest_dir=zip_dest_dir,
api_url=api_url, api_url=api_url,
deploy_url=deploy_url, deploy_url=deploy_url,
@ -578,19 +545,13 @@ def deploy(
backend=backend, backend=backend,
zipping=zipping, zipping=zipping,
loglevel=loglevel, loglevel=loglevel,
upload_db_file=upload_db_file,
), ),
key=key,
regions=regions, regions=regions,
envs=envs, envs=envs,
cpus=cpus, vmtype=vmtype,
memory_mb=memory_mb, envfile=envfile,
auto_start=auto_start, hostname=hostname,
auto_stop=auto_stop,
frontend_hostname=frontend_hostname,
interactive=interactive, interactive=interactive,
with_metrics=with_metrics,
with_tracing=with_tracing,
loglevel=loglevel.value, loglevel=loglevel.value,
) )
@ -611,8 +572,8 @@ cli.add_typer(db_cli, name="db", help="Subcommands for managing the database sch
cli.add_typer(script_cli, name="script", help="Subcommands running helper scripts.") cli.add_typer(script_cli, name="script", help="Subcommands running helper scripts.")
cli.add_typer( cli.add_typer(
deployments_cli, deployments_cli,
name="deployments", name="apps",
help="Subcommands for managing the Deployments.", help="Subcommands for managing the deployed apps.",
) )
cli.add_typer( cli.add_typer(
custom_components_cli, custom_components_cli,