blob: 2bf5f504429c552faaeb9e4ba87b70db38e0cdcb [file] [log] [blame]
Scott Baker8ed63bb2016-07-07 14:20:08 -07001include ../common/Makedefs
2
Scott Baker50421662016-06-27 22:09:48 -07003MYIP:=$(shell hostname -i)
Scott Baker8ed63bb2016-07-07 14:20:08 -07004CONFIG_DIR:=$(shell pwd)
5DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
6BOOTSTRAP_YML=./docker-compose-bootstrap.yml
7DOCKER_PROJECT=devel
8BOOTSTRAP_PROJECT=develbs
9XOS_BOOTSTRAP_PORT=9998
10XOS_UI_PORT=9999
11ADMIN_USERNAME=padmin@vicci.org
12ADMIN_PASSWORD=letmein
13RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
14RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD)
Scott Baker50421662016-06-27 22:09:48 -070015
Scott Baker8ed63bb2016-07-07 14:20:08 -070016cloudlab: download_xos common_cloudlab local_containers xos
Scott Baker50421662016-06-27 22:09:48 -070017
Scott Baker8ed63bb2016-07-07 14:20:08 -070018devstack: download_xos upgrade_pkgs common_devstack local_containers xos
Scott Baker50421662016-06-27 22:09:48 -070019
Scott Baker8ed63bb2016-07-07 14:20:08 -070020xos: dirs download_services bootstrap onboarding develconfig
21
22dirs:
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
27download_xos:
28 make -f ../common/Makefile.services xos_core
29
30download_services:
31 make -f ../common/Makefile.services
32
33update_services:
34 make -f ../common/Makefile.services update
35
36bootstrap:
37 echo "[BOOTSTRAP]"
38 sudo rm -f onboarding-docker-compose/docker-compose.yml
Scott Baker6f0f4ae2016-07-07 16:39:15 -070039 sudo CONFIG_DIR=$(CONFIG_DIR) MYIP=$(MYIP) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
Scott Baker8ed63bb2016-07-07 14:20:08 -070040 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
45onboarding:
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
51develconfig:
52 $(RUN_TOSCA) ../common/cloudlab-openstack.yaml
53 $(RUN_TOSCA) ../setup/nodes.yaml
Scott Baker50421662016-06-27 22:09:48 -070054
55common_cloudlab:
56 make -C ../common -f Makefile.cloudlab
57
58common_devstack:
59 make -C ../common -f Makefile.devstack
60
61base:
Scott Baker8ed63bb2016-07-07 14:20:08 -070062 make -f ../common/Makefile.containers xos_base
Scott Baker50421662016-06-27 22:09:48 -070063
64local_containers:
Scott Baker8ed63bb2016-07-07 14:20:08 -070065 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
Scott Baker50421662016-06-27 22:09:48 -070066
67stop:
Scott Baker8ed63bb2016-07-07 14:20:08 -070068 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 Baker50421662016-06-27 22:09:48 -070070
71showlogs:
Scott Baker8ed63bb2016-07-07 14:20:08 -070072 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
Scott Baker50421662016-06-27 22:09:48 -070073
74rm: stop
Scott Baker8ed63bb2016-07-07 14:20:08 -070075 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 Baker50421662016-06-27 22:09:48 -070077
78ps:
79 sudo MYIP=$(MYIP) docker-compose ps
80
Scott Baker50421662016-06-27 22:09:48 -070081upgrade_pkgs:
82 sudo pip install httpie --upgrade