From 44cf57df9b627fb2ad992e56d14b7f7caef52779 Mon Sep 17 00:00:00 2001 From: prathamesh0 <42446521+prathamesh0@users.noreply.github.com> Date: Tue, 25 Apr 2023 11:51:49 +0530 Subject: [PATCH] Add an arg for shutdown timeout in deploy down command (#366) --- app/data/stacks/fixturenet-optimism/README.md | 2 +- app/data/stacks/fixturenet-optimism/l2-only.md | 2 +- app/data/stacks/mobymask-v2/README.md | 2 +- app/deploy_system.py | 8 +++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/data/stacks/fixturenet-optimism/README.md b/app/data/stacks/fixturenet-optimism/README.md index bbe41c6a..d8a7966f 100644 --- a/app/data/stacks/fixturenet-optimism/README.md +++ b/app/data/stacks/fixturenet-optimism/README.md @@ -70,7 +70,7 @@ docker logs -f Stop all services running in the background: ```bash -laconic-so --stack fixturenet-optimism deploy down +laconic-so --stack fixturenet-optimism deploy down 30 ``` Clear volumes created by this stack: diff --git a/app/data/stacks/fixturenet-optimism/l2-only.md b/app/data/stacks/fixturenet-optimism/l2-only.md index 72bf93cb..0396bf6a 100644 --- a/app/data/stacks/fixturenet-optimism/l2-only.md +++ b/app/data/stacks/fixturenet-optimism/l2-only.md @@ -90,7 +90,7 @@ docker logs -f Stop all services running in the background: ```bash -laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism down +laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism down 30 ``` Clear volumes created by this stack: diff --git a/app/data/stacks/mobymask-v2/README.md b/app/data/stacks/mobymask-v2/README.md index e781af79..a123c203 100644 --- a/app/data/stacks/mobymask-v2/README.md +++ b/app/data/stacks/mobymask-v2/README.md @@ -111,7 +111,7 @@ Follow the [demo](./demo.md) to try out the MobyMask app with L2 chain Stop all the services running in background run: ```bash -laconic-so --stack mobymask-v2 deploy-system down +laconic-so --stack mobymask-v2 deploy-system down 30 ``` Clear volumes created by this stack: diff --git a/app/deploy_system.py b/app/deploy_system.py index 3c347fdf..35912518 100644 --- a/app/deploy_system.py +++ b/app/deploy_system.py @@ -74,7 +74,13 @@ def command(ctx, include, exclude, env_file, cluster, command, extra_args): elif command == "down": if verbose: print("Running compose down") - docker.compose.down() + + timeout_arg = None + if extra_args_list: + timeout_arg=extra_args_list[0] + + # Specify shutdown timeout (default 10s) to give services enough time to shutdown gracefully + docker.compose.down(timeout=timeout_arg) elif command == "exec": if extra_args_list is None or len(extra_args_list) < 2: print("Usage: exec ")