blob: a1f08d6280f6affd37930a4eb0dd3526b116a167 [file] [log] [blame]
Rizwan Haider752a48c2016-08-18 15:37:06 -04001include ../common/Makedefs
2
3MYIP:=$(shell hostname -i)
4CONFIG_DIR:=$(shell pwd)
5DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
6BOOTSTRAP_YML=./docker-compose-bootstrap.yml
7DOCKER_PROJECT=metronetwork
8BOOTSTRAP_PROJECT=metronetworkdbs
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)
15
Matteo Scandolo74a062a2016-09-23 14:15:06 -070016metronetwork: prereqs dirs download_xos download_services bootstrap onboarding services
Rizwan Haider752a48c2016-08-18 15:37:06 -040017
18prereqs:
19 sudo make -f ../common/Makefile.prereqs
20
21dirs:
22 # if this directory doesn't exist, then docker-compose will create it with root permission
23 mkdir -p key_import
24 mkdir -p onboarding-docker-compose
25
26download_xos:
27 make -f ../common/Makefile.services xos_core
28
29download_services:
30 make -f ../common/Makefile.services
31
32update_services:
33 make -f ../common/Makefile.services update
34
35update_xos:
36 make -f ../common/Makefile.services update_xos
37
38bootstrap:
39 @echo "[BOOTSTRAP]"
40 sudo rm -f onboarding-docker-compose/docker-compose.yml
41 sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
42 bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
43 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
44 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
45 $(RUN_TOSCA_BOOTSTRAP) xos.yaml
46 $(RUN_TOSCA_BOOTSTRAP) dashboard.yaml
47
48onboarding:
49 @echo "[ONBOARDING]"
50 # on-board the metronetwork service
51 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
52 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
53 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/metro-net/xos/metronetworkservice-onboard.yaml
54 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
55 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/metronetwork
56 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
57 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
58
Matteo Scandoloe3b8b692016-09-26 13:12:09 -070059vrouter_service:
60 @echo "[ONBOARDING]"
61 # on-board the metronetwork service
62 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
63 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
64 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
65 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
66 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/vrouter
67 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
68 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
69
Matteo Scandolo74a062a2016-09-23 14:15:06 -070070services:
71 $(RUN_TOSCA) ecord-services.yaml
72
Rizwan Haider752a48c2016-08-18 15:37:06 -040073containers: prereqs download_xos
74 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
75
76rebuild:
77 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
78 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
79
80stop:
81 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
82 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
83
84showlogs:
85 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
86
87showlogs_bootstrap:
88 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
89
90rm: stop
91 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
92 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
93
94ps:
95 sudo docker-compose ps
96
97enter-ui:
98 sudo docker exec -ti metronetwork_xos_ui_1 bash
99
100enter-bootstrap-ui:
101 sudo docker exec -ti metronetworkdbs_xos_bootstrap_ui_1 bash
102
103enter-db:
104 sudo docker exec -ti metronetworkdbs_xos_db_1 bash
105
106django-restart:
107 sudo docker exec metronetwork_xos_ui_1 touch /opt/xos/xos/settings.py
108
109clean-config-folder:
110 sudo docker exec metronetwork_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
111 sudo docker exec metronetwork_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
112
113