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 |
| 55 | sudo cp id_rsa key_import/vBBU_rsa |
| 56 | sudo cp id_rsa.pub key_import/vBBU_rsa.pub |
| 57 | sudo cp id_rsa key_import/vPGW_rsa |
| 58 | sudo cp id_rsa.pub key_import/vPGW_rsa.pub |
| 59 | sudo cp id_rsa key_import/onos_rsa |
| 60 | sudo cp id_rsa key_import/onos_rsa.pub |
| 61 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml |
| 62 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vbbu/xos/vbbu-onboard.yaml |
| 63 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vpgw/xos/vpgw-onboard.yaml |
| 64 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtn/xos/vtn-onboard.yaml |
| 65 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml |
| 66 | #$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/\fabric-onboard.yaml |
| 67 | #$(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml |
| 68 | $(RUN_TOSCA_BOOTSTRAP) synchronizers.yaml |
| 69 | $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml |
| 70 | bash ../common/wait_for_onboarding_ready.sh 81 services/vbbu |
| 71 | bash ../common/wait_for_onboarding_ready.sh 81 services/vpgw |
| 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 |
| 75 | #bash ../common/wait_for_onboarding_ready.sh 81 services/vtr |
| 76 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 77 | bash ../common/wait_for_xos_port.sh 80 |
| 78 | |
| 79 | podconfig: nodes.yaml images.yaml |
| 80 | @echo "[PODCONFIG]" |
| 81 | $(RUN_TOSCA) setup.yaml |
| 82 | $(RUN_TOSCA) nodes.yaml |
| 83 | $(RUN_TOSCA) images.yaml |
| 84 | |
| 85 | vtn: vtn-external.yaml |
| 86 | $(RUN_TOSCA) vtn-external.yaml |
| 87 | |
| 88 | delete_fabric_config: |
| 89 | http -a karaf:karaf DELETE http://onos-fabric:8181/onos/v1/network/configuration/ |
| 90 | |
| 91 | fabric: fabric.yaml |
| 92 | cp ../../xos_services/fabric/config/network-cfg-quickstart.json . |
| 93 | $(RUN_TOSCA) fabric.yaml |
| 94 | |
| 95 | #cord: vsg_custom_images |
| 96 | # $(RUN_TOSCA) mgmt-net.yaml |
| 97 | # $(RUN_TOSCA) cord-services.yaml |
| 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 |
| 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" |
| 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 | |