-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor scripts and remove unused YAML files
- Loading branch information
1 parent
03820ba
commit e172e1a
Showing
7 changed files
with
62 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,71 @@ | ||
#!/bin/bash -eux | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 <prefix>" | ||
if [ "$#" -ne 3 ]; then | ||
echo "Usage: $0 <type> <prefix> <rps>" | ||
exit 1 | ||
fi | ||
|
||
PREFIX=$1 | ||
TYPE=$1 | ||
PREFIX=$2 | ||
RPS=#3 | ||
|
||
URL="http://10.229.71.125:32001" | ||
ENVID=main | ||
DURATION=300 | ||
CONN=1 | ||
RPS=1000 | ||
PAYLOAD=1000 | ||
# TYPE=base | ||
# TYPE=base+picop | ||
# TYPE=base+gw+istio | ||
# TYPE=base+gw+picop | ||
|
||
INTERVAL=10 | ||
DURATION=300 | ||
CLIENT=1 | ||
|
||
NAME="$PREFIX/$ENVID-$CONN-$RPS-$DURATION-$PAYLOAD-$INTERVAL" | ||
TIMESTAMP=$(date +%s) | ||
NAME="$PREFIX/$TYPE/$CLIENT-$RPS-$DURATION/$TIMESTAMP" | ||
|
||
CMD="/usr/local/go/bin/go run ./script/main.go --url $URL --env-id $ENVID --req-per-sec $RPS --duration $DURATION --client-num $CONN --payload $PAYLOAD --picop" | ||
if [ "$TYPE" = "base" ]; then | ||
echo "Invalid type: $TYPE" | ||
exit 1 | ||
# URL="http://service-istio.service-istio.svc.cluster.local:32001" | ||
# OPTION="" | ||
# NS="service" | ||
elif [ "$TYPE" = "base+picop" ]; then | ||
echo "Invalid type: $TYPE" | ||
exit 1 | ||
# URL="http://service-istio.service-istio.svc.cluster.local:31002" | ||
# OPTION="--picop" | ||
# NS="service" | ||
elif [ "$TYPE" = "base+gw+istio" ]; then | ||
URL="http://service-istio.service-istio.svc.cluster.local:30001" | ||
OPTION="" | ||
NS="service-istio" | ||
elif [ "$TYPE" = "base+gw+picop" ]; then | ||
URL="http://proxy-both.service.svc.cluster.local:30002" | ||
OPTION="--picop" | ||
NS="service" | ||
else | ||
echo "Invalid type: $TYPE" | ||
exit 1 | ||
fi | ||
|
||
echo "NAME: $NAME" | ||
echo "TIMESTAMP: $TIMESTAMP" | ||
CMD="/usr/local/go/bin/go run script/main.go --url $URL --env-id main --req-per-sec $RPS --duration $DURATION --client-num $CLIENT --payload 1000 $OPTION" | ||
|
||
cleanup() { | ||
echo "SIGINT received, cleaning up..." | ||
ssh onoe-benchmark "pkill -2 --echo 'go'" | ||
ssh onoe-benchmark "pkill -2 --echo 'tee'" | ||
ssh onoe-benchmark "pkill -2 --echo 'exec-cmd.sh'" | ||
ssh onoe-benchmark-1 "pkill -2 --echo 'go'" | ||
|
||
kill $(jobs -p) | ||
exit 1 | ||
} | ||
|
||
trap 'cleanup' SIGINT | ||
|
||
ssh onoe-benchmark "cd benchmark/consumption && ./exec-cmd.sh '$CMD' ./data/cmd/$NAME $TIMESTAMP" & | ||
ssh onoe-benchmark-1 "cd benchmark/delay && $CMD" & | ||
|
||
go run ./collect/main.go -name $NAME -timestamp $TIMESTAMP -dir ./data/input -interval $INTERVAL -duration $DURATION kubectl top pod -n service-proxy & | ||
go run ./collect/main.go -name ./data/input/$NAME -timestamp $TIMESTAMP -interval $INTERVAL -duration $DURATION kubectl top pod -n $NS --containers & | ||
|
||
wait | ||
|
||
mkdir -p ./data/cmd/$NAME | ||
scp onoe-benchmark:benchmark/consumption/data/cmd/$NAME/$TIMESTAMP.txt ./data/cmd/$NAME/$TIMESTAMP.txt | ||
mkdir -p ./data/$PREFIX/$TYPE/$CLIENT-$RPS-$DURATION | ||
go run ./parse/main.go -name $NAME -timestamp $TIMESTAMP -input ./data/input -output ./data/output | ||
|
||
echo "NAME: $NAME" | ||
echo "CMD: $CMD" | ||
echo "TIMESTAMP: $TIMESTAMP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
#!/bin/bash -eux | ||
#!/bin/bash -ux | ||
|
||
# # dsb-hr namespaceのdeploymentのname一覧を取得 | ||
# deployments=$(kubectl get deployments -n dsb-hr -o jsonpath='{.items[*].metadata.name}') | ||
cd istio | ||
kubectl delete -f namespace.yaml | ||
kubectl apply -f namespace.yaml | ||
kubectl apply -f gateway.yaml | ||
kubectl apply -f vs.yaml | ||
kubectl apply -f ingressgateway-svc.yaml | ||
|
||
# # 取得したdeploymentそれぞれでkubectl rollout restartコマンドを実行 | ||
# for deployment in $deployments | ||
# do | ||
# kubectl rollout restart deployment/$deployment -n dsb-hr | ||
# echo "Restarted deployment: $deployment" | ||
# done | ||
cd ../kubernetes/manifests | ||
|
||
kubectl delete -Rf ./kubernetes/manifests | ||
kubectl apply -Rf ./kubernetes/manifests | ||
kubectl delete -f namespace.yaml | ||
kubectl apply -f namespace.yaml | ||
kubectl apply -f proxy-both.yaml | ||
./script/create-service.sh http main 32001 | kubectl -n service apply -f - | ||
./script/create-service.sh http main 32002 | kubectl -n service-istio apply -f - |