-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize_mongo_data.sh
More file actions
executable file
·22 lines (14 loc) · 1.04 KB
/
initialize_mongo_data.sh
File metadata and controls
executable file
·22 lines (14 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
export MONGO_URL=`curl localhost:7777/v1/deployments/$1/services | jq '.data."mongo-serve".publicUrl' | cut -d'"' -f2`
export DEPLOYER_URL=`curl localhost:7777/v1/deployments/$1/services | jq '.data."deployer".publicUrl' | cut -d'"' -f2`
export PROFILER_URL=`curl localhost:7777/v1/deployments/$1/services | jq '.data."workload-profiler".publicUrl' | cut -d'"' -f2`
export MONGO_POD=`kubectl get pods | grep mongo-serve | cut -d" " -f1`
kubectl exec -it $MONGO_POD -- mongo $MONGO_URL/admin --eval "db.createUser({user: 'analyzer', pwd: 'hyperpilot', roles: [ 'root' ]})"
mongo $MONGO_URL/admin -u analyzer -p hyperpilot benchmarks/create-dbuser.js
(cd workloads/sizing-demo && ./update_db.sh $MONGO_URL) || cd ../..
pwd
(cd benchmarks && python collect_benchmarks.py $MONGO_URL) || cd ..
(cd workloads && python collect_applications.py $MONGO_URL) || cd ..
(cd workloads/common/ && ./upload.sh $DEPLOYER_URL) || cd ../../
echo "Workload profiler is available at: $PROFILER_URL"
echo "Please run calibration first before running other runs"