blob: f3d6a7ec9ef6ad3ff3ff5b286664657173f5d9aa [file] [log] [blame]
Scott Bakerebbe1372016-06-09 16:11:11 -07001CONFIG_DIR:=$(shell pwd)
Scott Baker315e3872016-06-09 09:24:04 -07002DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
3BOOTSTRAP_YML=./docker-compose-bootstrap.yml
Scott Bakerebbe1372016-06-09 16:11:11 -07004DOCKER_PROJECT=cordpod
Scott Baker315e3872016-06-09 09:24:04 -07005
Andy Bavier4c575802016-02-09 09:23:27 -05006.PHONY: xos
Scott Baker315e3872016-06-09 09:24:04 -07007xos: prereqs bootstrap onboarding podconfig
Scott Baker52544052016-05-02 09:34:59 -07008
Scott Baker315e3872016-06-09 09:24:04 -07009prereqs:
10 sudo make -f ../common/Makefile.prereqs
Scott Baker52544052016-05-02 09:34:59 -070011
Scott Baker315e3872016-06-09 09:24:04 -070012bootstrap:
13 echo "[BOOTSTRAP]"
14 sudo rm -f onboarding-docker-compose/docker-compose.yml
15 sudo docker-compose -p $(DOCKER_PROJECT) -f docker-compose-bootstrap.yml up -d
16 bash ../common/wait_for_xos_port.sh 81
17 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run -e CONFIG_DIR=$(CONFIG_DIR) xos_bootstrap_ui python /opt/xos/tosca/run.py none /opt/xos/configurations/cord-pod/xos.yaml
18
19onboarding:
20 echo "[ONBOARDING]"
Scott Baker315e3872016-06-09 09:24:04 -070021 # on-board any services here
Scott Bakerebbe1372016-06-09 16:11:11 -070022 bash ../common/wait_for_onboarding_ready.sh 81 xos
Scott Baker3127efd2016-06-13 19:52:28 -070023 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/cord-pod/disable-onboarding.yaml
Scott Bakerb91a4a52016-06-13 15:47:07 -070024 sudo cp id_rsa key_import/vsg_rsa
25 sudo cp id_rsa.pub key_import/vsg_rsa.pub
26 sudo cp id_rsa key_import/volt_rsa
27 sudo cp id_rsa.pub key_import/volt_rsa.pub
Scott Bakerb908a0c2016-06-14 01:43:59 -070028 sudo cp id_rsa key_import/onos_rsa
29 sudo cp id_rsa key_import/onos_rsa.pub
Scott Baker31ac85b2016-06-14 14:52:05 -070030 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/vrouter/vrouter-onboard.yaml
Scott Baker40722d02016-06-13 19:04:24 -070031 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/volt/volt-onboard.yaml
32 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/vsg/vsg-onboard.yaml
Scott Bakerb908a0c2016-06-14 01:43:59 -070033 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/vtn/vtn-onboard.yaml
34 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/onos/onos-onboard.yaml
Scott Baker01f3d1c2016-06-14 11:13:15 -070035 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/fabric/fabric-onboard.yaml
Scott Baker599d6b02016-06-14 12:51:27 -070036 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/onboard/vtr/vtr-onboard.yaml
Scott Baker39c25212016-06-13 21:41:06 -070037 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/cord-pod/synchronizers.yaml
Scott Baker3127efd2016-06-13 19:52:28 -070038 sudo docker-compose -p $(DOCKER_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py None /opt/xos/configurations/cord-pod/enable-onboarding.yaml
Scott Baker31ac85b2016-06-14 14:52:05 -070039 bash ../common/wait_for_onboarding_ready.sh 81 services/vrouter
Scott Bakerb91a4a52016-06-13 15:47:07 -070040 bash ../common/wait_for_onboarding_ready.sh 81 services/volt
41 bash ../common/wait_for_onboarding_ready.sh 81 services/vsg
Scott Bakerb908a0c2016-06-14 01:43:59 -070042 bash ../common/wait_for_onboarding_ready.sh 81 services/vtn
43 bash ../common/wait_for_onboarding_ready.sh 81 services/onos
Scott Baker01f3d1c2016-06-14 11:13:15 -070044 bash ../common/wait_for_onboarding_ready.sh 81 services/fabric
Scott Baker599d6b02016-06-14 12:51:27 -070045 bash ../common/wait_for_onboarding_ready.sh 81 services/vtr
Scott Bakerebbe1372016-06-09 16:11:11 -070046 bash ../common/wait_for_onboarding_ready.sh 81 xos
47 bash ../common/wait_for_xos_port.sh 80
Scott Baker315e3872016-06-09 09:24:04 -070048
49podconfig: nodes.yaml images.yaml
50 echo "[PODCONFIG]"
Scott Bakerebbe1372016-06-09 16:11:11 -070051 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py none /opt/xos/configurations/common/fixtures.yaml
52 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py none /opt/xos/configurations/common/mydeployment.yaml
53 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/setup.yaml
54 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
55 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/images.yaml
Andy Bavier237862b2016-02-16 15:39:49 -050056
Andy Bavier8a71f802016-04-26 16:29:06 -040057vtn: vtn-external.yaml
Scott Bakerebbe1372016-06-09 16:11:11 -070058 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/vtn-external.yaml
Andy Bavier237862b2016-02-16 15:39:49 -050059
Andy Bavier1f1f9af2016-06-10 17:31:05 -040060fabric: fabric.yaml
61 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/fabric.yaml
62
Scott Baker26d31fa2016-05-19 09:52:17 -070063cord: vsg_custom_images
Scott Bakerebbe1372016-06-09 16:11:11 -070064 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/mgmt-net.yaml
65 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/cord-vtn-vsg.yaml
66 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/cord-volt-devices.yaml
Andy Bavier4c575802016-02-09 09:23:27 -050067
Andy Bavier160e2aa2016-06-15 14:41:26 -070068clean-nodes:
69 rm -f nodes.yaml
70
71update-nodes: nodes.yaml
72 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/nodes.yaml
73
74new-nodes: clean-nodes update-nodes vtn
75
Andy Bavier07c33042016-04-08 16:34:52 -040076exampleservice:
Scott Bakerdd16efb2016-06-09 22:56:22 -070077 sudo cp id_rsa key_import/exampleservice_rsa
78 sudo cp id_rsa.pub key_import/exampleservice_rsa.pub
79 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/onboard/exampleservice/exampleservice-onboard.yaml
80 bash ../common/wait_for_onboarding_ready.sh 81 xos
Scott Bakercf444172016-06-10 16:17:18 -070081 bash ../common/wait_for_xos_port.sh 80
Scott Bakerdd16efb2016-06-09 22:56:22 -070082 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) run xos_ui python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/pod-exampleservice.yaml
Andy Bavier07c33042016-04-08 16:34:52 -040083
Srikanth Vavilapalli1c68c472016-03-02 18:22:04 +000084cord-ceilometer: ceilometer_custom_images cord
85 sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /root/setup/ceilometer.yaml
86
Andy Bavier4c575802016-02-09 09:23:27 -050087nodes.yaml:
88 export SETUPDIR=.; bash ../common/make-nodes-yaml.sh
89
90images.yaml:
91 export SETUPDIR=.; bash ../common/make-images-yaml.sh
92
Andy Bavier8a71f802016-04-26 16:29:06 -040093vtn-external.yaml:
94 export SETUPDIR=.; bash ./make-vtn-external-yaml.sh
95
Andy Bavier1f1f9af2016-06-10 17:31:05 -040096fabric.yaml:
97 export SETUPDIR=.; bash ./make-fabric-yaml.sh
98
Andy Bavier606beb42016-02-15 14:34:33 -050099virtualbng_json:
100 export SETUPDIR=.; bash ./make-virtualbng-json.sh
101
Andy Bavier4c575802016-02-09 09:23:27 -0500102vtn_network_cfg_json:
103 export SETUPDIR=.; bash ./make-vtn-networkconfig-json.sh
104
Srikanth Vavilapalli1c68c472016-03-02 18:22:04 +0000105stop:
Scott Baker634a1a72016-06-09 16:15:12 -0700106 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
107 sudo docker-compose -f $(BOOTSTRAP_YML) stop
Srikanth Vavilapalli1c68c472016-03-02 18:22:04 +0000108
109rm:
Scott Baker634a1a72016-06-09 16:15:12 -0700110 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm
111 sudo docker-compose -f $(BOOTSTRAP_YML) rm
Srikanth Vavilapalli1c68c472016-03-02 18:22:04 +0000112
113showlogs:
114 sudo MYIP=$(MYIP) docker-compose logs
115
116cleanup: stop rm
117 ./cleanup.sh
118 bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
119
Scott Baker315e3872016-06-09 09:24:04 -0700120ceilometer_custom_images: images/ceilometer-trusty-server-multi-nic.img
121 bash -c "source ./admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file ./images/ceilometer-trusty-server-multi-nic.img --container-format bare"
Srikanth Vavilapalli1c68c472016-03-02 18:22:04 +0000122
Scott Baker315e3872016-06-09 09:24:04 -0700123vsg_custom_images: images/vsg-1.0.img
124 bash -c "source ./admin-openrc.sh; glance image-show vsg-1.0 || glance image-create --name vsg-1.0 --disk-format qcow2 --file ./images/vsg-1.0.img --container-format bare"
125
126images/ceilometer-trusty-server-multi-nic.img: images
127 wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images
128 mv ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ./images/ceilometer-trusty-server-multi-nic.img
129
130images/vsg-1.0.img: images
131 wget http://www.vicci.org/cord/vsg-1.0.img -P ./images
132
133images:
134 mkdir -p ./images
Scott Baker26d31fa2016-05-19 09:52:17 -0700135
Andy Bavier4c575802016-02-09 09:23:27 -0500136.PHONY: local_containers
137local_containers:
Scott Baker315e3872016-06-09 09:24:04 -0700138 echo "" > ../../../containers/xos/local_certs.crt
139 for CRT in $$(ls /usr/local/share/ca-certificates/*) ; do \
140 echo Adding Certificate: $$CRT ;\
141 cat $$CRT >> ../../../containers/xos/local_certs.crt ;\
142 echo "" >> ../../../containers/xos/local_certs.crt ;\
143 done
Andy Bavier4c575802016-02-09 09:23:27 -0500144 cd ../../../containers/xos; make devel
145 cd ../../../containers/synchronizer; make
Scott Bakerebbe1372016-06-09 16:11:11 -0700146 cd ../../../containers/onboarding_synchronizer; make