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 | |
| 35 | bootstrap: |
| 36 | echo "[BOOTSTRAP]" |
| 37 | sudo rm -f onboarding-docker-compose/docker-compose.yml |
| 38 | sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d |
| 39 | bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT) |
| 40 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml |
| 41 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml |
| 42 | $(RUN_TOSCA_BOOTSTRAP) xos.yaml |
| 43 | |
| 44 | onboarding: |
| 45 | echo "[ONBOARDING]" |
| 46 | # on-board any services here |
| 47 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 48 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 49 | |
| 50 | frontendconfig: |
| 51 | echo "[FRONTENDCONFIG]" |
| 52 | $(RUN_TOSCA) sample.yaml |
| 53 | |
Scott Baker | bda441d | 2016-06-28 14:14:31 -0700 | [diff] [blame] | 54 | containers: prereqs download_xos |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 55 | make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer |
| 56 | |
| 57 | stop: |
| 58 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop |
| 59 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop |
| 60 | |
| 61 | showlogs: |
| 62 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
| 63 | |
| 64 | rm: stop |
| 65 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm |
| 66 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm |
| 67 | |
| 68 | ps: |
| 69 | sudo docker-compose ps |
| 70 | |
| 71 | enter-xos: |
| 72 | sudo docker exec -ti frontend_xos_ui_1 bash |
| 73 | |
| 74 | django-restart: |
| 75 | sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py |
| 76 | |
| 77 | clean-config-folder: |
| 78 | sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config |
| 79 | sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config |
| 80 | |
| 81 | mock-cord-pod: onboard-cord-pod |
| 82 | $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml |
| 83 | $(RUN_TOSCA) ../cord-pod/cord-vtn-vsg.yaml |
| 84 | $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 85 | |
| 86 | onboard-cord-pod: |
| 87 | sudo bash -c "echo somekey > key_import/vsg_rsa" |
| 88 | sudo bash -c "echo somekey > key_import/vsg_rsa.pub" |
| 89 | sudo bash -c "echo somekey > key_import/volt_rsa" |
| 90 | sudo bash -c "echo somekey > key_import/volt_rsa.pub" |
| 91 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml |
| 92 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml |
| 93 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml |
Scott Baker | 418f247 | 2016-06-28 11:57:08 -0700 | [diff] [blame] | 94 | $(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 95 | bash ../common/wait_for_onboarding_ready.sh 9998 services/vrouter |
| 96 | bash ../common/wait_for_onboarding_ready.sh 9998 services/volt |
| 97 | bash ../common/wait_for_onboarding_ready.sh 9998 services/vsg |
| 98 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 99 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 100 | |
| 101 | mock-mcord: |
| 102 | # check this |
| 103 | $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml |
| 104 | $(RUN_TOSCA) mocks/mcord.yaml |
| 105 | sudo docker exec frontend_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/ |
| 106 | sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py |
| 107 | |
| 108 | exampleservice: |
| 109 | mkdir -p key_import |
| 110 | # fake keys are fine |
| 111 | sudo bash -c "echo somekey > key_import/exampleservice_rsa" |
| 112 | sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub" |
| 113 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml |
| 114 | bash ../common/wait_for_onboarding_ready.sh 9998 services/exampleservice |
| 115 | bash ../common/wait_for_onboarding_ready.sh 9998 xos |