Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [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=cordpod |
| 7 | BOOTSTRAP_PROJECT=cordpodbs |
| 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 |
Scott Baker | bda441d | 2016-06-28 14:14:31 -0700 | [diff] [blame] | 16 | xos: prereqs dirs download_xos download_services bootstrap onboarding podconfig |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 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: |
Scott Baker | c5e2f3c | 2016-07-11 11:48:06 -0700 | [diff] [blame] | 27 | @echo "[BOOTSTRAP]" |
Scott Baker | 6818330 | 2016-07-27 15:10:40 -0700 | [diff] [blame] | 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`" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 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 | |
Scott Baker | bda441d | 2016-06-28 14:14:31 -0700 | [diff] [blame] | 38 | download_xos: |
| 39 | make -f ../common/Makefile.services xos_core |
| 40 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 41 | download_services: |
| 42 | make -f ../common/Makefile.services |
| 43 | |
| 44 | update_services: |
| 45 | make -f ../common/Makefile.services update |
| 46 | |
Scott Baker | 1b29f97 | 2016-07-01 09:20:58 -0700 | [diff] [blame] | 47 | update_xos: |
| 48 | make -f ../common/Makefile.services update_xos |
| 49 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 50 | onboarding: |
Scott Baker | c5e2f3c | 2016-07-11 11:48:06 -0700 | [diff] [blame] | 51 | @echo "[ONBOARDING]" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 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/vsg_rsa |
| 56 | sudo cp id_rsa.pub key_import/vsg_rsa.pub |
| 57 | sudo cp id_rsa key_import/volt_rsa |
| 58 | sudo cp id_rsa.pub key_import/volt_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)/vrouter/xos/vrouter-onboard.yaml |
| 62 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml |
| 63 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-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/vrouter |
| 71 | bash ../common/wait_for_onboarding_ready.sh 81 services/volt |
| 72 | bash ../common/wait_for_onboarding_ready.sh 81 services/vsg |
| 73 | bash ../common/wait_for_onboarding_ready.sh 81 services/vtn |
| 74 | bash ../common/wait_for_onboarding_ready.sh 81 services/onos |
| 75 | bash ../common/wait_for_onboarding_ready.sh 81 services/fabric |
| 76 | bash ../common/wait_for_onboarding_ready.sh 81 services/vtr |
| 77 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 78 | bash ../common/wait_for_xos_port.sh 80 |
| 79 | |
| 80 | podconfig: nodes.yaml images.yaml |
Scott Baker | c5e2f3c | 2016-07-11 11:48:06 -0700 | [diff] [blame] | 81 | @echo "[PODCONFIG]" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 82 | $(RUN_TOSCA) setup.yaml |
| 83 | $(RUN_TOSCA) nodes.yaml |
| 84 | $(RUN_TOSCA) images.yaml |
| 85 | |
| 86 | vtn: vtn-external.yaml |
| 87 | $(RUN_TOSCA) vtn-external.yaml |
| 88 | |
Andy Bavier | 712e134 | 2016-07-28 17:01:53 -0400 | [diff] [blame] | 89 | delete_fabric_config: |
Andy Bavier | abdbf30 | 2016-07-28 20:25:53 -0400 | [diff] [blame] | 90 | http -a karaf:karaf DELETE http://onos-fabric:8181/onos/v1/network/configuration/ |
Andy Bavier | 712e134 | 2016-07-28 17:01:53 -0400 | [diff] [blame] | 91 | |
| 92 | reactivate_fabric_apps: |
Andy Bavier | abdbf30 | 2016-07-28 20:25:53 -0400 | [diff] [blame] | 93 | http -a karaf:karaf POST http://onos-fabric:8181/onos/v1/applications/org.onosproject.vrouter/active |
| 94 | http -a karaf:karaf POST http://onos-fabric:8181/onos/v1/applications/org.onosproject.segmentrouting/active |
Andy Bavier | 712e134 | 2016-07-28 17:01:53 -0400 | [diff] [blame] | 95 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 96 | fabric: fabric.yaml |
Andy Bavier | ac28149 | 2016-07-19 14:32:29 -0400 | [diff] [blame] | 97 | cp ../../xos_services/fabric/config/network-cfg-quickstart.json . |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 98 | $(RUN_TOSCA) fabric.yaml |
| 99 | |
| 100 | cord: vsg_custom_images |
| 101 | $(RUN_TOSCA) mgmt-net.yaml |
Andy Bavier | acfadd4 | 2016-06-30 16:46:32 -0400 | [diff] [blame] | 102 | $(RUN_TOSCA) cord-services.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 103 | $(RUN_TOSCA) cord-volt-devices.yaml |
| 104 | |
Andy Bavier | acfadd4 | 2016-06-30 16:46:32 -0400 | [diff] [blame] | 105 | cord-subscriber: |
| 106 | $(RUN_TOSCA) cord-test-subscriber.yaml |
| 107 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 108 | clean-nodes: |
| 109 | rm -f nodes.yaml |
| 110 | |
| 111 | update-nodes: nodes.yaml |
| 112 | $(RUN_TOSCA) nodes.yaml |
| 113 | |
| 114 | new-nodes: clean-nodes update-nodes vtn |
| 115 | |
Scott Baker | 4b37d1a | 2016-07-01 13:41:52 -0700 | [diff] [blame] | 116 | rebuild: |
| 117 | bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT) |
| 118 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 119 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 120 | exampleservice: onboard-exampleservice |
| 121 | $(RUN_TOSCA) pod-exampleservice.yaml |
| 122 | |
| 123 | onboard-exampleservice: |
| 124 | sudo cp id_rsa key_import/exampleservice_rsa |
| 125 | sudo cp id_rsa.pub key_import/exampleservice_rsa.pub |
Scott Baker | 0915fc2 | 2016-07-28 07:32:25 -0700 | [diff] [blame] | 126 | $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml |
Scott Baker | df81f59 | 2016-07-14 12:01:21 -0700 | [diff] [blame] | 127 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml |
Scott Baker | 78ea35a | 2016-07-25 08:55:16 -0700 | [diff] [blame] | 128 | $(RUN_TOSCA_BOOTSTRAP) exampleservice-synchronizer.yaml |
Scott Baker | 0915fc2 | 2016-07-28 07:32:25 -0700 | [diff] [blame] | 129 | $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 130 | bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice |
| 131 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 132 | bash ../common/wait_for_xos_port.sh 80 |
| 133 | |
Srikanth Vavilapalli | cccb0a3 | 2016-07-08 04:19:04 +0000 | [diff] [blame] | 134 | cord-monitoringservice: ceilometer_custom_images onboard-monitoringservice |
Scott Baker | d1545d3 | 2016-06-29 11:27:33 -0700 | [diff] [blame] | 135 | $(RUN_TOSCA) monitoringservice.yaml |
Srikanth Vavilapalli | cccb0a3 | 2016-07-08 04:19:04 +0000 | [diff] [blame] | 136 | $(RUN_TOSCA) monitoringtenant.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 137 | |
Scott Baker | d1545d3 | 2016-06-29 11:27:33 -0700 | [diff] [blame] | 138 | onboard-monitoringservice: download-monitoringservice |
| 139 | sudo cp id_rsa key_import/monitoringservice_rsa |
| 140 | sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub |
| 141 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml |
Srikanth Vavilapalli | 4cf2fed | 2016-07-01 21:27:20 +0000 | [diff] [blame] | 142 | $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml |
Scott Baker | d1545d3 | 2016-06-29 11:27:33 -0700 | [diff] [blame] | 143 | bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 144 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 145 | bash ../common/wait_for_xos_port.sh 80 |
| 146 | |
Scott Baker | d1545d3 | 2016-06-29 11:27:33 -0700 | [diff] [blame] | 147 | download-monitoringservice: |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 148 | make -f ../common/Makefile.services monitoring_services |
| 149 | |
| 150 | nodes.yaml: |
| 151 | export SETUPDIR=.; bash ../common/make-nodes-yaml.sh |
| 152 | |
| 153 | images.yaml: |
| 154 | export SETUPDIR=.; bash ../common/make-images-yaml.sh |
| 155 | |
| 156 | vtn-external.yaml: |
| 157 | export SETUPDIR=.; bash ./make-vtn-external-yaml.sh |
| 158 | |
| 159 | fabric.yaml: |
| 160 | export SETUPDIR=.; bash ./make-fabric-yaml.sh |
| 161 | |
| 162 | virtualbng_json: |
| 163 | export SETUPDIR=.; bash ./make-virtualbng-json.sh |
| 164 | |
| 165 | vtn_network_cfg_json: |
| 166 | export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh |
| 167 | |
| 168 | stop: |
| 169 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop |
| 170 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop |
| 171 | |
Scott Baker | 1b29f97 | 2016-07-01 09:20:58 -0700 | [diff] [blame] | 172 | rm: stop |
| 173 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f |
| 174 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 175 | |
| 176 | showlogs: |
Scott Baker | e80320c | 2016-06-30 10:21:11 -0700 | [diff] [blame] | 177 | sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs |
| 178 | |
| 179 | showlogs_bootstrap: |
| 180 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 181 | |
| 182 | cleanup: stop rm |
| 183 | ./cleanup.sh |
| 184 | bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list" |
| 185 | |
Srikanth Vavilapalli | cccb0a3 | 2016-07-08 04:19:04 +0000 | [diff] [blame] | 186 | ceilometer_custom_images: images/ceilometer-service-trusty-server-multi-nic.img images/ceilometer-trusty-server-multi-nic.img |
| 187 | #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) |
| 188 | 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" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 189 | |
Scott Baker | d8d905a | 2016-07-18 16:04:05 -0700 | [diff] [blame] | 190 | vsg_custom_images: images/vsg-1.1.img |
| 191 | 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" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 192 | |
| 193 | images/ceilometer-trusty-server-multi-nic.img: images |
Srikanth Vavilapalli | cccb0a3 | 2016-07-08 04:19:04 +0000 | [diff] [blame] | 194 | bash -c "source ../setup/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" |
| 195 | |
| 196 | images/ceilometer-service-trusty-server-multi-nic.img: images |
| 197 | #TODO: Add logic for service VM custom image (ceilometer-service-trusty-server-multi-nic) once image is uploaded into vicci portal |
| 198 | #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" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 199 | |
Scott Baker | d8d905a | 2016-07-18 16:04:05 -0700 | [diff] [blame] | 200 | images/vsg-1.1.img: images |
| 201 | [ -s images/vsg-1.1.img ] || wget http://www.vicci.org/cord/vsg-1.1.img -P ./images |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 202 | |
| 203 | images: |
| 204 | mkdir -p ./images |
| 205 | |
| 206 | .PHONY: local_containers |
Scott Baker | bda441d | 2016-06-28 14:14:31 -0700 | [diff] [blame] | 207 | local_containers: prereqs download_xos |
Zack Williams | efb5495 | 2016-07-02 17:21:12 -0700 | [diff] [blame] | 208 | make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 209 | |