Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 1 | include ../common/Makedefs |
| 2 | |
| 3 | CONFIG_DIR:=$(shell pwd) |
| 4 | DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml |
| 5 | BOOTSTRAP_YML=./docker-compose-bootstrap.yml |
| 6 | DOCKER_PROJECT=mcord |
| 7 | BOOTSTRAP_PROJECT=mcordbs |
| 8 | XOS_BOOTSTRAP_PORT=81 |
| 9 | XOS_UI_PORT=80 |
| 10 | ADMIN_USERNAME=padmin@vicci.org |
| 11 | ADMIN_PASSWORD=letmein |
| 12 | RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD) |
| 13 | RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD) |
| 14 | |
| 15 | .PHONY: xos |
| 16 | xos: prereqs dirs download_xos download_services bootstrap onboarding podconfig |
| 17 | |
| 18 | prereqs: |
| 19 | sudo make -f ../common/Makefile.prereqs |
| 20 | |
| 21 | dirs: |
| 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 | |
| 26 | bootstrap: |
| 27 | @echo "[BOOTSTRAP]" |
| 28 | @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`" |
| 31 | 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 | |
| 38 | download_xos: |
| 39 | make -f ../common/Makefile.services xos_core |
| 40 | |
| 41 | download_services: |
| 42 | make -f ../common/Makefile.services |
| 43 | |
| 44 | update_services: |
| 45 | make -f ../common/Makefile.services update |
| 46 | |
| 47 | update_xos: |
| 48 | make -f ../common/Makefile.services update_xos |
| 49 | |
| 50 | onboarding: |
| 51 | @echo "[ONBOARDING]" |
| 52 | # on-board any services here |
| 53 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 54 | $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml |
Pingping Lin | b5a1a0a | 2016-09-08 01:14:48 +0000 | [diff] [blame] | 55 | |
Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 56 | sudo cp id_rsa key_import/vBBU_rsa |
| 57 | sudo cp id_rsa.pub key_import/vBBU_rsa.pub |
Pingping Lin | eb05ccd | 2016-09-19 21:23:59 +0000 | [diff] [blame] | 58 | sudo cp id_rsa key_import/vPGWC_rsa |
| 59 | sudo cp id_rsa.pub key_import/vPGWC_rsa.pub |
Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 60 | sudo cp id_rsa key_import/onos_rsa |
| 61 | sudo cp id_rsa key_import/onos_rsa.pub |
| 62 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml |
Pingping Lin | 37e727c | 2016-08-29 23:02:12 +0000 | [diff] [blame] | 63 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vBBU/xos/vBBU-onboard.yaml |
Pingping Lin | 97c1261 | 2016-09-19 23:40:53 +0000 | [diff] [blame] | 64 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vPGWC/xos/vPGWC-onboard.yaml |
Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 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 |
Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 68 | $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml |
| 69 | $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml |
Pingping Lin | 09e613e | 2016-09-01 00:14:32 +0000 | [diff] [blame] | 70 | bash ../common/wait_for_onboarding_ready.sh 81 services/vbbu |
Pingping Lin | 97c1261 | 2016-09-19 23:40:53 +0000 | [diff] [blame] | 71 | bash ../common/wait_for_onboarding_ready.sh 81 services/vpgwc |
Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 72 | bash ../common/wait_for_onboarding_ready.sh 81 services/vtn |
| 73 | bash ../common/wait_for_onboarding_ready.sh 81 services/onos |
| 74 | #bash ../common/wait_for_onboarding_ready.sh 81 services/fabric |
Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 75 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 76 | bash ../common/wait_for_xos_port.sh 80 |
| 77 | |
| 78 | podconfig: nodes.yaml images.yaml |
| 79 | @echo "[PODCONFIG]" |
| 80 | $(RUN_TOSCA) setup.yaml |
| 81 | $(RUN_TOSCA) nodes.yaml |
| 82 | $(RUN_TOSCA) images.yaml |
| 83 | |
| 84 | vtn: vtn-external.yaml |
| 85 | $(RUN_TOSCA) vtn-external.yaml |
| 86 | |
| 87 | delete_fabric_config: |
| 88 | http -a karaf:karaf DELETE http://onos-fabric:8181/onos/v1/network/configuration/ |
| 89 | |
| 90 | fabric: fabric.yaml |
| 91 | cp ../../xos_services/fabric/config/network-cfg-quickstart.json . |
| 92 | $(RUN_TOSCA) fabric.yaml |
| 93 | |
| 94 | #cord: vsg_custom_images |
Pingping Lin | 82366d3 | 2016-08-31 00:21:56 +0000 | [diff] [blame] | 95 | mcord: |
| 96 | $(RUN_TOSCA) mgmt-net.yaml |
| 97 | $(RUN_TOSCA) mcord.yaml |
Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 98 | # $(RUN_TOSCA) cord-volt-devices.yaml |
| 99 | |
| 100 | #cord-subscriber: |
| 101 | # $(RUN_TOSCA) cord-test-subscriber.yaml |
| 102 | |
| 103 | clean-nodes: |
| 104 | rm -f nodes.yaml |
| 105 | |
| 106 | update-nodes: nodes.yaml |
| 107 | $(RUN_TOSCA) nodes.yaml |
| 108 | |
| 109 | new-nodes: clean-nodes update-nodes vtn |
| 110 | |
| 111 | rebuild: |
| 112 | bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT) |
| 113 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 114 | |
| 115 | exampleservice: onboard-exampleservice |
| 116 | $(RUN_TOSCA) pod-exampleservice.yaml |
| 117 | |
| 118 | onboard-exampleservice: |
| 119 | sudo cp id_rsa key_import/exampleservice_rsa |
| 120 | sudo cp id_rsa.pub key_import/exampleservice_rsa.pub |
| 121 | $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml |
| 122 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml |
| 123 | $(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml |
| 124 | $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml |
| 125 | bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice |
| 126 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 127 | bash ../common/wait_for_xos_port.sh 80 |
| 128 | |
| 129 | cord-monitoringservice: ceilometer_custom_images onboard-monitoringservice |
| 130 | $(RUN_TOSCA) monitoringservice.yaml |
| 131 | $(RUN_TOSCA) monitoringtenant.yaml |
| 132 | |
| 133 | onboard-monitoringservice: download-monitoringservice |
| 134 | sudo cp id_rsa key_import/monitoringservice_rsa |
| 135 | sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub |
| 136 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml |
| 137 | $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml |
| 138 | bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring |
| 139 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 140 | bash ../common/wait_for_xos_port.sh 80 |
| 141 | |
| 142 | download-monitoringservice: |
| 143 | make -f ../common/Makefile.services monitoring_services |
| 144 | |
| 145 | nodes.yaml: |
| 146 | export SETUPDIR=.; bash ../common/make-nodes-yaml.sh |
| 147 | |
| 148 | images.yaml: |
| 149 | export SETUPDIR=.; bash ../common/make-images-yaml.sh |
| 150 | |
| 151 | vtn-external.yaml: |
| 152 | export SETUPDIR=.; bash ./make-vtn-external-yaml.sh |
| 153 | |
| 154 | fabric.yaml: |
| 155 | export SETUPDIR=.; bash ./make-fabric-yaml.sh |
| 156 | |
| 157 | virtualbng_json: |
| 158 | export SETUPDIR=.; bash ./make-virtualbng-json.sh |
| 159 | |
| 160 | vtn_network_cfg_json: |
| 161 | export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh |
| 162 | |
| 163 | stop: |
| 164 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop |
| 165 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop |
| 166 | |
| 167 | rm: stop |
| 168 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f |
| 169 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f |
| 170 | |
| 171 | showlogs: |
| 172 | sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs |
| 173 | |
| 174 | showlogs_bootstrap: |
| 175 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
| 176 | |
| 177 | cleanup: stop rm |
| 178 | ./cleanup.sh |
| 179 | bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list" |
| 180 | |
| 181 | ceilometer_custom_images: images/ceilometer-service-trusty-server-multi-nic.img images/ceilometer-trusty-server-multi-nic.img |
| 182 | #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) |
| 183 | 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" |
| 184 | |
| 185 | #vsg_custom_images: images/vsg-1.1.img |
Pingping Lin | 5681d7d | 2016-09-13 23:29:50 +0000 | [diff] [blame] | 186 | # 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" |
Pingping Lin | b7a7d2b | 2016-08-19 18:11:36 +0000 | [diff] [blame] | 187 | |
| 188 | images/ceilometer-trusty-server-multi-nic.img: images |
| 189 | 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" |
| 190 | |
| 191 | images/ceilometer-service-trusty-server-multi-nic.img: images |
| 192 | #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) once image is uploaded into vicci portal |
| 193 | #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" |
| 194 | |
| 195 | #images/vsg-1.1.img: images |
| 196 | # [ -s images/vsg-1.1.img ] || wget http://www.vicci.org/cord/vsg-1.1.img -P ./images |
| 197 | |
| 198 | images: |
| 199 | mkdir -p ./images |
| 200 | |
| 201 | .PHONY: local_containers |
| 202 | local_containers: prereqs download_xos |
| 203 | make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer |
| 204 | |
Matteo Scandolo | 1105c5b | 2016-10-03 11:25:34 -0700 | [diff] [blame^] | 205 | onboard-mcord-slicing: slicing-ui |
| 206 | @echo "[ONBOARDING UI SERVICES]" |
| 207 | bash ../common/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos |
| 208 | $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml |
| 209 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/mcord-ui-slicing/xos/mcord-slicing-onboard.yaml |
| 210 | $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml |
| 211 | bash ../common/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos |
| 212 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 213 | |
| 214 | slicing-ui: |
| 215 | $(RUN_TOSCA) ./mcord-slicing-ui.yaml |