blob: 0a2a6efa5a29059d4ef9ca88462043a13cbcb297 [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
Scott Baker785f7112016-08-19 10:04:05 -070049 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
50 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/openstack/xos/openstack-onboard.yaml
51 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
52 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/openstack
53 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
Scott Baker8ed63bb2016-07-07 14:20:08 -070054 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
55
56develconfig:
57 $(RUN_TOSCA) ../common/cloudlab-openstack.yaml
58 $(RUN_TOSCA) ../setup/nodes.yaml
Scott Baker50421662016-06-27 22:09:48 -070059
60common_cloudlab:
61 make -C ../common -f Makefile.cloudlab
62
63common_devstack:
64 make -C ../common -f Makefile.devstack
65
66base:
Scott Baker8ed63bb2016-07-07 14:20:08 -070067 make -f ../common/Makefile.containers xos_base
Scott Baker50421662016-06-27 22:09:48 -070068
69local_containers:
Scott Baker8ed63bb2016-07-07 14:20:08 -070070 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
Scott Baker50421662016-06-27 22:09:48 -070071
72stop:
Scott Baker8ed63bb2016-07-07 14:20:08 -070073 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
74 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
Scott Baker50421662016-06-27 22:09:48 -070075
76showlogs:
Scott Baker8ed63bb2016-07-07 14:20:08 -070077 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
Scott Baker50421662016-06-27 22:09:48 -070078
79rm: stop
Scott Baker8ed63bb2016-07-07 14:20:08 -070080 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
81 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
Scott Baker50421662016-06-27 22:09:48 -070082
83ps:
84 sudo MYIP=$(MYIP) docker-compose ps
85
Scott Baker50421662016-06-27 22:09:48 -070086upgrade_pkgs:
87 sudo pip install httpie --upgrade
Scott Baker785f7112016-08-19 10:04:05 -070088
89rebuild:
90 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
91 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos