Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 1 | include ../common/Makedefs |
| 2 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 3 | MYIP:=$(shell hostname -i) |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 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=devel |
| 8 | BOOTSTRAP_PROJECT=develbs |
| 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) |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 15 | |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 16 | cloudlab: download_xos common_cloudlab local_containers xos |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 17 | |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 18 | devstack: download_xos upgrade_pkgs common_devstack local_containers xos |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 19 | |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 20 | xos: dirs download_services bootstrap onboarding develconfig |
| 21 | |
| 22 | dirs: |
| 23 | # if this directory doesn't exist, then docker-compose will create it with root permission |
| 24 | mkdir -p key_import |
| 25 | mkdir -p onboarding-docker-compose |
| 26 | |
| 27 | download_xos: |
| 28 | make -f ../common/Makefile.services xos_core |
| 29 | |
| 30 | download_services: |
| 31 | make -f ../common/Makefile.services |
| 32 | |
| 33 | update_services: |
| 34 | make -f ../common/Makefile.services update |
| 35 | |
Scott Baker | 5ccabfe | 2016-08-22 16:49:14 -0700 | [diff] [blame] | 36 | bootstrap: xos.yaml |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 37 | echo "[BOOTSTRAP]" |
| 38 | sudo rm -f onboarding-docker-compose/docker-compose.yml |
Scott Baker | 6f0f4ae | 2016-07-07 16:39:15 -0700 | [diff] [blame] | 39 | sudo CONFIG_DIR=$(CONFIG_DIR) MYIP=$(MYIP) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 40 | bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT) |
| 41 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml |
| 42 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml |
| 43 | $(RUN_TOSCA_BOOTSTRAP) xos.yaml |
| 44 | |
Scott Baker | 5ccabfe | 2016-08-22 16:49:14 -0700 | [diff] [blame] | 45 | xos.yaml: xos.m4 |
| 46 | m4 -D CTLIP=$(MYIP) < xos.m4 > xos.yaml |
| 47 | |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 48 | onboarding: |
| 49 | echo "[ONBOARDING]" |
| 50 | # on-board any services here |
| 51 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
Scott Baker | 785f711 | 2016-08-19 10:04:05 -0700 | [diff] [blame] | 52 | $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml |
| 53 | $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml |
| 54 | $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml |
| 55 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/openstack |
| 56 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 57 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 58 | |
| 59 | develconfig: |
| 60 | $(RUN_TOSCA) ../common/cloudlab-openstack.yaml |
| 61 | $(RUN_TOSCA) ../setup/nodes.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 62 | |
| 63 | common_cloudlab: |
| 64 | make -C ../common -f Makefile.cloudlab |
| 65 | |
| 66 | common_devstack: |
| 67 | make -C ../common -f Makefile.devstack |
| 68 | |
| 69 | base: |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 70 | make -f ../common/Makefile.containers xos_base |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 71 | |
| 72 | local_containers: |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 73 | make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 74 | |
| 75 | stop: |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 76 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop |
| 77 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 78 | |
| 79 | showlogs: |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 80 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 81 | |
| 82 | rm: stop |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 83 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f |
| 84 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f |
Scott Baker | 4a93faa | 2016-08-23 16:59:25 -0700 | [diff] [blame^] | 85 | [ -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] | 86 | |
| 87 | ps: |
| 88 | sudo MYIP=$(MYIP) docker-compose ps |
| 89 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 90 | upgrade_pkgs: |
| 91 | sudo pip install httpie --upgrade |
Scott Baker | 785f711 | 2016-08-19 10:04:05 -0700 | [diff] [blame] | 92 | |
| 93 | rebuild: |
| 94 | bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT) |
| 95 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |