Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | include ../common/Makedefs |
| 2 | |
| 3 | MYIP:=$(shell hostname -i) |
| 4 | CONFIG_DIR:=$(shell pwd) |
| 5 | DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml |
| 6 | BOOTSTRAP_YML=./docker-compose-bootstrap.yml |
| 7 | DOCKER_PROJECT=frontend |
| 8 | BOOTSTRAP_PROJECT=frontendbs |
| 9 | XOS_BOOTSTRAP_PORT=9998 |
| 10 | XOS_UI_PORT=9999 |
| 11 | ADMIN_USERNAME=padmin@vicci.org |
| 12 | ADMIN_PASSWORD=letmein |
| 13 | RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD) |
| 14 | RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD) |
| 15 | |
Scott Baker | bda441d | 2016-06-28 14:14:31 -0700 | [diff] [blame] | 16 | frontend: prereqs dirs download_xos download_services bootstrap onboarding frontendconfig |
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 | |
Scott Baker | bda441d | 2016-06-28 14:14:31 -0700 | [diff] [blame] | 26 | download_xos: |
| 27 | make -f ../common/Makefile.services xos_core |
| 28 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 29 | download_services: |
| 30 | make -f ../common/Makefile.services |
| 31 | |
| 32 | update_services: |
| 33 | make -f ../common/Makefile.services update |
| 34 | |
Scott Baker | 1b29f97 | 2016-07-01 09:20:58 -0700 | [diff] [blame] | 35 | update_xos: |
| 36 | make -f ../common/Makefile.services update_xos |
| 37 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 38 | bootstrap: |
Scott Baker | c5e2f3c | 2016-07-11 11:48:06 -0700 | [diff] [blame] | 39 | @echo "[BOOTSTRAP]" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 40 | sudo rm -f onboarding-docker-compose/docker-compose.yml |
| 41 | sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d |
| 42 | bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT) |
| 43 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml |
| 44 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml |
| 45 | $(RUN_TOSCA_BOOTSTRAP) xos.yaml |
| 46 | |
| 47 | onboarding: |
Scott Baker | c5e2f3c | 2016-07-11 11:48:06 -0700 | [diff] [blame] | 48 | @echo "[ONBOARDING]" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 49 | # on-board any services here |
| 50 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 51 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 52 | |
| 53 | frontendconfig: |
Scott Baker | c5e2f3c | 2016-07-11 11:48:06 -0700 | [diff] [blame] | 54 | @echo "[FRONTENDCONFIG]" |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 55 | $(RUN_TOSCA) sample.yaml |
| 56 | |
Matteo Scandolo | 6b3ee5d | 2016-08-05 10:49:09 -0700 | [diff] [blame] | 57 | local_containers: prereqs download_xos |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 58 | make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer |
| 59 | |
Scott Baker | 4b37d1a | 2016-07-01 13:41:52 -0700 | [diff] [blame] | 60 | rebuild: |
| 61 | bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT) |
| 62 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 63 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 64 | stop: |
| 65 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop |
| 66 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop |
| 67 | |
| 68 | showlogs: |
Scott Baker | cada198 | 2016-06-30 15:26:16 -0700 | [diff] [blame] | 69 | sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs |
| 70 | |
| 71 | showlogs_bootstrap: |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 72 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
| 73 | |
| 74 | rm: stop |
Scott Baker | 1b29f97 | 2016-07-01 09:20:58 -0700 | [diff] [blame] | 75 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f |
| 76 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f |
Scott Baker | 4a93faa | 2016-08-23 16:59:25 -0700 | [diff] [blame] | 77 | [ -n "$(shell docker images -f \"dangling=true\" -q)" ] && docker rmi $(shell docker images -f "dangling=true" -q) || true |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 78 | |
| 79 | ps: |
| 80 | sudo docker-compose ps |
| 81 | |
Matteo Scandolo | 6fde718 | 2016-07-13 12:03:00 -0700 | [diff] [blame] | 82 | enter-ui: |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 83 | sudo docker exec -ti frontend_xos_ui_1 bash |
| 84 | |
Matteo Scandolo | 6fde718 | 2016-07-13 12:03:00 -0700 | [diff] [blame] | 85 | enter-bootstrap-ui: |
| 86 | sudo docker exec -ti frontendbs_xos_bootstrap_ui_1 bash |
| 87 | |
| 88 | enter-db: |
| 89 | sudo docker exec -ti frontendbs_xos_db_1 bash |
| 90 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 91 | django-restart: |
| 92 | sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py |
| 93 | |
| 94 | clean-config-folder: |
| 95 | sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config |
| 96 | sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config |
| 97 | |
| 98 | mock-cord-pod: onboard-cord-pod |
| 99 | $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml |
Scott Baker | 21ecb20 | 2016-08-01 16:03:25 -0700 | [diff] [blame] | 100 | $(RUN_TOSCA) mocks/onos.yaml |
Scott Baker | ee0a4ff | 2016-06-30 16:08:58 -0700 | [diff] [blame] | 101 | $(RUN_TOSCA) ../cord-pod/cord-services.yaml |
| 102 | $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 103 | $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 104 | |
| 105 | onboard-cord-pod: |
| 106 | sudo bash -c "echo somekey > key_import/vsg_rsa" |
| 107 | sudo bash -c "echo somekey > key_import/vsg_rsa.pub" |
| 108 | sudo bash -c "echo somekey > key_import/volt_rsa" |
| 109 | sudo bash -c "echo somekey > key_import/volt_rsa.pub" |
Scott Baker | 21ecb20 | 2016-08-01 16:03:25 -0700 | [diff] [blame] | 110 | sudo bash -c "echo somekey > key_import/onos_rsa" |
| 111 | sudo bash -c "echo somekey > key_import/onos_rsa.pub" |
Scott Baker | 35a42cf | 2016-07-28 16:09:44 -0700 | [diff] [blame] | 112 | $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 113 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml |
| 114 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml |
| 115 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml |
Scott Baker | 21ecb20 | 2016-08-01 16:03:25 -0700 | [diff] [blame] | 116 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml |
| 117 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/fabric-onboard.yaml |
| 118 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml |
Scott Baker | 418f247 | 2016-06-28 11:57:08 -0700 | [diff] [blame] | 119 | $(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml |
Scott Baker | 35a42cf | 2016-07-28 16:09:44 -0700 | [diff] [blame] | 120 | $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 121 | bash ../common/wait_for_onboarding_ready.sh 9998 services/vrouter |
| 122 | bash ../common/wait_for_onboarding_ready.sh 9998 services/volt |
| 123 | bash ../common/wait_for_onboarding_ready.sh 9998 services/vsg |
Scott Baker | 21ecb20 | 2016-08-01 16:03:25 -0700 | [diff] [blame] | 124 | bash ../common/wait_for_onboarding_ready.sh 9998 services/onos |
| 125 | bash ../common/wait_for_onboarding_ready.sh 9998 services/fabric |
| 126 | bash ../common/wait_for_onboarding_ready.sh 9998 services/vtr |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 127 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 128 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 129 | |
| 130 | mock-mcord: |
| 131 | # check this |
| 132 | $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml |
| 133 | $(RUN_TOSCA) mocks/mcord.yaml |
| 134 | sudo docker exec frontend_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/ |
| 135 | sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py |
| 136 | |
| 137 | exampleservice: |
| 138 | mkdir -p key_import |
| 139 | # fake keys are fine |
| 140 | sudo bash -c "echo somekey > key_import/exampleservice_rsa" |
| 141 | sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub" |
| 142 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml |
Scott Baker | c4d0d3c | 2016-07-05 17:09:43 -0700 | [diff] [blame] | 143 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice |
| 144 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
Matteo Scandolo | 74321fe | 2016-07-19 14:41:54 -0700 | [diff] [blame] | 145 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 146 | |
Scott Baker | f12eed7 | 2016-08-08 11:12:51 -0700 | [diff] [blame] | 147 | hypercache: |
| 148 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/hypercache/xos/hpc-onboard.yaml |
| 149 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/hpc |
| 150 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 151 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 152 | $(RUN_TOSCA) mocks/cdn.yaml |
| 153 | $(RUN_TOSCA) ../opencloud/cdn-content.yaml |
| 154 | |
Matteo Scandolo | 74321fe | 2016-07-19 14:41:54 -0700 | [diff] [blame] | 155 | dashboard: |
| 156 | $(RUN_TOSCA) ./dashboard.yaml |
| 157 | |
Matteo Scandolo | 6b1cfb9 | 2016-09-30 17:07:35 -0700 | [diff] [blame] | 158 | # before executing this clone the service from: https://github.com/teone/mcord-slicing-ui.git |
| 159 | onboard-mcord-slicing: slicing-ui |
| 160 | # fix ports (now they are set to use the FE config ones |
| 161 | @echo "[ONBOARDING UI SERVICES]" |
| 162 | bash ../common/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos |
| 163 | $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml |
| 164 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/mcord-ui-slicing/xos/mcord-slicing-onboard.yaml |
| 165 | $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml |
| 166 | bash ../common/wait_for_onboarding_ready.sh $(XOS_UI_PORT) xos |
| 167 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 168 | |
| 169 | slicing-ui: |
| 170 | $(RUN_TOSCA) ./mocks/mcord-slicing-ui.yaml |