8585}
8686
8787verify_task_is_completed_on_all_containers () {
88- local containers=( $( sudo ctr c list -q) )
88+ local containers=( $( sudo -E " ${CTR_EXE} " c list -q) )
8989 local sleep_secs=10
9090 local max=$( bc <<< " $timeout / $sleep_secs" )
9191 local wip_list=()
@@ -97,7 +97,7 @@ verify_task_is_completed_on_all_containers() {
9797
9898 for i in " ${containers[@]} " ; do
9999 # 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)
101101
102102 if [ " $num_pids " -lt " $INITIAL_NUM_PIDS " ]; then
103103 (( sum++ ))
@@ -120,7 +120,7 @@ check_containers_are_up() {
120120 info " Verify that the containers are running"
121121 local containers_launched=0
122122 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" ) "
124124 sleep 1
125125 done
126126}
@@ -168,7 +168,7 @@ function main() {
168168 for (( i= 1 ; i<= "$NUM_CONTAINERS "; i++ )) ; do
169169 containers+=($( random_name) )
170170 # 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 "
172172 (( not_started_count-- ))
173173 info " $not_started_count remaining containers"
174174 done
@@ -187,14 +187,14 @@ function main() {
187187 fi
188188
189189 # 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)
191191 (( INITIAL_NUM_PIDS++ ))
192192
193193 # Launch webtooling benchmark
194194 local pids=()
195195 local j=0
196196 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 " ) &
198198 pids[${j} ]=$!
199199 (( j++ ))
200200 done
@@ -220,7 +220,7 @@ function main() {
220220
221221 RESULTS_CMD=" cat $file_path /$file_name "
222222 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"
224224 done
225225
226226 # Save configuration
0 commit comments