blob: 20aa4874583ab2513b133fa7745d088082a3619a [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
35bootstrap:
36 echo "[BOOTSTRAP]"
37 sudo rm -f onboarding-docker-compose/docker-compose.yml
38 sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
39 bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
40 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
41 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
42 $(RUN_TOSCA_BOOTSTRAP) xos.yaml
43
44onboarding:
45 echo "[ONBOARDING]"
46 # on-board any services here
47 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
48 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
49
50frontendconfig:
51 echo "[FRONTENDCONFIG]"
52 $(RUN_TOSCA) sample.yaml
53
Scott Bakerbda441d2016-06-28 14:14:31 -070054containers: prereqs download_xos
Scott Baker50421662016-06-27 22:09:48 -070055 make -f ../common/Makefile.containers xos_devel synchronizer onboarding_synchronizer
56
57stop:
58 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
59 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
60
61showlogs:
Scott Bakercada1982016-06-30 15:26:16 -070062 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
63
64showlogs_bootstrap:
Scott Baker50421662016-06-27 22:09:48 -070065 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
66
67rm: stop
68 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm
69 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm
70
71ps:
72 sudo docker-compose ps
73
74enter-xos:
75 sudo docker exec -ti frontend_xos_ui_1 bash
76
77django-restart:
78 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
79
80clean-config-folder:
81 sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
82 sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
83
84mock-cord-pod: onboard-cord-pod
85 $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
Scott Bakeree0a4ff2016-06-30 16:08:58 -070086 $(RUN_TOSCA) ../cord-pod/cord-services.yaml
87 $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
Scott Baker50421662016-06-27 22:09:48 -070088 $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml
Scott Baker50421662016-06-27 22:09:48 -070089
90onboard-cord-pod:
91 sudo bash -c "echo somekey > key_import/vsg_rsa"
92 sudo bash -c "echo somekey > key_import/vsg_rsa.pub"
93 sudo bash -c "echo somekey > key_import/volt_rsa"
94 sudo bash -c "echo somekey > key_import/volt_rsa.pub"
95 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
96 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
97 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
Scott Baker418f2472016-06-28 11:57:08 -070098 $(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml
Scott Baker50421662016-06-27 22:09:48 -070099 bash ../common/wait_for_onboarding_ready.sh 9998 services/vrouter
100 bash ../common/wait_for_onboarding_ready.sh 9998 services/volt
101 bash ../common/wait_for_onboarding_ready.sh 9998 services/vsg
102 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
103 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
104
105mock-mcord:
106 # check this
107 $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
108 $(RUN_TOSCA) mocks/mcord.yaml
109 sudo docker exec frontend_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
110 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
111
112exampleservice:
113 mkdir -p key_import
114 # fake keys are fine
115 sudo bash -c "echo somekey > key_import/exampleservice_rsa"
116 sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub"
117 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
118 bash ../common/wait_for_onboarding_ready.sh 9998 services/exampleservice
119 bash ../common/wait_for_onboarding_ready.sh 9998 xos