blob: 14c0dec4f6d7ad31b125f9cde4274925dbd1b19e [file] [log] [blame]
Scott Baker50421662016-06-27 22:09:48 -07001include ../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=frontend
8BOOTSTRAP_PROJECT=frontendbs
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
Scott Bakerbda441d2016-06-28 14:14:31 -070016frontend: prereqs dirs download_xos download_services bootstrap onboarding frontendconfig
Scott Baker50421662016-06-27 22:09:48 -070017
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
Scott Bakerbda441d2016-06-28 14:14:31 -070026download_xos:
27 make -f ../common/Makefile.services xos_core
28
Scott Baker50421662016-06-27 22:09:48 -070029download_services:
30 make -f ../common/Makefile.services
31
32update_services:
33 make -f ../common/Makefile.services update
34
Scott Baker1b29f972016-07-01 09:20:58 -070035update_xos:
36 make -f ../common/Makefile.services update_xos
37
Scott Baker50421662016-06-27 22:09:48 -070038bootstrap:
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070039 @echo "[BOOTSTRAP]"
Scott Baker50421662016-06-27 22:09:48 -070040 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
47onboarding:
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070048 @echo "[ONBOARDING]"
Scott Baker50421662016-06-27 22:09:48 -070049 # on-board any services here
50 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
51 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
52
53frontendconfig:
Scott Bakerc5e2f3c2016-07-11 11:48:06 -070054 @echo "[FRONTENDCONFIG]"
Scott Baker50421662016-06-27 22:09:48 -070055 $(RUN_TOSCA) sample.yaml
56
Scott Bakerbda441d2016-06-28 14:14:31 -070057containers: prereqs download_xos
Scott Baker50421662016-06-27 22:09:48 -070058 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
59
Scott Baker4b37d1a2016-07-01 13:41:52 -070060rebuild:
61 bash ../common/rebuild.sh $(XOS_BOOTSTRAP_PORT)
62 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
63
Scott Baker50421662016-06-27 22:09:48 -070064stop:
65 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
66 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
67
68showlogs:
Scott Bakercada1982016-06-30 15:26:16 -070069 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
70
71showlogs_bootstrap:
Scott Baker50421662016-06-27 22:09:48 -070072 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
73
74rm: stop
Scott Baker1b29f972016-07-01 09:20:58 -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 docker-compose ps
80
Matteo Scandolo6fde7182016-07-13 12:03:00 -070081enter-ui:
Scott Baker50421662016-06-27 22:09:48 -070082 sudo docker exec -ti frontend_xos_ui_1 bash
83
Matteo Scandolo6fde7182016-07-13 12:03:00 -070084enter-bootstrap-ui:
85 sudo docker exec -ti frontendbs_xos_bootstrap_ui_1 bash
86
87enter-db:
88 sudo docker exec -ti frontendbs_xos_db_1 bash
89
Scott Baker50421662016-06-27 22:09:48 -070090django-restart:
91 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
92
93clean-config-folder:
94 sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
95 sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
96
97mock-cord-pod: onboard-cord-pod
98 $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
Scott Baker21ecb202016-08-01 16:03:25 -070099 $(RUN_TOSCA) mocks/onos.yaml
Scott Bakeree0a4ff2016-06-30 16:08:58 -0700100 $(RUN_TOSCA) ../cord-pod/cord-services.yaml
101 $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
Scott Baker50421662016-06-27 22:09:48 -0700102 $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml
Scott Baker50421662016-06-27 22:09:48 -0700103
104onboard-cord-pod:
105 sudo bash -c "echo somekey > key_import/vsg_rsa"
106 sudo bash -c "echo somekey > key_import/vsg_rsa.pub"
107 sudo bash -c "echo somekey > key_import/volt_rsa"
108 sudo bash -c "echo somekey > key_import/volt_rsa.pub"
Scott Baker21ecb202016-08-01 16:03:25 -0700109 sudo bash -c "echo somekey > key_import/onos_rsa"
110 sudo bash -c "echo somekey > key_import/onos_rsa.pub"
Scott Baker35a42cf2016-07-28 16:09:44 -0700111 $(RUN_TOSCA_BOOTSTRAP) ../common/disable-onboarding.yaml
Scott Baker50421662016-06-27 22:09:48 -0700112 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
113 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
114 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
Scott Baker21ecb202016-08-01 16:03:25 -0700115 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/onos-service/xos/onos-onboard.yaml
116 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/fabric/xos/fabric-onboard.yaml
117 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vtr/xos/vtr-onboard.yaml
Scott Baker418f2472016-06-28 11:57:08 -0700118 $(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml
Scott Baker35a42cf2016-07-28 16:09:44 -0700119 $(RUN_TOSCA_BOOTSTRAP) ../common/enable-onboarding.yaml
Scott Baker50421662016-06-27 22:09:48 -0700120 bash ../common/wait_for_onboarding_ready.sh 9998 services/vrouter
121 bash ../common/wait_for_onboarding_ready.sh 9998 services/volt
122 bash ../common/wait_for_onboarding_ready.sh 9998 services/vsg
Scott Baker21ecb202016-08-01 16:03:25 -0700123 bash ../common/wait_for_onboarding_ready.sh 9998 services/onos
124 bash ../common/wait_for_onboarding_ready.sh 9998 services/fabric
125 bash ../common/wait_for_onboarding_ready.sh 9998 services/vtr
Scott Baker50421662016-06-27 22:09:48 -0700126 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
127 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
128
129mock-mcord:
130 # check this
131 $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
132 $(RUN_TOSCA) mocks/mcord.yaml
133 sudo docker exec frontend_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
134 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
135
136exampleservice:
137 mkdir -p key_import
138 # fake keys are fine
139 sudo bash -c "echo somekey > key_import/exampleservice_rsa"
140 sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub"
141 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
Scott Bakerc4d0d3c2016-07-05 17:09:43 -0700142 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/exampleservice
143 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
Matteo Scandolo74321fe2016-07-19 14:41:54 -0700144 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
145
146dashboard:
147 $(RUN_TOSCA) ./dashboard.yaml
148