blob: cea341e39d642e83c34e56871eaf07aba40cf1b7 [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:
27 echo "[BOOTSTRAP]"
28 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
44onboarding:
45 echo "[ONBOARDING]"
46 # on-board any services here
47 bash ../common/wait_for_onboarding_ready.sh 81 xos
48 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
49 sudo cp id_rsa key_import/vsg_rsa
50 sudo cp id_rsa.pub key_import/vsg_rsa.pub
51 sudo cp id_rsa key_import/volt_rsa
52 sudo cp id_rsa.pub key_import/volt_rsa.pub
53 sudo cp id_rsa key_import/onos_rsa
54 sudo cp id_rsa key_import/onos_rsa.pub
55 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
56 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
57 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
58 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
59 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
60 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/\fabric-onboard.yaml
61 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
62 $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
63 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
64 bash ../common/wait_for_onboarding_ready.sh 81 services/vrouter
65 bash ../common/wait_for_onboarding_ready.sh 81 services/volt
66 bash ../common/wait_for_onboarding_ready.sh 81 services/vsg
67 bash ../common/wait_for_onboarding_ready.sh 81 services/vtn
68 bash ../common/wait_for_onboarding_ready.sh 81 services/onos
69 bash ../common/wait_for_onboarding_ready.sh 81 services/fabric
70 bash ../common/wait_for_onboarding_ready.sh 81 services/vtr
71 bash ../common/wait_for_onboarding_ready.sh 81 xos
72 bash ../common/wait_for_xos_port.sh 80
73
74podconfig: nodes.yaml images.yaml
75 echo "[PODCONFIG]"
76 $(RUN_TOSCA) setup.yaml
77 $(RUN_TOSCA) nodes.yaml
78 $(RUN_TOSCA) images.yaml
79
80vtn: vtn-external.yaml
81 $(RUN_TOSCA) vtn-external.yaml
82
83fabric: fabric.yaml
84 $(RUN_TOSCA) fabric.yaml
85
86cord: vsg_custom_images
87 $(RUN_TOSCA) mgmt-net.yaml
88 $(RUN_TOSCA) cord-vtn-vsg.yaml
89 $(RUN_TOSCA) cord-volt-devices.yaml
90
91clean-nodes:
92 rm -f nodes.yaml
93
94update-nodes: nodes.yaml
95 $(RUN_TOSCA) nodes.yaml
96
97new-nodes: clean-nodes update-nodes vtn
98
99exampleservice: onboard-exampleservice
100 $(RUN_TOSCA) pod-exampleservice.yaml
101
102onboard-exampleservice:
103 sudo cp id_rsa key_import/exampleservice_rsa
104 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
105 $(RUN_TOSCA_BOOSTRAP) $(SERVICE_DIR)/exampleservice/exampleservice-onboard.yaml
106 bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice
107 bash ../common/wait_for_onboarding_ready.sh 81 xos
108 bash ../common/wait_for_xos_port.sh 80
109
Scott Bakerd1545d32016-06-29 11:27:33 -0700110cord-monitoringservice: ceilometer_custom_images cord onboard-monitoringservice
111 $(RUN_TOSCA) monitoringservice.yaml
Scott Baker50421662016-06-27 22:09:48 -0700112
Scott Bakerd1545d32016-06-29 11:27:33 -0700113onboard-monitoringservice: download-monitoringservice
114 sudo cp id_rsa key_import/monitoringservice_rsa
115 sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
116 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
117 bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring
Scott Baker50421662016-06-27 22:09:48 -0700118 bash ../common/wait_for_onboarding_ready.sh 81 xos
119 bash ../common/wait_for_xos_port.sh 80
120
Scott Bakerd1545d32016-06-29 11:27:33 -0700121download-monitoringservice:
Scott Baker50421662016-06-27 22:09:48 -0700122 make -f ../common/Makefile.services monitoring_services
123
124nodes.yaml:
125 export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
126
127images.yaml:
128 export SETUPDIR=.; bash ../common/make-images-yaml.sh
129
130vtn-external.yaml:
131 export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
132
133fabric.yaml:
134 export SETUPDIR=.; bash ./make-fabric-yaml.sh
135
136virtualbng_json:
137 export SETUPDIR=.; bash ./make-virtualbng-json.sh
138
139vtn_network_cfg_json:
140 export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
141
142stop:
143 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
144 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
145
146rm:
147 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm
148 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm
149
150showlogs:
151 sudo MYIP=$(MYIP) docker-compose logs
152
153cleanup: stop rm
154 ./cleanup.sh
155 bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
156
157ceilometer_custom_images: images/ceilometer-trusty-server-multi-nic.img
158 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.img --container-format bare"
159
160vsg_custom_images: images/vsg-1.0.img
161 bash -c "source ./admin-openrc.sh; glance image-show vsg-1.0 || glance image-create --name vsg-1.0 --disk-format qcow2 --file ./images/vsg-1.0.img --container-format bare"
162
163images/ceilometer-trusty-server-multi-nic.img: images
164 wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images
165 mv ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ./images/ceilometer-trusty-server-multi-nic.img
166
167images/vsg-1.0.img: images
168 wget http://www.vicci.org/cord/vsg-1.0.img -P ./images
169
170images:
171 mkdir -p ./images
172
173.PHONY: local_containers
Scott Bakerbda441d2016-06-28 14:14:31 -0700174local_containers: prereqs download_xos
Scott Baker50421662016-06-27 22:09:48 -0700175 make -f ../common/Makefile.containers update_certs xos_devel synchronizer onboarding_synchronizer
176