aboutsummaryrefslogtreecommitdiffstats
path: root/performanceTests/Makefile
blob: 26872fc2e7c566c13cee4cd5658265b1766e1018 (plain)
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
all: copy-performanceTests run-performanceTests copy-jmeter copy-collectd install-collectd


RKE_NODE_USER_AND_HOSTNAME = <RKE_USER>@<RKE_IP> # for example ubuntu@10.183.36.205
RKE_PRIVATE_KEY = <PEM_PRIVATE_KEY_FILE_PATH> # for example ~/.ssh/onap-5802.pem
PERFORMANCE_TESTS_DIRECTORY = vesPerformanceTestsEnv
RKE_KUBECONFIG_FILE_PATH = /home/ubuntu/.kube/config.onap

#Configuration for jMeter
JMETER_VM_USER_AND_HOSTNAME = <RKE_USER>@<VM_IP> # for example root@10.183.36.50
JMETER_VM_PRIVATE_KEY = <PEM_PRIVATE_KEY_FILE_PATH> # for example ~/.ssh/onap-5802.pem


restart: clear-performanceTests remove-performanceTests remove-jmeter remove-collectd all

copy-performanceTests:
	@echo "\n##### Copy performance tests directory to lab environment #####"
	scp -r -i $(RKE_PRIVATE_KEY) ./k8s $(RKE_NODE_USER_AND_HOSTNAME):$(PERFORMANCE_TESTS_DIRECTORY)
	@echo "##### DONE #####"

run-performanceTests:
	@echo "\n##### Run prometheus and grafana in lab environment #####"
	ssh -i $(RKE_PRIVATE_KEY) $(RKE_NODE_USER_AND_HOSTNAME) 'bash -c "export KUBECONFIG=$(RKE_KUBECONFIG_FILE_PATH) && cd $(PERFORMANCE_TESTS_DIRECTORY) && make all"'
	@echo "##### DONE #####"

clear-performanceTests:
	@echo "\n##### Stop and clear prometheus and grafana in lab environment #####"
	ssh -i $(RKE_PRIVATE_KEY) $(RKE_NODE_USER_AND_HOSTNAME) 'bash -c "export KUBECONFIG=$(RKE_KUBECONFIG_FILE_PATH) && cd $(PERFORMANCE_TESTS_DIRECTORY) && make clear"'
	@echo "##### DONE #####"

remove-performanceTests:
	@echo "\n##### Remove performance tests  #####"
	ssh -i $(RKE_PRIVATE_KEY) $(RKE_NODE_USER_AND_HOSTNAME) 'bash -c "export KUBECONFIG=$(RKE_KUBECONFIG_FILE_PATH) && rm -rf $(PERFORMANCE_TESTS_DIRECTORY)"'
	@echo "##### DONE #####"

copy-collectd:
	@echo "\n##### Copy collectd to JMeter VM #####"
	scp -r -i $(JMETER_VM_PRIVATE_KEY) ./k8s/collectd $(JMETER_VM_USER_AND_HOSTNAME):collectd
	@echo "##### DONE #####"

install-collectd:
	@echo "\n##### Install collectd on JMeter VM #####"
	ssh -i $(JMETER_VM_PRIVATE_KEY) $(JMETER_VM_USER_AND_HOSTNAME) 'cd collectd && make'
	@echo "##### DONE #####"

remove-collectd:
	@echo "\n##### Remove collectd  #####"
	ssh -i $(JMETER_VM_PRIVATE_KEY) $(JMETER_VM_USER_AND_HOSTNAME) 'rm -rf collectd'
	@echo "##### DONE #####"

copy-jmeter:
	@echo "\n##### Copy JMeter #####"
	scp -r -i $(JMETER_VM_PRIVATE_KEY) ./k8s/testScenario $(JMETER_VM_USER_AND_HOSTNAME):$(PERFORMANCE_TESTS_DIRECTORY)
	@echo "##### DONE #####"

run-jmeter:
	@echo "\n##### Run test scenario  #####"
	ssh -i $(JMETER_VM_PRIVATE_KEY) $(JMETER_VM_USER_AND_HOSTNAME) '/bin/bash ./$(PERFORMANCE_TESTS_DIRECTORY)/run_jmeter.sh'
	@echo "##### DONE #####"

remove-jmeter:
	@echo "\n##### Remove JMeter  #####"
	ssh -i $(JMETER_VM_PRIVATE_KEY) $(JMETER_VM_USER_AND_HOSTNAME) 'rm -rf $(PERFORMANCE_TESTS_DIRECTORY)'
	@echo "##### DONE #####"