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