blob: d4d9291ed054b26b596e4fc8d45dbd207239e0a2 [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
Scott Baker5ccabfe2016-08-22 16:49:14 -070036bootstrap: xos.yaml
Scott Baker8ed63bb2016-07-07 14:20:08 -070037 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
Scott Baker5ccabfe2016-08-22 16:49:14 -070045xos.yaml: xos.m4
46 m4 -D CTLIP=$(MYIP) < xos.m4 > xos.yaml
47
Scott Baker8ed63bb2016-07-07 14:20:08 -070048onboarding:
49 echo "[ONBOARDING]"
50 # on-board any services here
51 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
Scott Baker785f7112016-08-19 10:04:05 -070052 $(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 Baker8ed63bb2016-07-07 14:20:08 -070057 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
58
59develconfig:
60 $(RUN_TOSCA) ../common/cloudlab-openstack.yaml
61 $(RUN_TOSCA) ../setup/nodes.yaml
Scott Baker50421662016-06-27 22:09:48 -070062
63common_cloudlab:
64 make -C ../common -f Makefile.cloudlab
65
66common_devstack:
67 make -C ../common -f Makefile.devstack
68
69base:
Scott Baker8ed63bb2016-07-07 14:20:08 -070070 make -f ../common/Makefile.containers xos_base
Scott Baker50421662016-06-27 22:09:48 -070071
72local_containers:
Scott Baker8ed63bb2016-07-07 14:20:08 -070073 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
Scott Baker50421662016-06-27 22:09:48 -070074
75stop:
Scott Baker8ed63bb2016-07-07 14:20:08 -070076 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 Baker50421662016-06-27 22:09:48 -070078
79showlogs:
Scott Baker8ed63bb2016-07-07 14:20:08 -070080 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
Scott Baker50421662016-06-27 22:09:48 -070081
82rm: stop
Scott Baker8ed63bb2016-07-07 14:20:08 -070083 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 Baker50421662016-06-27 22:09:48 -070085
86ps:
87 sudo MYIP=$(MYIP) docker-compose ps
88
Scott Baker50421662016-06-27 22:09:48 -070089upgrade_pkgs:
90 sudo pip install httpie --upgrade
Scott Baker785f7112016-08-19 10:04:05 -070091
92rebuild:
93 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
94 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos