blob: a6cd9b8c1ac14fb144247a793a66d0ee7cc890f5 [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
16frontend: prereqs dirs download_services bootstrap onboarding frontendconfig
17
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_services:
27 make -f ../common/Makefile.services
28
29update_services:
30 make -f ../common/Makefile.services update
31
32bootstrap:
33 echo "[BOOTSTRAP]"
34 sudo rm -f onboarding-docker-compose/docker-compose.yml
35 sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
36 bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
37 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
38 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
39 $(RUN_TOSCA_BOOTSTRAP) xos.yaml
40
41onboarding:
42 echo "[ONBOARDING]"
43 # on-board any services here
44 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
45 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
46
47frontendconfig:
48 echo "[FRONTENDCONFIG]"
49 $(RUN_TOSCA) sample.yaml
50
51containers:
52 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
53
54stop:
55 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
56 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
57
58showlogs:
59 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
60
61rm: stop
62 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm
63 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm
64
65ps:
66 sudo docker-compose ps
67
68enter-xos:
69 sudo docker exec -ti frontend_xos_ui_1 bash
70
71django-restart:
72 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
73
74clean-config-folder:
75 sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
76 sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
77
78mock-cord-pod: onboard-cord-pod
79 $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
80 $(RUN_TOSCA) ../cord-pod/cord-vtn-vsg.yaml
81 $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml
82 sudo docker exec frontend_xos_ui_1 cp /opt/xos/configurations/cord-pod/xos_cord_config /opt/xos/xos_configuration/
83 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
84
85onboard-cord-pod:
86 sudo bash -c "echo somekey > key_import/vsg_rsa"
87 sudo bash -c "echo somekey > key_import/vsg_rsa.pub"
88 sudo bash -c "echo somekey > key_import/volt_rsa"
89 sudo bash -c "echo somekey > key_import/volt_rsa.pub"
90 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
91 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
92 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
93 bash ../common/wait_for_onboarding_ready.sh 9998 services/vrouter
94 bash ../common/wait_for_onboarding_ready.sh 9998 services/volt
95 bash ../common/wait_for_onboarding_ready.sh 9998 services/vsg
96 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
97 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
98
99mock-mcord:
100 # check this
101 $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
102 $(RUN_TOSCA) mocks/mcord.yaml
103 sudo docker exec frontend_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
104 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
105
106exampleservice:
107 mkdir -p key_import
108 # fake keys are fine
109 sudo bash -c "echo somekey > key_import/exampleservice_rsa"
110 sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub"
111 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
112 bash ../common/wait_for_onboarding_ready.sh 9998 services/exampleservice
113 bash ../common/wait_for_onboarding_ready.sh 9998 xos