blob: 736175073d132b4dd07d487d37bac8313e7291c7 [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
16xos: prereqs dirs download_xos download_services bootstrap onboarding podconfig
17
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
33 bash ../common/wait_for_xos_port.sh 81
34 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
53 bash ../common/wait_for_onboarding_ready.sh 81 xos
54 $(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
67 #$(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
Pingping Lin09e613e2016-09-01 00:14:32 +000070 bash ../common/wait_for_onboarding_ready.sh 81 services/vbbu
Pingping Lin97c12612016-09-19 23:40:53 +000071 bash ../common/wait_for_onboarding_ready.sh 81 services/vpgwc
Pingping Linb7a7d2b2016-08-19 18:11:36 +000072 bash ../common/wait_for_onboarding_ready.sh 81 services/vtn
73 bash ../common/wait_for_onboarding_ready.sh 81 services/onos
74 #bash ../common/wait_for_onboarding_ready.sh 81 services/fabric
Pingping Linb7a7d2b2016-08-19 18:11:36 +000075 bash ../common/wait_for_onboarding_ready.sh 81 xos
76 bash ../common/wait_for_xos_port.sh 80
77
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)
113 bash ../common/wait_for_onboarding_ready.sh 81 xos
114
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
125 bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice
126 bash ../common/wait_for_onboarding_ready.sh 81 xos
127 bash ../common/wait_for_xos_port.sh 80
128
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
138 bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring
139 bash ../common/wait_for_onboarding_ready.sh 81 xos
140 bash ../common/wait_for_xos_port.sh 80
141
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