diff --git a/hack/perf/bz-2162111.sh b/hack/perf/bz-2162111.sh index 7bee29a48d..4e802e119d 100755 --- a/hack/perf/bz-2162111.sh +++ b/hack/perf/bz-2162111.sh @@ -8,13 +8,20 @@ file_b=$(mktemp -p $tmp --suffix '.file_b') dd if=/dev/zero of=$file_a bs=1024 count=1024 status=none dd if=/dev/zero of=$file_b bs=1024 count=1024 status=none -# The create command volume_name="bz-2162111" container_name="bz-2162111" +network_name="bz-2162111" + +$ENGINE_A system prune -f >> /dev/null +$ENGINE_B system prune -f >> /dev/null +$ENGINE_A network create $network_name >> /dev/null +$ENGINE_B network create $network_name >> /dev/null + container_cmd="--name $container_name \ --stop-timeout=0 \ --network-alias alias_a \ --network-alias alias_b \ + --network=$network_name \ -v /dev/log:/dev/log:rw,z \ -v $volume_name:/var/core:rw,z \ -v $file_a:/home/file_a:rw \ @@ -88,3 +95,7 @@ hyperfine --warmup 10 --runs $RUNS \ --prepare "ENGINE=$ENGINE_B sh $prepare_sh; ENGINE=$ENGINE_B sh $create_sh" \ "$ENGINE_A rm -f $container_name" \ "$ENGINE_B rm -f $container_name" + +# Clean up +$ENGINE_A system prune -f >> /dev/null +$ENGINE_B system prune -f >> /dev/null diff --git a/hack/perf/create.sh b/hack/perf/create.sh index 45bf2b38ca..a6af109b73 100755 --- a/hack/perf/create.sh +++ b/hack/perf/create.sh @@ -6,3 +6,7 @@ echo_bold "Create $RUNS containers" hyperfine --warmup 10 --runs $RUNS \ "$ENGINE_A create $IMAGE" \ "$ENGINE_B create $IMAGE" + +# Clean up +$ENGINE_A system prune -f >> /dev/null +$ENGINE_B system prune -f >> /dev/null diff --git a/hack/perf/ps.sh b/hack/perf/ps.sh index 7fe5441df2..42e2ba4b0f 100755 --- a/hack/perf/ps.sh +++ b/hack/perf/ps.sh @@ -7,3 +7,7 @@ create_containers hyperfine --warmup 10 --runs $RUNS \ "$ENGINE_A ps -a" \ "$ENGINE_B ps -a" + +# Clean up +$ENGINE_A system prune -f >> /dev/null +$ENGINE_B system prune -f >> /dev/null diff --git a/hack/perf/rm.sh b/hack/perf/rm.sh index 0a38322c11..0e4a05893d 100755 --- a/hack/perf/rm.sh +++ b/hack/perf/rm.sh @@ -8,3 +8,7 @@ hyperfine --warmup 10 --runs $RUNS \ --prepare "$ENGINE_B create --name=123 $IMAGE" \ "$ENGINE_A rm 123" \ "$ENGINE_B rm 123" + +# Clean up +$ENGINE_A system prune -f >> /dev/null +$ENGINE_B system prune -f >> /dev/null diff --git a/hack/perf/run.sh b/hack/perf/run.sh index a1be714960..32dff386ce 100755 --- a/hack/perf/run.sh +++ b/hack/perf/run.sh @@ -16,3 +16,7 @@ hyperfine --warmup 10 --runs $RUNS \ --prepare "$ENGINE_B rm -f 123 || true" \ "$ENGINE_A run --rm --name=123 $IMAGE true" \ "$ENGINE_B run --rm --name=123 $IMAGE true" + +# Clean up +$ENGINE_A system prune -f >> /dev/null +$ENGINE_B system prune -f >> /dev/null diff --git a/hack/perf/start.sh b/hack/perf/start.sh index a5668d7f0e..467a7df124 100755 --- a/hack/perf/start.sh +++ b/hack/perf/start.sh @@ -8,3 +8,7 @@ hyperfine --warmup 10 --runs $RUNS \ --prepare "$ENGINE_B rm -f 123 || true; $ENGINE_B create --name=123 $IMAGE true" \ "$ENGINE_A start 123" \ "$ENGINE_B start 123" + +# Clean up +$ENGINE_A system prune -f >> /dev/null +$ENGINE_B system prune -f >> /dev/null diff --git a/hack/perf/stop.sh b/hack/perf/stop.sh index f321fe4291..93534ccabd 100755 --- a/hack/perf/stop.sh +++ b/hack/perf/stop.sh @@ -8,3 +8,7 @@ hyperfine --warmup 10 --runs $RUNS \ --prepare "$ENGINE_B rm -f 123 || true; $ENGINE_B run -d --name=123 $IMAGE top" \ "$ENGINE_A stop 123" \ "$ENGINE_B stop 123" + +# Clean up +$ENGINE_A system prune -f >> /dev/null +$ENGINE_B system prune -f >> /dev/null