Skip to content

Commit 5649f8e

Browse files
committed
[local] Improve container shutdown for local experiments
1 parent 0f15027 commit 5649f8e

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

scripts/clean.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ pkill -9 -f proc_analyzer.py
1010
# stop all docker containers
1111
# TODO: create common ancestor for all runtimes
1212
echo "Stopping Docker containers..."
13-
active_containers=$(docker ps --filter ancestor=sebs-local-python -q)
14-
if [[ -n "${active_containers}" ]]; then
15-
docker stop -t0 ${active_containers} > /dev/null
16-
fi
13+
for name in "nodejs.13.6" "python.3.6"; do
14+
active_containers=$(docker ps --filter ancestor=sebs.run.local.${name} -q)
15+
if [[ -n "${active_containers}" ]]; then
16+
docker stop -t0 ${active_containers} > /dev/null
17+
fi
18+
done
1719
echo "Stopping minio storage containers..."
1820
active_containers=$(docker ps --filter ancestor=minio/minio -q)
1921
if [[ -n "${active_containers}" ]]; then

scripts/run_experiments.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,11 @@ def run_experiment_disk_io(input_config):
297297
help='Cache directory')
298298
parser.add_argument('--update', action='store_true', default=False,
299299
help='Update function code in cache and deployment.')
300+
parser.add_argument('--shutdown-containers', action='store_true',
301+
help='Shutdown containers after experiments.')
302+
parser.add_argument('--no-shutdown-containers', action='store_false',
303+
help='Shutdown containers after experiments.')
304+
parser.set_defaults(shutdown_containers=True)
300305
parser.add_argument('--verbose', action='store', default=False, type=bool,
301306
help='Verbose output')
302307

@@ -703,7 +708,8 @@ def create_function(self, code_package: CodePackage, experiment_config :dict):
703708
json.dump(docker_stats, out_f, indent=2)
704709

705710
# 10. Kill docker instance
706-
container.stop()
711+
#if args.shutdown_containers:
712+
# container.stop()
707713

708714
# 11. Find experiment JSONs and include in summary
709715
result_path = os.path.join(dest_dir, 'results')

0 commit comments

Comments
 (0)