blob: 07d49b589afbde52168ff340699341057f3e00fe [file] [log] [blame]
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +00001include ../common/Makedefs
2
Scott Baker50421662016-06-27 22:09:48 -07003MYIP:=$(shell hostname -i)
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +00004CONFIG_DIR:=$(shell pwd)
5DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml
6BOOTSTRAP_YML=./docker-compose-bootstrap.yml
7DOCKER_PROJECT=acord
8BOOTSTRAP_PROJECT=acordbs
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)
Scott Baker50421662016-06-27 22:09:48 -070015
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000016cloudlab: download_xos common_cloudlab local_containers xos
Scott Baker50421662016-06-27 22:09:48 -070017
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000018devstack: download_xos upgrade_pkgs common_devstack local_containers xos devstack_net_fix
Scott Baker50421662016-06-27 22:09:48 -070019
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000020xos: dirs download_services bootstrap onboarding develconfig
Scott Baker50421662016-06-27 22:09:48 -070021
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000022dirs:
23 # if this directory doesn't exist, then docker-compose will create it with root permission
24 mkdir -p key_import
25 mkdir -p onboarding-docker-compose
26
27download_xos:
28 make -f ../common/Makefile.services xos_core
29
30download_services:
31 make -f ../common/Makefile.services
32
33bootstrap:
34 echo "[BOOTSTRAP]"
35 sudo rm -f onboarding-docker-compose/docker-compose.yml
36 sudo CONFIG_DIR=$(CONFIG_DIR) MYIP=$(MYIP) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
37 bash ../common/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
38 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/fixtures.yaml
39 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < ../common/mydeployment.yaml
40 $(RUN_TOSCA_BOOTSTRAP) xos.yaml
41
42onboarding:
43 echo "[ONBOARDING]"
44 # on-board any services here
45 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
46 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
47
48develconfig:
49 $(RUN_TOSCA) ../common/cloudlab-openstack.yaml
50 $(RUN_TOSCA) ../setup/nodes.yaml
51
52cord-monitoringservice: devstack_ceilometer_custom_images onboard-monitoringservice ceilometer_devstack_cord_plugins
53 $(RUN_TOSCA) ceilometer.yaml
54
55onboard-monitoringservice: download-monitoringservice
56 sudo cp ~/.ssh/id_rsa key_import/monitoringservice_rsa
57 sudo cp ~/.ssh/id_rsa.pub key_import/monitoringservice_rsa.pub
58 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
59 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
60 bash ../common/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
61 bash ../common/wait_for_xos_port.sh $(XOS_UI_PORT)
62
63download-monitoringservice:
64 make -f ../common/Makefile.services monitoring_services
Scott Baker50421662016-06-27 22:09:48 -070065
66exampleservice:
67 #Ensure exampleservice is enabled in xos/tools/xos-manage and xos/settings.py file before uncommenting below lines
68 #sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/acord/acord-exampleservice.yaml
69
70containers:
71 cd ../../../containers/xos; make devel
72 cd ../../../containers/synchronizer; make
73
74common_cloudlab:
75 make -C ../common -f Makefile.cloudlab
76
77common_devstack:
78 make -C ../common -f Makefile.devstack
79
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000080local_containers:
81 make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer
82
Scott Baker50421662016-06-27 22:09:48 -070083ceilometer_cloudlab_cord_plugins:
84 if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
85 git clone https://github.com/srikanthvavila/ceilometer-plugins.git
86 sudo cp -r ceilometer-plugins/network/ext_services /usr/lib/python2.7/dist-packages/ceilometer/network/
87 sudo cp -r ceilometer-plugins/network/statistics/onos /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
88 sudo cp ceilometer-plugins/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
89 sudo cp ceilometer-plugins/entry_points.txt /usr/lib/python2.7/dist-packages/ceilometer-*egg-info/
90 sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
91 echo "Restarting ceilometer-agent-notification"
92 sudo service ceilometer-agent-notification restart
93 echo "Restarting ceilometer-agent-central"
94 sudo service ceilometer-agent-central restart
95
96ceilometer_devstack_cord_plugins:
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000097 #if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
98 #git clone https://github.com/srikanthvavila/ceilometer-plugins.git
99 #sudo cp -r ceilometer-plugins/network/ext_services /opt/stack/ceilometer/ceilometer/network/
100 #sudo cp ceilometer-plugins/entry_points.txt /opt/stack/ceilometer/ceilometer*egg-info/
101 #sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
102 #echo "Remember to restart ceilometer-anotification ceilometer-acentral screens"
Scott Baker50421662016-06-27 22:09:48 -0700103
104ceilometer_pub_sub:
105 if [ -d ./pub-sub ]; then rm -fr ./pub-sub; fi
106 git clone https://github.com/srikanthvavila/pub-sub.git
107 echo "Starting Ceilometer PUB/SUB service...Ensure zookeeper and kafka services are launched (if required)"
108 cd pub-sub/ceilometer_pub_sub/ ; python sub_main.py &
109 cd ../..
110
111stop:
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +0000112 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) stop
113 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) stop
Scott Baker50421662016-06-27 22:09:48 -0700114
115rm: stop
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +0000116 test ! -s $(DOCKER_COMPOSE_YML) || sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) rm -f
117 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) rm -f
Scott Baker50421662016-06-27 22:09:48 -0700118
119showlogs:
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +0000120 sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs
Scott Baker50421662016-06-27 22:09:48 -0700121
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +0000122showlogs_bootstrap:
123 sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs
Scott Baker50421662016-06-27 22:09:48 -0700124
125cleanup: stop rm
126 ./cleanup.sh
127 bash -c "source ../setup/admin-openrc.sh; nova list --all-tenants; neutron net-list"
128
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +0000129ps:
130 sudo MYIP=$(MYIP) docker-compose ps
131
Scott Baker50421662016-06-27 22:09:48 -0700132devstack_net_fix:
133 sudo ../common/devstack/net-fix.sh
134 sudo bash -c "source ../setup/admin-openrc.sh; neutron subnet-update private-subnet --dns-nameservers list=true 8.8.8.8 8.8.4.4"
135
136upgrade_pkgs:
137 sudo pip install httpie --upgrade
138
139rebuild_xos:
140 make -C ../../../containers/xos devel
141
142rebuild_synchronizer:
143 make -C ../../../containers/synchronizer
144
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +0000145devstack_ceilometer_custom_images:
146 #Assuming Openstack Mitaka backend. The glance commands require --os-image-api-version 1 to be passed to use v1 version of glance APIs
147 bash -c "source ../setup/admin-openrc.sh; glance --os-image-api-version 1 image-show ceilometer-trusty-server-multi-nic || ! mkdir -p /opt/stack/images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P /opt/stack/images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /opt/stack/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare"
Scott Baker50421662016-06-27 22:09:48 -0700148
149cloudlab_ceilometer_custom_images:
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +0000150 bash -c "source ../setup/admin-openrc.sh; glance image-show --os-image-api-version 1 ceilometer-trusty-server-multi-nic || if test -f /proj/xos-PG0/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ; then glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /proj/xos-PG0/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare ; else mkdir -p /tmp/images && wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P /tmp/images && glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /tmp/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare ; fi "
151