blob: 719303289175c1363a0027d149edaeae8a22ba6a [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 Baker68183302016-07-27 15:10:40 -070028 @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`"
Scott Baker50421662016-06-27 22:09:48 -070031 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
Scott Bakerbda441d2016-06-28 14:14:31 -070038download_xos:
39 make -f ../common/Makefile.services xos_core
40
Scott Baker50421662016-06-27 22:09:48 -070041download_services:
42 make -f ../common/Makefile.services
43
44update_services:
45 make -f ../common/Makefile.services update
46
Scott Baker1b29f972016-07-01 09:20:58 -070047update_xos:
48 make -f ../common/Makefile.services update_xos
49
Scott Baker50421662016-06-27 22:09:48 -070050onboarding:
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070051 @echo "[ONBOARDING]"
Scott Baker50421662016-06-27 22:09:48 -070052 # 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/vsg_rsa
56 sudo cp id_rsa.pub key_import/vsg_rsa.pub
57 sudo cp id_rsa key_import/volt_rsa
58 sudo cp id_rsa.pub key_import/volt_rsa.pub
59 sudo cp id_rsa key_import/onos_rsa
60 sudo cp id_rsa key_import/onos_rsa.pub
Scott Baker989959c2016-08-11 19:22:52 -070061 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml
Scott Baker50421662016-06-27 22:09:48 -070062 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
63 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
64 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
65 $(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
68 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
69 $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
70 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
71 bash ../common/wait_for_onboarding_ready.sh 81 services/vrouter
72 bash ../common/wait_for_onboarding_ready.sh 81 services/volt
73 bash ../common/wait_for_onboarding_ready.sh 81 services/vsg
74 bash ../common/wait_for_onboarding_ready.sh 81 services/vtn
75 bash ../common/wait_for_onboarding_ready.sh 81 services/onos
76 bash ../common/wait_for_onboarding_ready.sh 81 services/fabric
77 bash ../common/wait_for_onboarding_ready.sh 81 services/vtr
78 bash ../common/wait_for_onboarding_ready.sh 81 xos
79 bash ../common/wait_for_xos_port.sh 80
80
81podconfig: nodes.yaml images.yaml
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070082 @echo "[PODCONFIG]"
Scott Baker50421662016-06-27 22:09:48 -070083 $(RUN_TOSCA) setup.yaml
84 $(RUN_TOSCA) nodes.yaml
85 $(RUN_TOSCA) images.yaml
86
87vtn: vtn-external.yaml
88 $(RUN_TOSCA) vtn-external.yaml
89
Andy Bavier712e1342016-07-28 17:01:53 -040090delete_fabric_config:
Andy Bavierabdbf302016-07-28 20:25:53 -040091 http -a karaf:karaf DELETE http://onos-fabric:8181/onos/v1/network/configuration/
Andy Bavier712e1342016-07-28 17:01:53 -040092
93reactivate_fabric_apps:
Andy Bavierabdbf302016-07-28 20:25:53 -040094 http -a karaf:karaf POST http://onos-fabric:8181/onos/v1/applications/org.onosproject.vrouter/active
95 http -a karaf:karaf POST http://onos-fabric:8181/onos/v1/applications/org.onosproject.segmentrouting/active
Andy Bavier712e1342016-07-28 17:01:53 -040096
Scott Baker50421662016-06-27 22:09:48 -070097fabric: fabric.yaml
Andy Bavierac281492016-07-19 14:32:29 -040098 cp ../../xos_services/fabric/config/network-cfg-quickstart.json .
Scott Baker50421662016-06-27 22:09:48 -070099 $(RUN_TOSCA) fabric.yaml
100
101cord: vsg_custom_images
102 $(RUN_TOSCA) mgmt-net.yaml
Andy Bavieracfadd42016-06-30 16:46:32 -0400103 $(RUN_TOSCA) cord-services.yaml
Scott Baker50421662016-06-27 22:09:48 -0700104 $(RUN_TOSCA) cord-volt-devices.yaml
105
Andy Bavieracfadd42016-06-30 16:46:32 -0400106cord-subscriber:
107 $(RUN_TOSCA) cord-test-subscriber.yaml
108
Scott Baker50421662016-06-27 22:09:48 -0700109clean-nodes:
110 rm -f nodes.yaml
111
112update-nodes: nodes.yaml
113 $(RUN_TOSCA) nodes.yaml
114
115new-nodes: clean-nodes update-nodes vtn
116
Scott Baker4b37d1a2016-07-01 13:41:52 -0700117rebuild:
118 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
119 bash ../common/wait_for_onboarding_ready.sh 81 xos
120
Scott Baker50421662016-06-27 22:09:48 -0700121exampleservice: onboard-exampleservice
122 $(RUN_TOSCA) pod-exampleservice.yaml
123
124onboard-exampleservice:
125 sudo cp id_rsa key_import/exampleservice_rsa
126 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
Scott Baker0915fc22016-07-28 07:32:25 -0700127 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
Scott Bakerdf81f592016-07-14 12:01:21 -0700128 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
Scott Baker78ea35a2016-07-25 08:55:16 -0700129 $(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml
Scott Baker0915fc22016-07-28 07:32:25 -0700130 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
Scott Baker50421662016-06-27 22:09:48 -0700131 bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice
132 bash ../common/wait_for_onboarding_ready.sh 81 xos
133 bash ../common/wait_for_xos_port.sh 80
134
Srikanth Vavilapallicccb0a32016-07-08 04:19:04 +0000135cord-monitoringservice: ceilometer_custom_images onboard-monitoringservice
Scott Bakerd1545d32016-06-29 11:27:33 -0700136 $(RUN_TOSCA) monitoringservice.yaml
Srikanth Vavilapallicccb0a32016-07-08 04:19:04 +0000137 $(RUN_TOSCA) monitoringtenant.yaml
Scott Baker50421662016-06-27 22:09:48 -0700138
Scott Bakerd1545d32016-06-29 11:27:33 -0700139onboard-monitoringservice: download-monitoringservice
140 sudo cp id_rsa key_import/monitoringservice_rsa
141 sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
142 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
Srikanth Vavilapalli4cf2fed2016-07-01 21:27:20 +0000143 $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml
Scott Bakerd1545d32016-06-29 11:27:33 -0700144 bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring
Scott Baker50421662016-06-27 22:09:48 -0700145 bash ../common/wait_for_onboarding_ready.sh 81 xos
146 bash ../common/wait_for_xos_port.sh 80
147
Scott Bakerd1545d32016-06-29 11:27:33 -0700148download-monitoringservice:
Scott Baker50421662016-06-27 22:09:48 -0700149 make -f ../common/Makefile.services monitoring_services
150
151nodes.yaml:
152 export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
153
154images.yaml:
155 export SETUPDIR=.; bash ../common/make-images-yaml.sh
156
157vtn-external.yaml:
158 export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
159
160fabric.yaml:
161 export SETUPDIR=.; bash ./make-fabric-yaml.sh
162
163virtualbng_json:
164 export SETUPDIR=.; bash ./make-virtualbng-json.sh
165
166vtn_network_cfg_json:
167 export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
168
169stop:
170 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
171 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
172
Scott Baker1b29f972016-07-01 09:20:58 -0700173rm: stop
174 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
175 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
Scott Baker50421662016-06-27 22:09:48 -0700176
177showlogs:
Scott Bakere80320c2016-06-30 10:21:11 -0700178 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
179
180showlogs_bootstrap:
181 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
Scott Baker50421662016-06-27 22:09:48 -0700182
183cleanup: stop rm
184 ./cleanup.sh
185 bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
186
Srikanth Vavilapallicccb0a32016-07-08 04:19:04 +0000187ceilometer_custom_images: images/ceilometer-service-trusty-server-multi-nic.img images/ceilometer-trusty-server-multi-nic.img
188 #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic)
189 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 -0700190
Scott Bakerd8d905a2016-07-18 16:04:05 -0700191vsg_custom_images: images/vsg-1.1.img
192 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 -0700193
194images/ceilometer-trusty-server-multi-nic.img: images
Srikanth Vavilapalli77b08732016-08-09 00:10:41 +0000195 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"
Srikanth Vavilapallicccb0a32016-07-08 04:19:04 +0000196
197images/ceilometer-service-trusty-server-multi-nic.img: images
198 #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) once image is uploaded into vicci portal
199 #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 -0700200
Scott Bakerd8d905a2016-07-18 16:04:05 -0700201images/vsg-1.1.img: images
202 [ -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 -0700203
204images:
205 mkdir -p ./images
206
207.PHONY: local_containers
Scott Bakerbda441d2016-06-28 14:14:31 -0700208local_containers: prereqs download_xos
Zack Williamsefb54952016-07-02 17:21:12 -0700209 make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
Scott Baker50421662016-06-27 22:09:48 -0700210