blob: 1ee14352c054d9457c32833d76f4287a0ec03cf5 [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
55 sudo cp id_rsa key_import/vBBU_rsa
56 sudo cp id_rsa.pub key_import/vBBU_rsa.pub
57 sudo cp id_rsa key_import/vPGW_rsa
58 sudo cp id_rsa.pub key_import/vPGW_rsa.pub
59 sudo cp id_rsa key_import/onos_rsa
60 sudo cp id_rsa key_import/onos_rsa.pub
61 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml
Pingping Lin37e727c2016-08-29 23:02:12 +000062 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vBBU/xos/vBBU-onboard.yaml
63 # $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vPGWC/xos/vPGWC-onboard.yaml
Pingping Linb7a7d2b2016-08-19 18:11:36 +000064 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
65 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
66 #$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/\fabric-onboard.yaml
67 #$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
68 $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
69 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
Pingping Lin37e727c2016-08-29 23:02:12 +000070 bash ../common/wait_for_onboarding_ready.sh 81 services/vBBU
71 #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
75 #bash ../common/wait_for_onboarding_ready.sh 81 services/vtr
76 bash ../common/wait_for_onboarding_ready.sh 81 xos
77 bash ../common/wait_for_xos_port.sh 80
78
79podconfig: nodes.yaml images.yaml
80 @echo "[PODCONFIG]"
81 $(RUN_TOSCA) setup.yaml
82 $(RUN_TOSCA) nodes.yaml
83 $(RUN_TOSCA) images.yaml
84
85vtn: vtn-external.yaml
86 $(RUN_TOSCA) vtn-external.yaml
87
88delete_fabric_config:
89 http -a karaf:karaf DELETE http://onos-fabric:8181/onos/v1/network/configuration/
90
91fabric: fabric.yaml
92 cp ../../xos_services/fabric/config/network-cfg-quickstart.json .
93 $(RUN_TOSCA) fabric.yaml
94
95#cord: vsg_custom_images
Pingping Lin82366d32016-08-31 00:21:56 +000096mcord:
97 $(RUN_TOSCA) mgmt-net.yaml
98 $(RUN_TOSCA) mcord.yaml
Pingping Linb7a7d2b2016-08-19 18:11:36 +000099# $(RUN_TOSCA) cord-volt-devices.yaml
100
101#cord-subscriber:
102# $(RUN_TOSCA) cord-test-subscriber.yaml
103
104clean-nodes:
105 rm -f nodes.yaml
106
107update-nodes: nodes.yaml
108 $(RUN_TOSCA) nodes.yaml
109
110new-nodes: clean-nodes update-nodes vtn
111
112rebuild:
113 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
114 bash ../common/wait_for_onboarding_ready.sh 81 xos
115
116exampleservice: onboard-exampleservice
117 $(RUN_TOSCA) pod-exampleservice.yaml
118
119onboard-exampleservice:
120 sudo cp id_rsa key_import/exampleservice_rsa
121 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
122 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
123 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
124 $(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml
125 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
126 bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice
127 bash ../common/wait_for_onboarding_ready.sh 81 xos
128 bash ../common/wait_for_xos_port.sh 80
129
130cord-monitoringservice: ceilometer_custom_images onboard-monitoringservice
131 $(RUN_TOSCA) monitoringservice.yaml
132 $(RUN_TOSCA) monitoringtenant.yaml
133
134onboard-monitoringservice: download-monitoringservice
135 sudo cp id_rsa key_import/monitoringservice_rsa
136 sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
137 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
138 $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml
139 bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring
140 bash ../common/wait_for_onboarding_ready.sh 81 xos
141 bash ../common/wait_for_xos_port.sh 80
142
143download-monitoringservice:
144 make -f ../common/Makefile.services monitoring_services
145
146nodes.yaml:
147 export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
148
149images.yaml:
150 export SETUPDIR=.; bash ../common/make-images-yaml.sh
151
152vtn-external.yaml:
153 export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
154
155fabric.yaml:
156 export SETUPDIR=.; bash ./make-fabric-yaml.sh
157
158virtualbng_json:
159 export SETUPDIR=.; bash ./make-virtualbng-json.sh
160
161vtn_network_cfg_json:
162 export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
163
164stop:
165 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
166 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
167
168rm: stop
169 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
170 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
171
172showlogs:
173 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
174
175showlogs_bootstrap:
176 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
177
178cleanup: stop rm
179 ./cleanup.sh
180 bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
181
182ceilometer_custom_images: images/ceilometer-service-trusty-server-multi-nic.img images/ceilometer-trusty-server-multi-nic.img
183 #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic)
184 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"
185
186#vsg_custom_images: images/vsg-1.1.img
187 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"
188
189images/ceilometer-trusty-server-multi-nic.img: images
190 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"
191
192images/ceilometer-service-trusty-server-multi-nic.img: images
193 #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) once image is uploaded into vicci portal
194 #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"
195
196#images/vsg-1.1.img: images
197# [ -s images/vsg-1.1.img ] || wget http://www.vicci.org/cord/vsg-1.1.img -P ./images
198
199images:
200 mkdir -p ./images
201
202.PHONY: local_containers
203local_containers: prereqs download_xos
204 make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
205