blob: 59e526f5d19e4a1fb3987475c3eba294d1912d5c [file] [log] [blame]
Pingping Linb7a7d2b2016-08-19 18:11:36 +00001include ../common/Makedefs
2
3CONFIG_DIR:=$(shell pwd)
4DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
5BOOTSTRAP_YML=./docker-compose-bootstrap.yml
6DOCKER_PROJECT=mcord
7BOOTSTRAP_PROJECT=mcordbs
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
Matteo Scandolob286a6a2016-10-03 13:27:00 -070016xos: prereqs dirs download_xos download_services bootstrap onboarding podconfig slicing-ui
Pingping Linb7a7d2b2016-08-19 18:11:36 +000017
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:
27 @echo "[BOOTSTRAP]"
28 @echo "XOS Image Build Date: `docker inspect -f '{{ .Created }}' xosproject/xos`"
29 @echo "XOS Image Commit Hash: `docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_HASH }}' xosproject/xos`"
30 @echo "XOS Image Commit Date: `docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_DATE }}' xosproject/xos`"
31 sudo rm -f onboarding-docker-compose/docker-compose.yml
32 sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
Matteo Scandolod6440302016-10-03 11:33:06 -070033 bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
Pingping Linb7a7d2b2016-08-19 18:11:36 +000034 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
35 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
36 $(RUN_TOSCA_BOOTSTRAP) xos.yaml
37
38download_xos:
39 make -f ../common/Makefile.services xos_core
40
41download_services:
42 make -f ../common/Makefile.services
43
44update_services:
45 make -f ../common/Makefile.services update
46
47update_xos:
48 make -f ../common/Makefile.services update_xos
49
50onboarding:
51 @echo "[ONBOARDING]"
52 # on-board any services here
Matteo Scandolod6440302016-10-03 11:33:06 -070053 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
Pingping Linb7a7d2b2016-08-19 18:11:36 +000054 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
Pingping Linb5a1a0a2016-09-08 01:14:48 +000055
Pingping Linb7a7d2b2016-08-19 18:11:36 +000056 sudo cp id_rsa key_import/vBBU_rsa
57 sudo cp id_rsa.pub key_import/vBBU_rsa.pub
Pingping Lineb05ccd2016-09-19 21:23:59 +000058 sudo cp id_rsa key_import/vPGWC_rsa
59 sudo cp id_rsa.pub key_import/vPGWC_rsa.pub
Pingping Linb7a7d2b2016-08-19 18:11:36 +000060 sudo cp id_rsa key_import/onos_rsa
61 sudo cp id_rsa key_import/onos_rsa.pub
62 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml
Pingping Lin37e727c2016-08-29 23:02:12 +000063 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vBBU/xos/vBBU-onboard.yaml
Pingping Lin97c12612016-09-19 23:40:53 +000064 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vPGWC/xos/vPGWC-onboard.yaml
Pingping Linb7a7d2b2016-08-19 18:11:36 +000065 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
66 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
Matteo Scandolob286a6a2016-10-03 13:27:00 -070067 # $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/\fabric-onboard.yaml
Pingping Linb7a7d2b2016-08-19 18:11:36 +000068 $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
69 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
Matteo Scandolod6440302016-10-03 11:33:06 -070070 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vbbu
71 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vpgwc
72 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vtn
73 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/onos
Matteo Scandolob286a6a2016-10-03 13:27:00 -070074 # bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/fabric
Matteo Scandolod6440302016-10-03 11:33:06 -070075 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
76 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
Pingping Linb7a7d2b2016-08-19 18:11:36 +000077
78podconfig: nodes.yaml images.yaml
79 @echo "[PODCONFIG]"
80 $(RUN_TOSCA) setup.yaml
81 $(RUN_TOSCA) nodes.yaml
82 $(RUN_TOSCA) images.yaml
83
84vtn: vtn-external.yaml
85 $(RUN_TOSCA) vtn-external.yaml
86
87delete_fabric_config:
88 http -a karaf:karaf DELETE http://onos-fabric:8181/onos/v1/network/configuration/
89
90fabric: fabric.yaml
91 cp ../../xos_services/fabric/config/network-cfg-quickstart.json .
92 $(RUN_TOSCA) fabric.yaml
93
94#cord: vsg_custom_images
Pingping Lin82366d32016-08-31 00:21:56 +000095mcord:
96 $(RUN_TOSCA) mgmt-net.yaml
97 $(RUN_TOSCA) mcord.yaml
Pingping Linb7a7d2b2016-08-19 18:11:36 +000098# $(RUN_TOSCA) cord-volt-devices.yaml
99
100#cord-subscriber:
101# $(RUN_TOSCA) cord-test-subscriber.yaml
102
103clean-nodes:
104 rm -f nodes.yaml
105
106update-nodes: nodes.yaml
107 $(RUN_TOSCA) nodes.yaml
108
109new-nodes: clean-nodes update-nodes vtn
110
111rebuild:
112 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
Matteo Scandolod6440302016-10-03 11:33:06 -0700113 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
Pingping Linb7a7d2b2016-08-19 18:11:36 +0000114
115exampleservice: onboard-exampleservice
116 $(RUN_TOSCA) pod-exampleservice.yaml
117
118onboard-exampleservice:
119 sudo cp id_rsa key_import/exampleservice_rsa
120 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
121 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
122 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
123 $(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml
124 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
Matteo Scandolod6440302016-10-03 11:33:06 -0700125 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
126 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
127 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
Pingping Linb7a7d2b2016-08-19 18:11:36 +0000128
129cord-monitoringservice: ceilometer_custom_images onboard-monitoringservice
130 $(RUN_TOSCA) monitoringservice.yaml
131 $(RUN_TOSCA) monitoringtenant.yaml
132
133onboard-monitoringservice: download-monitoringservice
134 sudo cp id_rsa key_import/monitoringservice_rsa
135 sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
136 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
137 $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml
Matteo Scandolod6440302016-10-03 11:33:06 -0700138 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
139 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
140 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
Pingping Linb7a7d2b2016-08-19 18:11:36 +0000141
142download-monitoringservice:
143 make -f ../common/Makefile.services monitoring_services
144
145nodes.yaml:
146 export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
147
148images.yaml:
149 export SETUPDIR=.; bash ../common/make-images-yaml.sh
150
151vtn-external.yaml:
152 export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
153
154fabric.yaml:
155 export SETUPDIR=.; bash ./make-fabric-yaml.sh
156
157virtualbng_json:
158 export SETUPDIR=.; bash ./make-virtualbng-json.sh
159
160vtn_network_cfg_json:
161 export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
162
163stop:
164 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
165 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
166
167rm: stop
168 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
169 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
170
171showlogs:
172 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
173
174showlogs_bootstrap:
175 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
176
177cleanup: stop rm
178 ./cleanup.sh
179 bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
180
181ceilometer_custom_images: images/ceilometer-service-trusty-server-multi-nic.img images/ceilometer-trusty-server-multi-nic.img
182 #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic)
183 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"
184
185#vsg_custom_images: images/vsg-1.1.img
Pingping Lin5681d7d2016-09-13 23:29:50 +0000186# 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"
Pingping Linb7a7d2b2016-08-19 18:11:36 +0000187
188images/ceilometer-trusty-server-multi-nic.img: images
189 bash -c "source ./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"
190
191images/ceilometer-service-trusty-server-multi-nic.img: images
192 #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) once image is uploaded into vicci portal
193 #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"
194
195#images/vsg-1.1.img: images
196# [ -s images/vsg-1.1.img ] || wget http://www.vicci.org/cord/vsg-1.1.img -P ./images
197
198images:
199 mkdir -p ./images
200
201.PHONY: local_containers
202local_containers: prereqs download_xos
203 make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
204
Matteo Scandoloc55c0572016-10-04 08:42:38 -0700205onboard-slicing: slicing-ui
206 @echo "[ONBOARDING]"
207 # on-board slicing services here
208 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
209 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
210 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/mcord_slicing_ui/xos/mcord-slicing-onboard.yaml
211 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/mcord_slicing_ui
212 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
213 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
214
Matteo Scandolo1105c5b2016-10-03 11:25:34 -0700215slicing-ui:
216 $(RUN_TOSCA) ./mcord-slicing-ui.yaml