Skip to content

Commit

Permalink
Merge pull request #17335 from vrothberg/hack/perf/bz-2162111.sh
Browse files Browse the repository at this point in the history
[CI:DOCS] hack/perf/bz-2162111.sh: use custom network
  • Loading branch information
openshift-merge-robot authored Feb 6, 2023
2 parents 26d7efe + 8aa3776 commit 3464df2
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 1 deletion.
13 changes: 12 additions & 1 deletion hack/perf/bz-2162111.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions hack/perf/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions hack/perf/ps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions hack/perf/rm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions hack/perf/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions hack/perf/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions hack/perf/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3464df2

Please sign in to comment.