mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-10-18 22:13:42 +02:00
fix(cli): defer AWS serverless support to the backend
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
This commit is contained in:
co-authored by
open-swe[bot] <open-swe@users.noreply.github.com>
parent
dcdcb13a99
commit
74c91eb4e5
@@ -1548,11 +1548,6 @@ def _resolve_or_create(
|
||||
)
|
||||
if found is not None:
|
||||
return found.id, step
|
||||
if ctx.endpoints.is_aws and ctx.deployment_type == "dev_zero":
|
||||
raise click.UsageError(
|
||||
"Serverless deployments are not supported on AWS yet. "
|
||||
"Use --deployment-type dev instead."
|
||||
)
|
||||
try:
|
||||
created, step = _create_deployment(
|
||||
ctx.client,
|
||||
@@ -1565,6 +1560,14 @@ def _resolve_or_create(
|
||||
secrets=ctx.secrets,
|
||||
)
|
||||
except HostBackendError as err:
|
||||
if err.status_code == 400 and err.detail == (
|
||||
"Scale to zero deployments are not supported in AWS environments"
|
||||
):
|
||||
raise HostBackendError(
|
||||
f"{err.message}\nUse --deployment-type dev instead.",
|
||||
status_code=err.status_code,
|
||||
detail=err.detail,
|
||||
) from None
|
||||
if _needs_a_listener(err):
|
||||
raise ListenerRequiredError(
|
||||
"The image has to come from a registry you manage, so re-run with "
|
||||
@@ -2219,8 +2222,8 @@ def _deploy_base_options(
|
||||
click.option(
|
||||
"--deployment-type",
|
||||
type=click.Choice(["serverless", "dedicated", "dev", "prod"]),
|
||||
default=None,
|
||||
show_default="serverless; dev on AWS",
|
||||
default="serverless",
|
||||
show_default=True,
|
||||
help=(
|
||||
"Deployment type (used when creating a new deployment): "
|
||||
"serverless (scale to zero) or dedicated (prod); "
|
||||
@@ -2401,7 +2404,7 @@ def _deploy_cmd(
|
||||
host_url: str | None,
|
||||
api_key: str | None,
|
||||
deployment_id: str | None,
|
||||
deployment_type: str | None,
|
||||
deployment_type: str,
|
||||
name: str | None,
|
||||
agent_id: str | None,
|
||||
environment: str | None,
|
||||
@@ -2493,9 +2496,6 @@ def _deploy_cmd(
|
||||
)
|
||||
|
||||
client = _create_host_backend_client(host_url, api_key, env_vars=env_vars)
|
||||
deployment_type = deployment_type or (
|
||||
"dev" if client.endpoints.is_aws else "serverless"
|
||||
)
|
||||
try:
|
||||
tracked_packages = find_tracked_packages(config, config_json) or None
|
||||
except Exception as exc:
|
||||
|
||||
Reference in New Issue
Block a user