-
Notifications
You must be signed in to change notification settings - Fork 0
/
01_prepare_setup.sh
83 lines (68 loc) · 2.21 KB
/
01_prepare_setup.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
/bin/bash create_job_file.sh
server=`grep "^server" config.file | awk -F "=" '{print $2}'`
#sample=`grep "^sample" config.file | awk -F "=" '{print $2}'`
storage=`grep "^storage(Gi)" config.file | awk -F "=" '{print $2}'`
storage_type=`grep "^storage_type" config.file | awk -F "=" '{print $2}'`
platform=`grep "^platform" config.file | awk -F "=" '{print $2}'`
#export sample=${sample}
export storage=${storage}
#export storage_type=${storage_type}
#export prefill=${prefill}
pfile=prefill.fio
job_info=job_info.txt
run_test () {
/bin/bash preflight_check.sh
/bin/bash delete_simple_fio.sh
namespace="simple-fio"
server_ip=server_ip.txt
> $server_ip
for ((i=0;i<$server;i++));
do
export srv=${i}
if [[ `grep "^storage_type" config.file | awk -F "=" '{print $2}'` =~ "ceph-rbd" ]]; then
sc=$(oc get sc | grep rbd | awk '{print $1}')
export sc=${sc}
envsubst < blk-pvc.yaml | oc create -f -
sleep 20
envsubst < blk-server.yaml | oc create -f -
elif [[ `grep "^storage_type" config.file | awk -F "=" '{print $2}'` =~ "cephfs" ]]; then
sc=$(oc get sc | grep cephfs | awk '{print $1}')
export sc=${sc}
envsubst < fs-pvc.yaml | oc create -f -
sleep 20
envsubst < fs-server.yaml | oc create -f -
fi
oc wait pod --for=condition=Ready -l app=fio-server --timeout=1h > /dev/null
pod=`echo fio-server${i}`
serverIP=`oc get pod ${pod} -n ${namespace} --template '{{.status.podIP}}'`
echo $serverIP >> $server_ip
done
oc get pvc
oc create configmap fio-server-ip --from-file=${server_ip}
sleep 10
prefill=`grep "^prefill" config.file | awk -F "=" '{print $2}'`
if [[ $prefill == "true" ]]; then
oc create configmap fio-prefill-job --from-file=${pfile}
oc create configmap fio-prefill-info --from-file=${job_info}
oc create -f prefill.yaml
# oc wait pod --for=condition=Ready -l app=fio-prefill --timeout=1h > /dev/null
fi
}
if [ $platform == "bm" ]; then
run_test
elif [ $platform == "hcp" ]; then
# Switch to the main / base / provider cluster
oc config use admin
for consumer in $(cat consumers.lst)
do
oc config use $consumer
run_test
#oc get pods
done
fi
rm -f ${server_ip} ${pfile} ${job_info}
rm -f ${pfile}
#---------------
# End of script
#---------------