Skip to content

Commit

Permalink
Merge pull request #89 from FreeCarbene/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Burning1020 authored Sep 12, 2023
2 parents 7c18d6f + ecf1b62 commit 450b96c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 41 deletions.
14 changes: 7 additions & 7 deletions tests/benchmark/scripts/boot-parallel-kata-time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#PARALLEL is the number of container
# PARALLEL is the number of container
PARALLEL=50
workdir=$(dirname "$(pwd)")
RAW=${workdir}/data/raw
Expand All @@ -39,11 +39,11 @@ function getTiming(){

once_test(){

#Kill all pods to prevent interference with testing
# Kill all pods to prevent interference with testing
crictl rm -f -a
crictl rmp -f -a

#Create $PARALLEL container.json and pod.json
# Create $PARALLEL container.json and pod.json
for((i=0;i<$PARALLEL;i++))
do
cat > $workdir/json/container/container_$i.json << EOF
Expand Down Expand Up @@ -91,7 +91,7 @@ EOF
EOF
done

#Start timing
# Start timing
start_time=$(date +%s.%N)

for((i=0;i<$PARALLEL;i++))
Expand All @@ -101,7 +101,7 @@ done

end_time=$(date +%s.%N)

#Wait for all the containers to finish starting
# Wait for all the containers to finish starting
a=`crictl ps | grep testcontainer | wc -l`
while [ $a -ne $PARALLEL ];
do
Expand All @@ -112,13 +112,13 @@ break
fi
done

#End timing
# End timing
boot_time=$(getTiming $start_time $end_time)

if [ ${boot_time} -lt 6000 ]; then
echo "BootTime: ${boot_time}ms"

#Output to the corresponding file
# Output to the corresponding file
echo "${boot_time}" >> ${TIME_DAT}
fi

Expand Down
16 changes: 8 additions & 8 deletions tests/benchmark/scripts/boot-parallel-kuasar-time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#PARALLEL is the number of container
# PARALLEL is the number of container
PARALLEL=50
workdir=$(dirname "$(pwd)")
RAW=${workdir}/data/raw
TIME_DAT=${RAW}/boot-parallel-${PARALLEL}-kuasar-time.dat
mkdir -p $workdir/json/container
mkdir -p $workdir/json/pod

#Function to get the interval time(ms)
# Function to get the interval time(ms)
function getTiming(){
start=$1
end=$2
Expand All @@ -39,11 +39,11 @@ function getTiming(){

once_test(){

#Kill all pods to prevent interference with testing
# Kill all pods to prevent interference with testing
crictl rm -f -a
crictl rmp -f -a

#Create $PARALLEL container.json and pod.json
# Create $PARALLEL container.json and pod.json
for((i=0;i<$PARALLEL;i++))
do
cat > $workdir/json/container/container_$i.json << EOF
Expand Down Expand Up @@ -95,7 +95,7 @@ EOF
EOF
done

#Start timing
# Start timing
start_time=$(date +%s.%N)

for((i=0;i<$PARALLEL;i++))
Expand All @@ -105,7 +105,7 @@ done

end_time=$(date +%s.%N)

#Wait for all the containers to finish starting
# Wait for all the containers to finish starting
a=`crictl ps | grep testcontainer | wc -l`
while [ $a -ne $PARALLEL ];
do
Expand All @@ -116,13 +116,13 @@ break
fi
done

#End timing
# End timing
boot_time=$(getTiming $start_time $end_time)

if [ ${boot_time} -lt 20000 ]; then
echo "BootTime: ${boot_time}ms"

#Output to the corresponding file
# Output to the corresponding file
echo "${boot_time}" >> ${TIME_DAT}
fi

Expand Down
16 changes: 8 additions & 8 deletions tests/benchmark/scripts/boot-serial-kata-time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#num is the number of container
# $num is the number of container
num=100
workdir=$(dirname "$(pwd)")
RAW=${workdir}/data/raw
TIME_DAT=${RAW}/boot-serial-500-kata-time.dat
mkdir -p $workdir/json/container
mkdir -p $workdir/json/pod

#Function to get the interval time(ms)
# Function to get the interval time(ms)
function getTiming(){
start=$1
end=$2
Expand All @@ -40,7 +40,7 @@ function getTiming(){
once_test(){
i=$1

#Create $PARALLEL container.json and pod.json
# Create $PARALLEL container.json and pod.json
cat > $workdir/json/container/container_$i.json << EOF
{
"metadata": {
Expand Down Expand Up @@ -86,30 +86,30 @@ EOF
EOF


#Start timing
# Start timing
start_time=$(date +%s.%N)

crictl run -r kata --no-pull $workdir/json/container/container_$i.json $workdir/json/pod/pod_$i.json

#Wait for all the containers to finish starting
# Wait for all the containers to finish starting
a=`crictl ps | grep testcontainer | wc -l`
while [ $a -ne $(($i+1)) ];
do
a=`crictl ps | grep testcontainer | wc -l`
done

#End timing
# End timing
end_time=$(date +%s.%N)
boot_time=$(getTiming $start_time $end_time)

echo "BootTime: ${boot_time}ms"

#Output to the corresponding file
# Output to the corresponding file
echo "${boot_time}" >> ${TIME_DAT}

}

#Kill all pods to prevent interference with testing
# Kill all pods to prevent interference with testing
crictl rm -f -a
crictl rmp -f -a

Expand Down
16 changes: 8 additions & 8 deletions tests/benchmark/scripts/boot-serial-kuasar-time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#num is the number of container
# $num is the number of container
num=50
workdir=$(dirname "$(pwd)")
RAW=${workdir}/data/raw
TIME_DAT=${RAW}/boot-serial-1000-kuasar-time.dat
mkdir -p $workdir/json/container
mkdir -p $workdir/json/pod

#Function to get the interval time(ms)
# Function to get the interval time(ms)
function getTiming(){
start=$1
end=$2
Expand All @@ -40,7 +40,7 @@ function getTiming(){
once_test(){
i=$1

#Create $PARALLEL container.json and pod.json
# Create $PARALLEL container.json and pod.json
cat > $workdir/json/container/container_$i.json << EOF
{
"metadata": {
Expand Down Expand Up @@ -90,30 +90,30 @@ EOF
EOF


#Start timing
# Start timing
start_time=$(date +%s.%N)

crictl run -r kuasar --no-pull $workdir/json/container/container_$i.json $workdir/json/pod/pod_$i.json

#Wait for all the containers to finish starting
# Wait for all the containers to finish starting
a=`crictl ps | grep testcontainer | wc -l`
while [ $a -ne $(($i+1)) ];
do
a=`crictl ps | grep testcontainer | wc -l`
done

#End timing
# End timing
end_time=$(date +%s.%N)
boot_time=$(getTiming $start_time $end_time)

echo "BootTime: ${boot_time}ms"

#Output to the corresponding file
# Output to the corresponding file
echo "${boot_time}" >> ${TIME_DAT}

}

#Kill all pods to prevent interference with testing
# Kill all pods to prevent interference with testing
crictl rm -f -a
crictl rmp -f -a

Expand Down
10 changes: 5 additions & 5 deletions tests/benchmark/scripts/kata-mem-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#$num is the number of pod
# $num is the number of pod
num=50
workdir=$(dirname $(cd $(dirname $0); pwd))
mkdir -p $workdir/json/container
mkdir -p $workdir/json/pod

#Kill all pods to prevent interference with testing
# Kill all pods to prevent interference with testing
crictl rm -f -a
crictl rmp -f -a
rm -f mem
Expand Down Expand Up @@ -76,17 +76,17 @@ do
crictl run -r kata --no-pull $workdir/json/container/container_$i.json $workdir/json/pod/pod_$i.json &
done

#Wait for all the containers to finish starting
# Wait for all the containers to finish starting
a=`crictl ps | grep testcontainer | wc -l`
while [ $a -ne $(($num+1)) ];
do
a=`crictl ps | grep testcontainer | wc -l`
done

#get pids of all containers
# Get pids of all containers
pids=$(ps -ef | grep -v grep | grep -i containerd-shim-kata-v2 | awk '{print$2}')

#get Pss of each container
# Get Pss of each container
for i in ${pids}
do
cat /proc/$i/smaps_rollup | grep "Pss" >> mem
Expand Down
10 changes: 5 additions & 5 deletions tests/benchmark/scripts/kuasar-mem-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#$num is the number of pod
# $num is the number of pod
num=50
workdir=$(dirname $(cd $(dirname $0); pwd))
mkdir -p $workdir/json/container
mkdir -p $workdir/json/pod

#remove to prevent interference with testing
# Remove to prevent interference with testing
crictl rm -f -a
crictl rmp -f -a
rm -f mem
Expand Down Expand Up @@ -81,17 +81,17 @@ do
crictl run -r kuasar --no-pull $workdir/json/container/container_$i.json $workdir/json/pod/pod_$i.json &
done

#Wait for all the containers to finish starting
# Wait for all the containers to finish starting
a=`crictl ps | grep testcontainer | wc -l`
while [ $a -ne $(($num+1)) ];
do
a=`crictl ps | grep testcontainer | wc -l`
done

#get pid of vmm-sandboxer
# Get pid of vmm-sandboxer
pid=$(ps -ef | grep -v grep | grep vmm-sandboxer | awk '{print$2}')

#get Pss of vmm-sandboxer
# Get Pss of vmm-sandboxer
cat /proc/$pid/smaps_rollup | grep "Pss" >> mem

pss_array=$(cat mem | grep -w Pss | awk '{print$2}')
Expand Down

0 comments on commit 450b96c

Please sign in to comment.