-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstartTop.sh
executable file
·38 lines (36 loc) · 1.39 KB
/
startTop.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
if [[ $# -ne 3 ]] ; then
echo "Expected 3 CLI arguments - Number of worker nodes and sub-directory & experiment directory to save output"
exit 1
fi
numWorkerNodes="$1"
experimentDir="$2"
pcsDir="$3"
startNodeNum=0
endNodeNum=$((0 + numWorkerNodes))
ocmd="cd /opt/ && mkdir -p Experiments && cd Experiments && mkdir -p $experimentDir && cd $experimentDir && mkdir -p $pcsDir && cd $pcsDir && rm -f top_data_*.txt && (bash /opt/scripts/topFile.sh > /dev/null 2>&1 &)"
ktcmd="cd /opt/Experiments/$experimentDir/$pcsDir && rm -f kt_data.txt && (bash /opt/scripts/ktopFile.sh > /dev/null 2>&1 &)"
dscmd="cd /opt/Experiments/$experimentDir/$pcsDir && rm -f docker_data_*.txt && (bash /opt/scripts/dockerStats.sh > /dev/null 2>&1 &)"
psscmd="cd /opt/Experiments/$experimentDir/$pcsDir && rm -f open5gs*_ss.txt && (bash /opt/scripts/ssPodOp.sh > /dev/null 2>&1 &)"
wcmd="$ocmd && exit"
dswcmd="$dscmd && exit"
for i in $(seq $startNodeNum $endNodeNum);
do
node=node$i
echo ""
echo "Starting top-start script on Node - $node"
echo ""
if [[ $i -eq 0 ]] ; then
eval "$ocmd"
eval "$ktcmd"
eval "$dscmd"
eval "$psscmd"
else
ssh -o StrictHostKeyChecking=no root@$node "$wcmd"
ssh -o StrictHostKeyChecking=no root@$node "$dswcmd"
fi
echo ""
echo "Started top-start script on Node - $node"
echo ""
nodeNum=$((nodeNum + 1))
done