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 | |
| 36 | bootstrap: |
| 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 | |
| 45 | onboarding: |
| 46 | echo "[ONBOARDING]" |
| 47 | # on-board any services here |
| 48 | bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos |
| 49 | bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT) |
| 50 | |
| 51 | develconfig: |
| 52 | $(RUN_TOSCA) ../common/cloudlab-openstack.yaml |
| 53 | $(RUN_TOSCA) ../setup/nodes.yaml |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 54 | |
| 55 | common_cloudlab: |
| 56 | make -C ../common -f Makefile.cloudlab |
| 57 | |
| 58 | common_devstack: |
| 59 | make -C ../common -f Makefile.devstack |
| 60 | |
| 61 | base: |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 62 | make -f ../common/Makefile.containers xos_base |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 63 | |
| 64 | local_containers: |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 65 | make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 66 | |
| 67 | stop: |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 68 | test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop |
| 69 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 70 | |
| 71 | showlogs: |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -0700 | [diff] [blame] | 72 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 73 | |
| 74 | rm: stop |
Scott Baker | 8ed63bb | 2016-07-07 14:20:08 -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 | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 77 | |
| 78 | ps: |
| 79 | sudo MYIP=$(MYIP) docker-compose ps |
| 80 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 81 | upgrade_pkgs: |
| 82 | sudo pip install httpie --upgrade |