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