Skip to content

Commit 1c9d07e

Browse files
authored
fix: remove stale devbox container on restart (#1043)
Signed-off-by: Kevin Su <pingsutw@apache.org>
1 parent 987de34 commit 1c9d07e

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/flyte/cli/_delete.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ def devbox(volume: bool):
8080
Stop and remove the local Flyte devbox cluster container.
8181
"""
8282
console = common.get_console()
83-
result = subprocess.run(["docker", "stop", "flyte-devbox"], capture_output=True, check=False)
83+
result = subprocess.run(["docker", "rm", "-f", "flyte-devbox"], capture_output=True, check=False)
8484
if result.returncode == 0:
85-
subprocess.run(["docker", "wait", "flyte-devbox"], capture_output=True, check=False)
8685
console.print("[green]Devbox cluster stopped.[/green]")
8786
else:
8887
console.print("[yellow]Devbox cluster is not running.[/yellow]")

src/flyte/cli/_devbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def launch_devbox(image_name: str, is_dev_mode: bool, gpu: bool = False, log_for
254254
console.print("[yellow]Flyte devbox cluster is already running.[/yellow]")
255255
if not click.confirm("Do you want to delete the existing devbox cluster and start a new one?"):
256256
return
257-
subprocess.run(["docker", "stop", _CONTAINER_NAME], check=True, capture_output=True)
257+
subprocess.run(["docker", "rm", "-f", _CONTAINER_NAME], check=False, capture_output=True)
258258

259259
_KUBE_DIR.mkdir(parents=True, exist_ok=True)
260260
# This step makes sure that we always used the latest k3s kubeconfig file

0 commit comments

Comments
 (0)