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: |
| 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 Baker | bda441d | 2016-06-28 14:14:31 -0700 | [diff] [blame] | 35 | download_xos: |
| 36 | make -f ../common/Makefile.services xos_core |
| 37 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 38 | download_services: |
| 39 | make -f ../common/Makefile.services |
| 40 | |
| 41 | update_services: |
| 42 | make -f ../common/Makefile.services update |
| 43 | |
Scott Baker | 1b29f97 | 2016-07-01 09:20:58 -0700 | [diff] [blame] | 44 | update_xos: |
| 45 | make -f ../common/Makefile.services update_xos |
| 46 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 47 | onboarding: |
| 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 | |
| 77 | podconfig: nodes.yaml images.yaml |
| 78 | echo "[PODCONFIG]" |
| 79 | $(RUN_TOSCA) setup.yaml |
| 80 | $(RUN_TOSCA) nodes.yaml |
| 81 | $(RUN_TOSCA) images.yaml |
| 82 | |
| 83 | vtn: vtn-external.yaml |
| 84 | $(RUN_TOSCA) vtn-external.yaml |
| 85 | |
| 86 | fabric: fabric.yaml |
| 87 | $(RUN_TOSCA) fabric.yaml |
| 88 | |
| 89 | cord: vsg_custom_images |
| 90 | $(RUN_TOSCA) mgmt-net.yaml |
Andy Bavier | acfadd4 | 2016-06-30 16:46:32 -0400 | [diff] [blame] | 91 | $(RUN_TOSCA) cord-services.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 92 | $(RUN_TOSCA) cord-volt-devices.yaml |
| 93 | |
Andy Bavier | acfadd4 | 2016-06-30 16:46:32 -0400 | [diff] [blame] | 94 | cord-subscriber: |
| 95 | $(RUN_TOSCA) cord-test-subscriber.yaml |
| 96 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 97 | clean-nodes: |
| 98 | rm -f nodes.yaml |
| 99 | |
| 100 | update-nodes: nodes.yaml |
| 101 | $(RUN_TOSCA) nodes.yaml |
| 102 | |
| 103 | new-nodes: clean-nodes update-nodes vtn |
| 104 | |
Scott Baker | 4b37d1a | 2016-07-01 13:41:52 -0700 | [diff] [blame] | 105 | rebuild: |
| 106 | bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT) |
| 107 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 108 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 109 | exampleservice: onboard-exampleservice |
| 110 | $(RUN_TOSCA) pod-exampleservice.yaml |
| 111 | |
| 112 | onboard-exampleservice: |
| 113 | sudo cp id_rsa key_import/exampleservice_rsa |
| 114 | sudo cp id_rsa.pub key_import/exampleservice_rsa.pub |
| 115 | $(RUN_TOSCA_BOOSTRAP) $(SERVICE_DIR)/exampleservice/exampleservice-onboard.yaml |
| 116 | bash ../common/wait_for_onboarding_ready.sh 81 services/exampleservice |
| 117 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 118 | bash ../common/wait_for_xos_port.sh 80 |
| 119 | |
Scott Baker | d1545d3 | 2016-06-29 11:27:33 -0700 | [diff] [blame] | 120 | cord-monitoringservice: ceilometer_custom_images cord onboard-monitoringservice |
| 121 | $(RUN_TOSCA) monitoringservice.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 122 | |
Scott Baker | d1545d3 | 2016-06-29 11:27:33 -0700 | [diff] [blame] | 123 | onboard-monitoringservice: download-monitoringservice |
| 124 | sudo cp id_rsa key_import/monitoringservice_rsa |
| 125 | sudo cp id_rsa.pub key_import/monitoringservice_rsa.pub |
| 126 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml |
Srikanth Vavilapalli | 4cf2fed | 2016-07-01 21:27:20 +0000 | [diff] [blame] | 127 | $(RUN_TOSCA_BOOTSTRAP) monitoring_synchronizer.yaml |
Scott Baker | d1545d3 | 2016-06-29 11:27:33 -0700 | [diff] [blame] | 128 | bash ../common/wait_for_onboarding_ready.sh 81 services/monitoring |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 129 | bash ../common/wait_for_onboarding_ready.sh 81 xos |
| 130 | bash ../common/wait_for_xos_port.sh 80 |
| 131 | |
Scott Baker | d1545d3 | 2016-06-29 11:27:33 -0700 | [diff] [blame] | 132 | download-monitoringservice: |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 133 | make -f ../common/Makefile.services monitoring_services |
| 134 | |
| 135 | nodes.yaml: |
| 136 | export SETUPDIR=.; bash ../common/make-nodes-yaml.sh |
| 137 | |
| 138 | images.yaml: |
| 139 | export SETUPDIR=.; bash ../common/make-images-yaml.sh |
| 140 | |
| 141 | vtn-external.yaml: |
| 142 | export SETUPDIR=.; bash ./make-vtn-external-yaml.sh |
| 143 | |
| 144 | fabric.yaml: |
| 145 | export SETUPDIR=.; bash ./make-fabric-yaml.sh |
| 146 | |
| 147 | virtualbng_json: |
| 148 | export SETUPDIR=.; bash ./make-virtualbng-json.sh |
| 149 | |
| 150 | vtn_network_cfg_json: |
| 151 | export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh |
| 152 | |
| 153 | stop: |
| 154 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop |
| 155 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop |
| 156 | |
Scott Baker | 1b29f97 | 2016-07-01 09:20:58 -0700 | [diff] [blame] | 157 | rm: stop |
| 158 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f |
| 159 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 160 | |
| 161 | showlogs: |
Scott Baker | e80320c | 2016-06-30 10:21:11 -0700 | [diff] [blame] | 162 | sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs |
| 163 | |
| 164 | showlogs_bootstrap: |
| 165 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 166 | |
| 167 | cleanup: stop rm |
| 168 | ./cleanup.sh |
| 169 | bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list" |
| 170 | |
| 171 | ceilometer_custom_images: images/ceilometer-trusty-server-multi-nic.img |
| 172 | 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" |
| 173 | |
| 174 | vsg_custom_images: images/vsg-1.0.img |
| 175 | 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" |
| 176 | |
| 177 | images/ceilometer-trusty-server-multi-nic.img: images |
| 178 | wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images |
| 179 | mv ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ./images/ceilometer-trusty-server-multi-nic.img |
| 180 | |
| 181 | images/vsg-1.0.img: images |
| 182 | wget http://www.vicci.org/cord/vsg-1.0.img -P ./images |
| 183 | |
| 184 | images: |
| 185 | mkdir -p ./images |
| 186 | |
| 187 | .PHONY: local_containers |
Scott Baker | bda441d | 2016-06-28 14:14:31 -0700 | [diff] [blame] | 188 | local_containers: prereqs download_xos |
Zack Williams | efb5495 | 2016-07-02 17:21:12 -0700 | [diff] [blame^] | 189 | 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] | 190 | |