blob: 0e46ad9fa4467b4e5f30caf0771f104ace52a1e9 [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
Scott Baker1b29f972016-07-01 09:20:58 -070044update_xos:
45 make -f ../common/Makefile.services update_xos
46
Scott Baker50421662016-06-27 22:09:48 -070047onboarding:
48 echo "[ONBOARDING]"
49 # on-board any services here
50 bash ../common/wait_for_onboarding_ready.sh 81 xos
51 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
52 sudo cp id_rsa key_import/vsg_rsa
53 sudo cp id_rsa.pub key_import/vsg_rsa.pub
54 sudo cp id_rsa key_import/volt_rsa
55 sudo cp id_rsa.pub key_import/volt_rsa.pub
56 sudo cp id_rsa key_import/onos_rsa
57 sudo cp id_rsa key_import/onos_rsa.pub
58 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
59 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
60 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
61 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml
62 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
63 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/\fabric-onboard.yaml
64 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
65 $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml
66 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
67 bash ../common/wait_for_onboarding_ready.sh 81 services/vrouter
68 bash ../common/wait_for_onboarding_ready.sh 81 services/volt
69 bash ../common/wait_for_onboarding_ready.sh 81 services/vsg
70 bash ../common/wait_for_onboarding_ready.sh 81 services/vtn
71 bash ../common/wait_for_onboarding_ready.sh 81 services/onos
72 bash ../common/wait_for_onboarding_ready.sh 81 services/fabric
73 bash ../common/wait_for_onboarding_ready.sh 81 services/vtr
74 bash ../common/wait_for_onboarding_ready.sh 81 xos
75 bash ../common/wait_for_xos_port.sh 80
76
77podconfig: nodes.yaml images.yaml
78 echo "[PODCONFIG]"
79 $(RUN_TOSCA) setup.yaml
80 $(RUN_TOSCA) nodes.yaml
81 $(RUN_TOSCA) images.yaml
82
83vtn: vtn-external.yaml
84 $(RUN_TOSCA) vtn-external.yaml
85
86fabric: fabric.yaml
87 $(RUN_TOSCA) fabric.yaml
88
89cord: vsg_custom_images
90 $(RUN_TOSCA) mgmt-net.yaml
Andy Bavieracfadd42016-06-30 16:46:32 -040091 $(RUN_TOSCA) cord-services.yaml
Scott Baker50421662016-06-27 22:09:48 -070092 $(RUN_TOSCA) cord-volt-devices.yaml
93
Andy Bavieracfadd42016-06-30 16:46:32 -040094cord-subscriber:
95 $(RUN_TOSCA) cord-test-subscriber.yaml
96
Scott Baker50421662016-06-27 22:09:48 -070097clean-nodes:
98 rm -f nodes.yaml
99
100update-nodes: nodes.yaml
101 $(RUN_TOSCA) nodes.yaml
102
103new-nodes: clean-nodes update-nodes vtn
104
105exampleservice: onboard-exampleservice
106 $(RUN_TOSCA) pod-exampleservice.yaml
107
108onboard-exampleservice:
109 sudo cp id_rsa key_import/exampleservice_rsa
110 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
111 $(RUN_TOSCA_BOOSTRAP) $(SERVICE_DIR)/exampleservice/exampleservice-onboard.yaml
112 bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice
113 bash ../common/wait_for_onboarding_ready.sh 81 xos
114 bash ../common/wait_for_xos_port.sh 80
115
Scott Bakerd1545d32016-06-29 11:27:33 -0700116cord-monitoringservice: ceilometer_custom_images cord onboard-monitoringservice
117 $(RUN_TOSCA) monitoringservice.yaml
Scott Baker50421662016-06-27 22:09:48 -0700118
Scott Bakerd1545d32016-06-29 11:27:33 -0700119onboard-monitoringservice: download-monitoringservice
120 sudo cp id_rsa key_import/monitoringservice_rsa
121 sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub
122 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
Srikanth Vavilapalli4cf2fed2016-07-01 21:27:20 +0000123 $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml
Scott Bakerd1545d32016-06-29 11:27:33 -0700124 bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring
Scott Baker50421662016-06-27 22:09:48 -0700125 bash ../common/wait_for_onboarding_ready.sh 81 xos
126 bash ../common/wait_for_xos_port.sh 80
127
Scott Bakerd1545d32016-06-29 11:27:33 -0700128download-monitoringservice:
Scott Baker50421662016-06-27 22:09:48 -0700129 make -f ../common/Makefile.services monitoring_services
130
131nodes.yaml:
132 export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
133
134images.yaml:
135 export SETUPDIR=.; bash ../common/make-images-yaml.sh
136
137vtn-external.yaml:
138 export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
139
140fabric.yaml:
141 export SETUPDIR=.; bash ./make-fabric-yaml.sh
142
143virtualbng_json:
144 export SETUPDIR=.; bash ./make-virtualbng-json.sh
145
146vtn_network_cfg_json:
147 export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
148
149stop:
150 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
151 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
152
Scott Baker1b29f972016-07-01 09:20:58 -0700153rm: stop
154 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
155 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
Scott Baker50421662016-06-27 22:09:48 -0700156
157showlogs:
Scott Bakere80320c2016-06-30 10:21:11 -0700158 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
159
160showlogs_bootstrap:
161 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
Scott Baker50421662016-06-27 22:09:48 -0700162
163cleanup: stop rm
164 ./cleanup.sh
165 bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
166
167ceilometer_custom_images: images/ceilometer-trusty-server-multi-nic.img
168 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"
169
170vsg_custom_images: images/vsg-1.0.img
171 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"
172
173images/ceilometer-trusty-server-multi-nic.img: images
174 wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images
175 mv ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ./images/ceilometer-trusty-server-multi-nic.img
176
177images/vsg-1.0.img: images
178 wget http://www.vicci.org/cord/vsg-1.0.img -P ./images
179
180images:
181 mkdir -p ./images
182
183.PHONY: local_containers
Scott Bakerbda441d2016-06-28 14:14:31 -0700184local_containers: prereqs download_xos
Scott Baker50421662016-06-27 22:09:48 -0700185 make -f ../common/Makefile.containers update_certs xos_devel synchronizer onboarding_synchronizer
186