blob: 70bf1be9ee99308e73c325607ec9b129cb5d17dc [file] [log] [blame]
Zack Williams3670f442016-10-04 17:37:12 -07001# cord-pod/Makefile
Scott Baker50421662016-06-27 22:09:48 -07002
Zack Williams3670f442016-10-04 17:37:12 -07003CONFIG_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
4COMMON_DIR := $(abspath ../common )
Scott Baker50421662016-06-27 22:09:48 -07005
Zack Williams3670f442016-10-04 17:37:12 -07006.DEFAULT_GOAL := xos
Scott Baker50421662016-06-27 22:09:48 -07007
Zack Williams3670f442016-10-04 17:37:12 -07008DOCKER_PROJECT ?= cordpod
9BOOTSTRAP_PROJECT ?= cordpodbs
Scott Baker50421662016-06-27 22:09:48 -070010
Matteo Scandoloa317b872017-01-10 12:02:41 -080011XOS_UI_PORT := 9000
Scott Baker0d369d12016-11-08 16:37:30 -080012
Zack Williams3670f442016-10-04 17:37:12 -070013# Include common functions
14include $(COMMON_DIR)/Makefile
Scott Baker50421662016-06-27 22:09:48 -070015
Matteo Scandoloa317b872017-01-10 12:02:41 -080016xos: prereqs config_dirs xos_download cord_services cord_libraries bootstrap onboarding rest-gw ui
Scott Baker50421662016-06-27 22:09:48 -070017
Zack Williams3670f442016-10-04 17:37:12 -070018onboarding: synchronizers.yaml id_rsa id_rsa.pub
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070019 @echo "[ONBOARDING]"
Scott Baker50421662016-06-27 22:09:48 -070020 # on-board any services here
Zack Williams3670f442016-10-04 17:37:12 -070021 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
22 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
Scott Baker50421662016-06-27 22:09:48 -070023 sudo cp id_rsa key_import/vsg_rsa
24 sudo cp id_rsa.pub key_import/vsg_rsa.pub
25 sudo cp id_rsa key_import/volt_rsa
26 sudo cp id_rsa.pub key_import/volt_rsa.pub
27 sudo cp id_rsa key_import/onos_rsa
28 sudo cp id_rsa key_import/onos_rsa.pub
Scott Bakerda3b1592016-10-24 10:45:36 -070029 $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml
Scott Baker989959c2016-08-11 19:22:52 -070030 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml
Scott Baker50421662016-06-27 22:09:48 -070031 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
32 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
33 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
34 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
35 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -070036 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/fabric-onboard.yaml
Scott Baker50421662016-06-27 22:09:48 -070037 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
38 $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
Zack Williams3670f442016-10-04 17:37:12 -070039 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
Scott Bakerda3b1592016-10-24 10:45:36 -070040 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/ng-xos-lib
Zack Williams3670f442016-10-04 17:37:12 -070041 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vrouter
42 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/volt
43 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vsg
44 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtn
45 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
46 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/fabric
47 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtr
48 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
49 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Zack Williamscf1f9c82016-11-08 22:19:02 -070050 sleep 120
Scott Baker50421662016-06-27 22:09:48 -070051
Zack Williamscf1f9c82016-11-08 22:19:02 -070052nodes: nodes.yaml
53 @echo "[NODES]"
54 $(RUN_TOSCA) openstack.yaml
Scott Baker50421662016-06-27 22:09:48 -070055 $(RUN_TOSCA) nodes.yaml
Zack Williamscf1f9c82016-11-08 22:19:02 -070056 sleep 10
Scott Baker50421662016-06-27 22:09:48 -070057
Zack Williamscf1f9c82016-11-08 22:19:02 -070058vtn: nodes vtn.yaml
59 @echo "[VTN]"
60 $(RUN_TOSCA) vtn.yaml
Zack Williamsd7d58f12016-10-24 23:11:06 -070061
Andy Bavier712e1342016-07-28 17:01:53 -040062delete_fabric_config:
Andy Bavier655abfe2017-01-20 11:02:58 -050063 @echo "[removing fabric configuration]"
Andy Bavierabdbf302016-07-28 20:25:53 -040064 http -a karaf:karaf DELETE http://onos-fabric:8181/onos/v1/network/configuration/
Andy Bavier712e1342016-07-28 17:01:53 -040065
66reactivate_fabric_apps:
Andy Bavier655abfe2017-01-20 11:02:58 -050067 @echo "[reactivating fabric apps]"
Andy Bavierabdbf302016-07-28 20:25:53 -040068 http -a karaf:karaf POST http://onos-fabric:8181/onos/v1/applications/org.onosproject.vrouter/active
69 http -a karaf:karaf POST http://onos-fabric:8181/onos/v1/applications/org.onosproject.segmentrouting/active
Andy Bavier712e1342016-07-28 17:01:53 -040070
Andy Bavier655abfe2017-01-20 11:02:58 -050071fabric-xconnect.json:
72 cp $(SERVICE_DIR)/fabric/config/ciab-fabric-xconnect.json ./fabric-xconnect.json
73
74network-cfg-quickstart.json: fabric-xconnect.json
75 @echo "[generating fabric config]"
76 cord generate > cord-generate.json
77 @echo "[adding VLAN crossconnects]"
78 jq -s '.[0] + .[1]' cord-generate.json fabric-xconnect.json > temp1
79 @echo "[specifying ofdpa-cpqd driver]"
80 jq '.devices[].basic.driver = "ofdpa-cpqd"' temp1 > network-cfg-quickstart.json
81
82fabric: network-cfg-quickstart.json
Zack Williamscf1f9c82016-11-08 22:19:02 -070083 @echo "[FABRIC]"
Scott Baker50421662016-06-27 22:09:48 -070084 $(RUN_TOSCA) fabric.yaml
Zack Williamscf1f9c82016-11-08 22:19:02 -070085 sleep 20
Scott Baker50421662016-06-27 22:09:48 -070086
Zack Williamscf1f9c82016-11-08 22:19:02 -070087cord:
88 @echo "[CORD]"
89 $(RUN_TOSCA) management-net.yaml
Andy Bavieracfadd42016-06-30 16:46:32 -040090 $(RUN_TOSCA) cord-services.yaml
Zack Williamscf1f9c82016-11-08 22:19:02 -070091 $(RUN_TOSCA) public-net.yaml
Zack Williams3670f442016-10-04 17:37:12 -070092 $(RUN_TOSCA) $(COMMON_DIR)/tosca/cord-volt-devices.yaml
93
Matteo Scandolo44bf8912016-11-21 13:56:04 -080094vrouter:
95 $(RUN_TOSCA) ./vrouter.yaml
96
Andy Bavieracfadd42016-06-30 16:46:32 -040097cord-subscriber:
Zack Williamscf1f9c82016-11-08 22:19:02 -070098 @echo "[CORD-SUBSCRIBER]"
Andy Bavieracfadd42016-06-30 16:46:32 -040099 $(RUN_TOSCA) cord-test-subscriber.yaml
Zack Williamscf1f9c82016-11-08 22:19:02 -0700100 sleep 60
Andy Bavieracfadd42016-06-30 16:46:32 -0400101
Zack Williamscf1f9c82016-11-08 22:19:02 -0700102exampleservice: $(SERVICE_DIR)/exampleservice
103 @echo "[EXAMPLESERVICE]"
Scott Baker50421662016-06-27 22:09:48 -0700104 sudo cp id_rsa key_import/exampleservice_rsa
105 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
Zack Williams3670f442016-10-04 17:37:12 -0700106 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/disable-onboarding.yaml
Scott Bakerdf81f592016-07-14 12:01:21 -0700107 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
Scott Baker78ea35a2016-07-25 08:55:16 -0700108 $(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml
Zack Williams3670f442016-10-04 17:37:12 -0700109 $(RUN_TOSCA_BOOTSTRAP) $(COMMON_DIR)/tosca/enable-onboarding.yaml
110 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
111 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
112 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Zack Williamscf1f9c82016-11-08 22:19:02 -0700113 $(RUN_TOSCA) exampleservice.yaml
114 sleep 60
Scott Baker50421662016-06-27 22:09:48 -0700115
Zack Williamscf1f9c82016-11-08 22:19:02 -0700116cord-monitoringservice: $(SERVICE_DIR)/monitoring
117 @echo "[CORD-MONITORINGSERVICE]"
Scott Bakerd1545d32016-06-29 11:27:33 -0700118 sudo cp id_rsa key_import/monitoringservice_rsa
119 sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
120 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
Srikanth Vavilapalli4cf2fed2016-07-01 21:27:20 +0000121 $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml
Zack Williams3670f442016-10-04 17:37:12 -0700122 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
123 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
124 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Zack Williamscf1f9c82016-11-08 22:19:02 -0700125 $(RUN_TOSCA) monitoringservice.yaml
126 $(RUN_TOSCA) monitoringtenant.yaml
Srikanth Vavilapalli6594b752016-12-13 00:31:13 +0000127 @echo "waiting for monitoring service to be fully ready...."
128 ansible-playbook -i local $(SERVICE_DIR)/monitoring/xos/test/monitoring_test_initial.yaml
Scott Baker50421662016-06-27 22:09:48 -0700129
Zack Williamscf1f9c82016-11-08 22:19:02 -0700130rebuild-monitoringservice:
131 bash $(COMMON_DIR)/rebuild.sh $(XOS_BOOTSTRAP_PORT) monitoring
132 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
Srikanth Vavilapalli0fc7de72016-11-03 17:49:11 +0000133
Srikanth Vavilapalli924844d2017-01-20 19:19:43 +0000134rebuild-exampleservice:
135 bash $(COMMON_DIR)/rebuild.sh $(XOS_BOOTSTRAP_PORT) exampleservice
136 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
137
Srikanth Vavilapalli7da3c5e2016-10-13 17:50:21 +0000138install-inframonitoring-agents:
139 bash $(SERVICE_DIR)/monitoring/xos/synchronizer/ceilometer/monitoring_agent/install_monitoring_ceilometer.sh
140
141enable-inframonitoring: inframonitoring_yaml
142 $(RUN_TOSCA) inframonitoring.yaml
Srikanth Vavilapalli6594b752016-12-13 00:31:13 +0000143 @echo "Validate if infra metrics are available...."
144 ansible-playbook -i local $(SERVICE_DIR)/monitoring/xos/test/monitoring_test_inframetrics.yaml
Srikanth Vavilapalli7da3c5e2016-10-13 17:50:21 +0000145
146enable-vsgmonitoring:
147 $(RUN_TOSCA) vsgmonitoring.yaml
Srikanth Vavilapalli6594b752016-12-13 00:31:13 +0000148 @echo "Validate if vSG metrics are available...."
149 ansible-playbook -i local $(SERVICE_DIR)/monitoring/xos/test/monitoring_test_vsgmetrics.yaml
Srikanth Vavilapalli7da3c5e2016-10-13 17:50:21 +0000150
151enable-exampleservicemonitoring:
152 $(RUN_TOSCA) exampleservicemonitoring.yaml
Srikanth Vavilapalli924844d2017-01-20 19:19:43 +0000153 @echo "Validate if exampleservice metrics are available...."
154 ansible-playbook -i local $(SERVICE_DIR)/monitoring/xos/test/monitoring_test_exampleservicemetrics.yaml
Srikanth Vavilapalli7da3c5e2016-10-13 17:50:21 +0000155
156inframonitoring_yaml:
157 export SETUPDIR=$(CONFIG_DIR); bash ./make-inframonitoring-yaml.sh
158
Scott Baker50421662016-06-27 22:09:48 -0700159virtualbng_json:
Zack Williams3670f442016-10-04 17:37:12 -0700160 export SETUPDIR=$(CONFIG_DIR); bash ./make-virtualbng-json.sh