blob: 97d27f7587fb819c8ecc214e79715c7d95983d2f [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
Andy Bavieracfadd42016-06-30 16:46:32 -040088 $(RUN_TOSCA) cord-services.yaml
Scott Baker50421662016-06-27 22:09:48 -070089 $(RUN_TOSCA) cord-volt-devices.yaml
90
Andy Bavieracfadd42016-06-30 16:46:32 -040091cord-subscriber:
92 $(RUN_TOSCA) cord-test-subscriber.yaml
93
Scott Baker50421662016-06-27 22:09:48 -070094clean-nodes:
95 rm -f nodes.yaml
96
97update-nodes: nodes.yaml
98 $(RUN_TOSCA) nodes.yaml
99
100new-nodes: clean-nodes update-nodes vtn
101
102exampleservice: onboard-exampleservice
103 $(RUN_TOSCA) pod-exampleservice.yaml
104
105onboard-exampleservice:
106 sudo cp id_rsa key_import/exampleservice_rsa
107 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
108 $(RUN_TOSCA_BOOSTRAP) $(SERVICE_DIR)/exampleservice/exampleservice-onboard.yaml
109 bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice
110 bash ../common/wait_for_onboarding_ready.sh 81 xos
111 bash ../common/wait_for_xos_port.sh 80
112
Scott Bakerd1545d32016-06-29 11:27:33 -0700113cord-monitoringservice: ceilometer_custom_images cord onboard-monitoringservice
114 $(RUN_TOSCA) monitoringservice.yaml
Scott Baker50421662016-06-27 22:09:48 -0700115
Scott Bakerd1545d32016-06-29 11:27:33 -0700116onboard-monitoringservice: download-monitoringservice
117 sudo cp id_rsa key_import/monitoringservice_rsa
118 sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
119 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
120 bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring
Scott Baker50421662016-06-27 22:09:48 -0700121 bash ../common/wait_for_onboarding_ready.sh 81 xos
122 bash ../common/wait_for_xos_port.sh 80
123
Scott Bakerd1545d32016-06-29 11:27:33 -0700124download-monitoringservice:
Scott Baker50421662016-06-27 22:09:48 -0700125 make -f ../common/Makefile.services monitoring_services
126
127nodes.yaml:
128 export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
129
130images.yaml:
131 export SETUPDIR=.; bash ../common/make-images-yaml.sh
132
133vtn-external.yaml:
134 export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
135
136fabric.yaml:
137 export SETUPDIR=.; bash ./make-fabric-yaml.sh
138
139virtualbng_json:
140 export SETUPDIR=.; bash ./make-virtualbng-json.sh
141
142vtn_network_cfg_json:
143 export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
144
145stop:
146 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
147 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
148
149rm:
150 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm
151 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm
152
153showlogs:
Scott Bakere80320c2016-06-30 10:21:11 -0700154 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
155
156showlogs_bootstrap:
157 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
Scott Baker50421662016-06-27 22:09:48 -0700158
159cleanup: stop rm
160 ./cleanup.sh
161 bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
162
163ceilometer_custom_images: images/ceilometer-trusty-server-multi-nic.img
164 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"
165
166vsg_custom_images: images/vsg-1.0.img
167 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"
168
169images/ceilometer-trusty-server-multi-nic.img: images
170 wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images
171 mv ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ./images/ceilometer-trusty-server-multi-nic.img
172
173images/vsg-1.0.img: images
174 wget http://www.vicci.org/cord/vsg-1.0.img -P ./images
175
176images:
177 mkdir -p ./images
178
179.PHONY: local_containers
Scott Bakerbda441d2016-06-28 14:14:31 -0700180local_containers: prereqs download_xos
Scott Baker50421662016-06-27 22:09:48 -0700181 make -f ../common/Makefile.containers update_certs xos_devel synchronizer onboarding_synchronizer
182