Skip to content

Commit

Permalink
fix: point to new test env on deploy prints (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
chamini2 authored Feb 13, 2025
1 parent e541561 commit 4dfba58
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions projects/fal/src/fal/cli/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,16 @@ def _deploy_from_reference(
)

if app_id:
gateway_host = _remove_http_and_port_from_url(host.url)
gateway_host = (
gateway_host.replace("api.", "").replace("alpha.", "").replace("ai", "run")
)
env_host = _remove_http_and_port_from_url(host.url)
env_host = env_host.replace("api.", "").replace("alpha.", "")

env_host_parts = env_host.split(".")

# keep the last 3 parts
playground_host = ".".join(env_host_parts[-3:])

# just replace .ai for .run
endpoint_host = env_host.replace(".ai", ".run")

args.console.print(
"Registered a new revision for function "
Expand All @@ -123,12 +129,12 @@ def _deploy_from_reference(
args.console.print("Playground:")
for endpoint in loaded.endpoints:
args.console.print(
f"\thttps://fal.ai/models/{user.username}/{app_name}{endpoint}"
f"\thttps://{playground_host}/models/{user.username}/{app_name}{endpoint}"
)
args.console.print("Endpoints:")
for endpoint in loaded.endpoints:
args.console.print(
f"\thttps://{gateway_host}/{user.username}/{app_name}{endpoint}"
f"\thttps://{endpoint_host}/{user.username}/{app_name}{endpoint}"
)


Expand Down

0 comments on commit 4dfba58

Please sign in to comment.