Skip to content

Commit

Permalink
feat(fal-file): add no scale
Browse files Browse the repository at this point in the history
  • Loading branch information
badayvedat committed Nov 12, 2024
1 parent 7478340 commit 06161be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion projects/fal/src/fal/cli/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ def get_app_data_from_toml(app_name):

app_auth = app_data.get("auth", "private")
app_deployment_strategy = app_data.get("deployment_strategy", "recreate")
app_no_scale = app_data.get("no_scale", False)

return app_ref, app_auth, app_deployment_strategy
return app_ref, app_auth, app_deployment_strategy, app_no_scale
9 changes: 7 additions & 2 deletions projects/fal/src/fal/cli/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def _deploy_from_reference(
args,
auth: Optional[Literal["public", "shared", "private"]] = None,
deployment_strategy: Optional[Literal["recreate", "rolling"]] = None,
no_scale: bool = False,
):
from fal.api import FalServerlessError, FalServerlessHost
from fal.utils import load_function_from
Expand Down Expand Up @@ -106,7 +107,7 @@ def _deploy_from_reference(
application_auth_mode=app_auth,
metadata=isolated_function.options.host.get("metadata", {}),
deployment_strategy=deployment_strategy,
scale=not args.no_scale,
scale=not no_scale,
)

if app_id:
Expand Down Expand Up @@ -139,7 +140,9 @@ def _deploy(args):
raise ValueError("Cannot use --app-name or --auth with app name reference.")

app_name = args.app_ref[0]
app_ref, app_auth, app_deployment_strategy = get_app_data_from_toml(app_name)
app_ref, app_auth, app_deployment_strategy, app_no_scale = (
get_app_data_from_toml(app_name)
)
file_path, func_name = RefAction.split_ref(app_ref)

# path/to/myfile.py::MyApp
Expand All @@ -148,13 +151,15 @@ def _deploy(args):
app_name = args.app_name
app_auth = args.auth
app_deployment_strategy = args.strategy
app_no_scale = args.no_scale

_deploy_from_reference(
(file_path, func_name),
app_name,
args,
app_auth,
app_deployment_strategy,
app_no_scale,
)


Expand Down

0 comments on commit 06161be

Please sign in to comment.