Skip to content

Commit

Permalink
Merge branch 'main' into pull-images-if-not-available
Browse files Browse the repository at this point in the history
  • Loading branch information
klieret authored Nov 12, 2024
2 parents 23377fc + 4f9c130 commit a5d27a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/swerex/deployment/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ async def start(self):
"""Starts the runtime."""
self._pull_image()
port = self._port or find_free_port()
if self._port is None:
self._port = find_free_port()
assert self._container_name is None
self._container_name = self._get_container_name()
token = self._get_token()
Expand All @@ -141,7 +143,7 @@ async def start(self):
"run",
"--rm",
"-p",
f"{port}:8000",
f"{self._port}:8000",
*self._docker_args,
"--name",
self._container_name,
Expand All @@ -156,7 +158,7 @@ async def start(self):
# shell=True required for && etc.
self._container_process = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
self.logger.info(f"Starting runtime at {self._port}")
self._runtime = RemoteRuntime(port=port, timeout=self._runtime_timeout, auth_token=token)
self._runtime = RemoteRuntime(port=self._port, timeout=self._runtime_timeout, auth_token=token)
t0 = time.time()
await self._wait_until_alive(timeout=self._startup_timeout)
self.logger.info(f"Runtime started in {time.time() - t0:.2f}s")
Expand Down

0 comments on commit a5d27a2

Please sign in to comment.