85
85
}
86
86
87
87
verify_task_is_completed_on_all_containers () {
88
- local containers=( $( sudo ctr c list -q) )
88
+ local containers=( $( sudo -E " ${CTR_EXE} " c list -q) )
89
89
local sleep_secs=10
90
90
local max=$( bc <<< " $timeout / $sleep_secs" )
91
91
local wip_list=()
@@ -97,7 +97,7 @@ verify_task_is_completed_on_all_containers() {
97
97
98
98
for i in " ${containers[@]} " ; do
99
99
# Only check containers that have not completed the workload at this step
100
- num_pids=$( sudo ctr t metrics " $i " | grep pids.current | grep pids.current | xargs | cut -d ' ' -f 2)
100
+ num_pids=$( sudo -E " ${CTR_EXE} " t metrics " $i " | grep pids.current | grep pids.current | xargs | cut -d ' ' -f 2)
101
101
102
102
if [ " $num_pids " -lt " $INITIAL_NUM_PIDS " ]; then
103
103
(( sum++ ))
@@ -120,7 +120,7 @@ check_containers_are_up() {
120
120
info " Verify that the containers are running"
121
121
local containers_launched=0
122
122
while (( $containers_launched < $NUM_CONTAINERS )) ; do
123
- containers_launched=" $( sudo ctr t list | grep -c " RUNNING" ) "
123
+ containers_launched=" $( sudo -E ${CTR_EXE} t list | grep -c " RUNNING" ) "
124
124
sleep 1
125
125
done
126
126
}
@@ -168,7 +168,7 @@ function main() {
168
168
for (( i= 1 ; i<= "$NUM_CONTAINERS "; i++ )) ; do
169
169
containers+=($( random_name) )
170
170
# Web tool benchmark needs 2 cpus to run completely in its cpu utilization
171
- sudo -E ctr run -d --runtime " ${CTR_RUNTIME} " --cpu-quota " ${cpu_quota} " --cpu-period " ${cpu_period} " --mount=" $MOUNT_OPTIONS " " $IMAGE " " ${containers[-1]} " sh -c " $PAYLOAD_ARGS "
171
+ sudo -E " ${CTR_EXE} " run -d --runtime " ${CTR_RUNTIME} " --cpu-quota " ${cpu_quota} " --cpu-period " ${cpu_period} " --mount=" $MOUNT_OPTIONS " " $IMAGE " " ${containers[-1]} " sh -c " $PAYLOAD_ARGS "
172
172
(( not_started_count-- ))
173
173
info " $not_started_count remaining containers"
174
174
done
@@ -187,14 +187,14 @@ function main() {
187
187
fi
188
188
189
189
# Get the initial number of pids in a single container before the workload starts
190
- INITIAL_NUM_PIDS=$( sudo ctr t metrics " ${containers[-1]} " | grep pids.current | grep pids.current | xargs | cut -d ' ' -f 2)
190
+ INITIAL_NUM_PIDS=$( sudo -E " ${CTR_EXE} " t metrics " ${containers[-1]} " | grep pids.current | grep pids.current | xargs | cut -d ' ' -f 2)
191
191
(( INITIAL_NUM_PIDS++ ))
192
192
193
193
# Launch webtooling benchmark
194
194
local pids=()
195
195
local j=0
196
196
for i in " ${containers[@]} " ; do
197
- $( sudo ctr t exec -d --exec-id " $( random_name) " " $i " sh -c " $CMD " ) &
197
+ $( sudo -E " ${CTR_EXE} " t exec -d --exec-id " $( random_name) " " $i " sh -c " $CMD " ) &
198
198
pids[${j} ]=$!
199
199
(( j++ ))
200
200
done
@@ -220,7 +220,7 @@ function main() {
220
220
221
221
RESULTS_CMD=" cat $file_path /$file_name "
222
222
for i in " ${containers[@]} " ; do
223
- sudo ctr t exec --exec-id " $RANDOM " " $i " sh -c " $RESULTS_CMD " >> " $TMP_DIR /results"
223
+ sudo -E " ${CTR_EXE} " t exec --exec-id " $RANDOM " " $i " sh -c " $RESULTS_CMD " >> " $TMP_DIR /results"
224
224
done
225
225
226
226
# Save configuration
0 commit comments