blob: bf5016b986ba750ac9366c388487c09c252f9031 [file] [log] [blame]
Scott Baker50421662016-06-27 22:09:48 -07001include ../common/Makedefs
2
3CONFIG_DIR:=$(shell pwd)
4DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
5BOOTSTRAP_YML=./docker-compose-bootstrap.yml
6DOCKER_PROJECT=cordpod
7BOOTSTRAP_PROJECT=cordpodbs
8XOS_BOOTSTRAP_PORT=81
9XOS_UI_PORT=80
10ADMIN_USERNAME=padmin@vicci.org
11ADMIN_PASSWORD=letmein
12RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
13RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
14
15.PHONY: xos
Scott Bakerbda441d2016-06-28 14:14:31 -070016xos: prereqs dirs download_xos download_services bootstrap onboarding podconfig
Scott Baker50421662016-06-27 22:09:48 -070017
18prereqs:
19 sudo make -f ../common/Makefile.prereqs
20
21dirs:
22 # if this directory doesn't exist, then docker-compose will create it with root permission
23 mkdir -p key_import
24 mkdir -p onboarding-docker-compose
25
26bootstrap:
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070027 @echo "[BOOTSTRAP]"
Scott Baker50421662016-06-27 22:09:48 -070028 sudo rm -f onboarding-docker-compose/docker-compose.yml
29 sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
30 bash ../common/wait_for_xos_port.sh 81
31 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
32 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
33 $(RUN_TOSCA_BOOTSTRAP) xos.yaml
34
Scott Bakerbda441d2016-06-28 14:14:31 -070035download_xos:
36 make -f ../common/Makefile.services xos_core
37
Scott Baker50421662016-06-27 22:09:48 -070038download_services:
39 make -f ../common/Makefile.services
40
41update_services:
42 make -f ../common/Makefile.services update
43
Scott Baker1b29f972016-07-01 09:20:58 -070044update_xos:
45 make -f ../common/Makefile.services update_xos
46
Scott Baker50421662016-06-27 22:09:48 -070047onboarding:
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070048 @echo "[ONBOARDING]"
Scott Baker50421662016-06-27 22:09:48 -070049 # on-board any services here
50 bash ../common/wait_for_onboarding_ready.sh 81 xos
51 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
52 sudo cp id_rsa key_import/vsg_rsa
53 sudo cp id_rsa.pub key_import/vsg_rsa.pub
54 sudo cp id_rsa key_import/volt_rsa
55 sudo cp id_rsa.pub key_import/volt_rsa.pub
56 sudo cp id_rsa key_import/onos_rsa
57 sudo cp id_rsa key_import/onos_rsa.pub
58 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
59 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
60 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
61 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
62 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
63 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/\fabric-onboard.yaml
64 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
65 $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
66 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
67 bash ../common/wait_for_onboarding_ready.sh 81 services/vrouter
68 bash ../common/wait_for_onboarding_ready.sh 81 services/volt
69 bash ../common/wait_for_onboarding_ready.sh 81 services/vsg
70 bash ../common/wait_for_onboarding_ready.sh 81 services/vtn
71 bash ../common/wait_for_onboarding_ready.sh 81 services/onos
72 bash ../common/wait_for_onboarding_ready.sh 81 services/fabric
73 bash ../common/wait_for_onboarding_ready.sh 81 services/vtr
74 bash ../common/wait_for_onboarding_ready.sh 81 xos
75 bash ../common/wait_for_xos_port.sh 80
76
77podconfig: nodes.yaml images.yaml
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070078 @echo "[PODCONFIG]"
Scott Baker50421662016-06-27 22:09:48 -070079 $(RUN_TOSCA) setup.yaml
80 $(RUN_TOSCA) nodes.yaml
81 $(RUN_TOSCA) images.yaml
82
83vtn: vtn-external.yaml
84 $(RUN_TOSCA) vtn-external.yaml
85
86fabric: fabric.yaml
Andy Bavierac281492016-07-19 14:32:29 -040087 cp ../../xos_services/fabric/config/network-cfg-quickstart.json .
Scott Baker50421662016-06-27 22:09:48 -070088 $(RUN_TOSCA) fabric.yaml
89
90cord: vsg_custom_images
91 $(RUN_TOSCA) mgmt-net.yaml
Andy Bavieracfadd42016-06-30 16:46:32 -040092 $(RUN_TOSCA) cord-services.yaml
Scott Baker50421662016-06-27 22:09:48 -070093 $(RUN_TOSCA) cord-volt-devices.yaml
94
Andy Bavieracfadd42016-06-30 16:46:32 -040095cord-subscriber:
96 $(RUN_TOSCA) cord-test-subscriber.yaml
97
Scott Baker50421662016-06-27 22:09:48 -070098clean-nodes:
99 rm -f nodes.yaml
100
101update-nodes: nodes.yaml
102 $(RUN_TOSCA) nodes.yaml
103
104new-nodes: clean-nodes update-nodes vtn
105
Scott Baker4b37d1a2016-07-01 13:41:52 -0700106rebuild:
107 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
108 bash ../common/wait_for_onboarding_ready.sh 81 xos
109
Scott Baker50421662016-06-27 22:09:48 -0700110exampleservice: onboard-exampleservice
111 $(RUN_TOSCA) pod-exampleservice.yaml
112
113onboard-exampleservice:
114 sudo cp id_rsa key_import/exampleservice_rsa
115 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
Scott Bakerdf81f592016-07-14 12:01:21 -0700116 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
Scott Baker50421662016-06-27 22:09:48 -0700117 bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice
118 bash ../common/wait_for_onboarding_ready.sh 81 xos
119 bash ../common/wait_for_xos_port.sh 80
120
Srikanth Vavilapallicccb0a32016-07-08 04:19:04 +0000121cord-monitoringservice: ceilometer_custom_images onboard-monitoringservice
Scott Bakerd1545d32016-06-29 11:27:33 -0700122 $(RUN_TOSCA) monitoringservice.yaml
Srikanth Vavilapallicccb0a32016-07-08 04:19:04 +0000123 $(RUN_TOSCA) monitoringtenant.yaml
Scott Baker50421662016-06-27 22:09:48 -0700124
Scott Bakerd1545d32016-06-29 11:27:33 -0700125onboard-monitoringservice: download-monitoringservice
126 sudo cp id_rsa key_import/monitoringservice_rsa
127 sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
128 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
Srikanth Vavilapalli4cf2fed2016-07-01 21:27:20 +0000129 $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml
Scott Bakerd1545d32016-06-29 11:27:33 -0700130 bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring
Scott Baker50421662016-06-27 22:09:48 -0700131 bash ../common/wait_for_onboarding_ready.sh 81 xos
132 bash ../common/wait_for_xos_port.sh 80
133
Scott Bakerd1545d32016-06-29 11:27:33 -0700134download-monitoringservice:
Scott Baker50421662016-06-27 22:09:48 -0700135 make -f ../common/Makefile.services monitoring_services
136
137nodes.yaml:
138 export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
139
140images.yaml:
141 export SETUPDIR=.; bash ../common/make-images-yaml.sh
142
143vtn-external.yaml:
144 export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
145
146fabric.yaml:
147 export SETUPDIR=.; bash ./make-fabric-yaml.sh
148
149virtualbng_json:
150 export SETUPDIR=.; bash ./make-virtualbng-json.sh
151
152vtn_network_cfg_json:
153 export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
154
155stop:
156 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
157 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
158
Scott Baker1b29f972016-07-01 09:20:58 -0700159rm: stop
160 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
161 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
Scott Baker50421662016-06-27 22:09:48 -0700162
163showlogs:
Scott Bakere80320c2016-06-30 10:21:11 -0700164 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
165
166showlogs_bootstrap:
167 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
Scott Baker50421662016-06-27 22:09:48 -0700168
169cleanup: stop rm
170 ./cleanup.sh
171 bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
172
Srikanth Vavilapallicccb0a32016-07-08 04:19:04 +0000173ceilometer_custom_images: images/ceilometer-service-trusty-server-multi-nic.img images/ceilometer-trusty-server-multi-nic.img
174 #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic)
175 bash -c "source ./admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare"
Scott Baker50421662016-06-27 22:09:48 -0700176
Scott Bakerd8d905a2016-07-18 16:04:05 -0700177vsg_custom_images: images/vsg-1.1.img
178 bash -c "source ./admin-openrc.sh; glance image-show vsg-1.1 || glance image-create --name vsg-1.1 --disk-format qcow2 --file ./images/vsg-1.1.img --container-format bare"
Scott Baker50421662016-06-27 22:09:48 -0700179
180images/ceilometer-trusty-server-multi-nic.img: images
Srikanth Vavilapallicccb0a32016-07-08 04:19:04 +0000181 bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images"
182
183images/ceilometer-service-trusty-server-multi-nic.img: images
184 #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) once image is uploaded into vicci portal
185 #bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-service-trusty-server-multi-nic || wget http://www.vicci.org/cord/ceilometer-service-trusty-server-multi-nic.compressed.qcow2 -P ./images"
Scott Baker50421662016-06-27 22:09:48 -0700186
Scott Bakerd8d905a2016-07-18 16:04:05 -0700187images/vsg-1.1.img: images
188 [ -s images/vsg-1.1.img ] || wget http://www.vicci.org/cord/vsg-1.1.img -P ./images
Scott Baker50421662016-06-27 22:09:48 -0700189
190images:
191 mkdir -p ./images
192
193.PHONY: local_containers
Scott Bakerbda441d2016-06-28 14:14:31 -0700194local_containers: prereqs download_xos
Zack Williamsefb54952016-07-02 17:21:12 -0700195 make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
Scott Baker50421662016-06-27 22:09:48 -0700196