Edge Video Infrastructure (EVI) KPI Test User Guide

ID Date Version Classification
826104 06/28/2024 1.0 Public

Feature Matching

Deploy it first:

# uninstall first
cd $pkgdir && python3 $pkgbin --uninstall

# clean environment variables
unset ${!EVI_@}
# disable all first
while read m; do
  eval export EVI_${m}_enable=false
done < <(perl -ne '$n=$1 and next if /^\s+"(\w+)":\s*{/; print "$n\n" if /^\s+"enable":/' $pkgbin)

# for backward compatibility
fmtype="${EVI_fmMasterBF_enable:+BF}"
fmname="evi-fm-master${fmtype:+-bf}"

# enable necessary ones
for m in fmMaster${fmtype} fmWorker${fmtype} hbase redis postgresql; do eval export EVI_${m}_enable=true; done
# the other configurations
source /dev/stdin <<EOF
export EVI_fmMaster${fmtype}_allowedCaptureSourceIds=2
export EVI_fmMaster${fmtype}_timeBegin=1640657550000
export EVI_fmMaster${fmtype}_timeEnd=1640658570000
export EVI_fmMaster${fmtype}_workerCount=1
export EVI_fmWorker${fmtype}_coreCount=$(($(nproc) / 2))
export EVI_fmWorker${fmtype}_cpuSetting=$(($(nproc) / 2)):0
export EVI_fmWorker${fmtype}_loadFrom=local
export EVI_fmWorker${fmtype}_localFilePath=/opt/data/features_quantized_scale475.099.dat
EOF
# check the result
for v in "${!EVI_@}"; do echo $v=${!v}; done

# install
python3 $pkgbin --install

Prepare for the KPI test:

mkdir -p kpi-test/fm && cd $_

# generate random data, 8kw FVs
sudo chmod 777 /home/fmlocal/
gen-rand-fv /home/fmlocal/features_quantized_scale475.099.dat

# if it is a multi-node cluster,
# copy the generated data to all the nodes with fm-worker instance

# forward FM port to localhost
kubectl -n smartedge-apps port-forward svc/$fmname 8080 >/dev/null &

Send request and check the KPI data from the logs:

It will take about several minutes to load data at the first time.

# for batch size 1
for i in {1..4}; do
  fm-req >/dev/null 2>&1 \
  && kubectl -n smartedge-apps logs --tail 8 -l app=$fmname \
  | perl -ne 'print "$1\n" if /\b(throughput:\s+\d+)/'
done
# throughput: 4183960933

# for batch size 32
for i in {1..4}; do
  FM_BATCH_SIZE=32 fm-req >/dev/null 2>&1 \
  && kubectl -n smartedge-apps logs --tail 8 -l app=$fmname \
  | perl -ne 'print "$1\n" if /\b(throughput:\s+\d+)/'
done
# throughput: 91649507124