blob: 1a7a1f149d6125ac50b6266420a63386c7ee92cd [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:
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
47onboarding:
48 echo "[ONBOARDING]"
49 # 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:
54 echo "[FRONTENDCONFIG]"
55 $(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
60stop:
61 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
62 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
63
64showlogs:
Scott Bakercada1982016-06-30 15:26:16 -070065 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
66
67showlogs_bootstrap:
Scott Baker50421662016-06-27 22:09:48 -070068 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
69
70rm: stop
Scott Baker1b29f972016-07-01 09:20:58 -070071 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
72 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
Scott Baker50421662016-06-27 22:09:48 -070073
74ps:
75 sudo docker-compose ps
76
77enter-xos:
78 sudo docker exec -ti frontend_xos_ui_1 bash
79
80django-restart:
81 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
82
83clean-config-folder:
84 sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_mcord_config
85 sudo docker exec frontend_xos_ui_1 rm -f /opt/xos/xos_configuration/xos_cord_config
86
87mock-cord-pod: onboard-cord-pod
88 $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
Scott Bakeree0a4ff2016-06-30 16:08:58 -070089 $(RUN_TOSCA) ../cord-pod/cord-services.yaml
90 $(RUN_TOSCA) ../cord-pod/cord-test-subscriber.yaml
Scott Baker50421662016-06-27 22:09:48 -070091 $(RUN_TOSCA) ../cord-pod/cord-volt-devices.yaml
Scott Baker50421662016-06-27 22:09:48 -070092
93onboard-cord-pod:
94 sudo bash -c "echo somekey > key_import/vsg_rsa"
95 sudo bash -c "echo somekey > key_import/vsg_rsa.pub"
96 sudo bash -c "echo somekey > key_import/volt_rsa"
97 sudo bash -c "echo somekey > key_import/volt_rsa.pub"
98 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vrouter/xos/vrouter-onboard.yaml
99 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/olt/xos/volt-onboard.yaml
100 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/vsg/xos/vsg-onboard.yaml
Scott Baker418f2472016-06-28 11:57:08 -0700101 $(RUN_TOSCA_BOOTSTRAP) xos-cord-branding.yaml
Scott Baker50421662016-06-27 22:09:48 -0700102 bash ../common/wait_for_onboarding_ready.sh 9998 services/vrouter
103 bash ../common/wait_for_onboarding_ready.sh 9998 services/volt
104 bash ../common/wait_for_onboarding_ready.sh 9998 services/vsg
105 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
106 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
107
108mock-mcord:
109 # check this
110 $(RUN_TOSCA) ../cord-pod/mgmt-net.yaml
111 $(RUN_TOSCA) mocks/mcord.yaml
112 sudo docker exec frontend_xos_ui_1 cp /opt/xos/configurations/mcord/xos_mcord_config /opt/xos/xos_configuration/
113 sudo docker exec frontend_xos_ui_1 touch /opt/xos/xos/settings.py
114
115exampleservice:
116 mkdir -p key_import
117 # fake keys are fine
118 sudo bash -c "echo somekey > key_import/exampleservice_rsa"
119 sudo bash -c "echo somekey > key_import/exampleservice_rsa.pub"
120 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/exampleservice/xos/exampleservice-onboard.yaml
121 bash ../common/wait_for_onboarding_ready.sh 9998 services/exampleservice
122 bash ../common/wait_for_onboarding_ready.sh 9998 xos