Skip to content

Commit 6cf60cd

Browse files
authored
Enh: Increase timeouts and fix deployment bug (#205)
1 parent 33b193c commit 6cf60cd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/swerex/deployment/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class ModalDeploymentConfig(BaseModel):
9595
"""Runtime timeout (default timeout for all runtime requests)
9696
"""
9797

98-
deployment_timeout: float = 1800.0
98+
deployment_timeout: float = 3600.0
9999
"""Kill deployment after this many seconds no matter what.
100100
This is a useful killing switch to ensure that you don't spend too
101101
much money on modal.

src/swerex/deployment/modal.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ def __init__(
117117
logger: logging.Logger | None = None,
118118
image: str | modal.Image | PurePath,
119119
startup_timeout: float = 0.4,
120-
runtime_timeout: float = 1800.0,
120+
runtime_timeout: float = 3600.0,
121121
modal_sandbox_kwargs: dict[str, Any] | None = None,
122122
install_pipx: bool = True,
123-
deployment_timeout: float = 1800.0,
123+
deployment_timeout: float = 3600.0,
124124
):
125125
"""Deployment for modal.com. The deployment will only start when the
126126
`start` method is being called.
@@ -209,6 +209,10 @@ async def start(
209209
self,
210210
):
211211
"""Starts the runtime."""
212+
if self._runtime is not None and self._sandbox is not None:
213+
self.logger.warning("Deployment is already started. Ignoring duplicate start() call.")
214+
return
215+
212216
self.logger.info("Starting modal sandbox")
213217
self._hooks.on_custom_step("Starting modal sandbox")
214218
t0 = time.time()

0 commit comments

Comments
 (0)