blob: 51dfbb0b53727e4f6d979e527d6bbd6f657a0272 [file] [log] [blame]
Zack Williams3670f442016-10-04 17:37:12 -07001# acord/Makefile
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +00002
Zack Williams3670f442016-10-04 17:37:12 -07003CONFIG_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
4COMMON_DIR := $(abspath ../common )
5
6.DEFAULT_GOAL := xos
7
8DOCKER_PROJECT ?= acord
9BOOTSTRAP_PROJECT ?= acordbs
10
11DB_NAME ?= $(BOOTSTRAP_PROJECT)_xos_db_1
12
13XOS_BOOTSTRAP_PORT ?= 9998
14XOS_UI_PORT ?= 9999
15
16# Include common functions
17include $(COMMON_DIR)/Makefile
Scott Baker50421662016-06-27 22:09:48 -070018
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000019cloudlab: download_xos common_cloudlab local_containers xos
Scott Baker50421662016-06-27 22:09:48 -070020
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000021devstack: download_xos upgrade_pkgs common_devstack local_containers xos devstack_net_fix
Scott Baker50421662016-06-27 22:09:48 -070022
Zack Williams3670f442016-10-04 17:37:12 -070023xos: prereqs config_dirs xos_download cord_services bootstrap onboarding develconfig
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000024
25onboarding:
26 echo "[ONBOARDING]"
27 # on-board any services here
Zack Williams3670f442016-10-04 17:37:12 -070028 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
29 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000030
31develconfig:
Zack Williams3670f442016-10-04 17:37:12 -070032 $(RUN_TOSCA) $(COMMON_DIR)/tosca/cloudlab-openstack.yaml
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000033 $(RUN_TOSCA) ../setup/nodes.yaml
34
35cord-monitoringservice: devstack_ceilometer_custom_images onboard-monitoringservice ceilometer_devstack_cord_plugins
36 $(RUN_TOSCA) ceilometer.yaml
37
Zack Williams3670f442016-10-04 17:37:12 -070038onboard-monitoringservice: $(SERVICE_DIR)/monitoring
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000039 sudo cp ~/.ssh/id_rsa key_import/monitoringservice_rsa
40 sudo cp ~/.ssh/id_rsa.pub key_import/monitoringservice_rsa.pub
41 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -070042 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
43 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
44 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Scott Baker50421662016-06-27 22:09:48 -070045
46exampleservice:
47 #Ensure exampleservice is enabled in xos/tools/xos-manage and xos/settings.py file before uncommenting below lines
48 #sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/acord/acord-exampleservice.yaml
49
Scott Baker50421662016-06-27 22:09:48 -070050common_cloudlab:
Zack Williams3670f442016-10-04 17:37:12 -070051 make -C $(COMMON_DIR) -f Makefile.cloudlab
Scott Baker50421662016-06-27 22:09:48 -070052
53common_devstack:
Zack Williams3670f442016-10-04 17:37:12 -070054 make -C $(COMMON_DIR) -f Makefile.devstack
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000055
Scott Baker50421662016-06-27 22:09:48 -070056ceilometer_cloudlab_cord_plugins:
57 if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
58 git clone https://github.com/srikanthvavila/ceilometer-plugins.git
59 sudo cp -r ceilometer-plugins/network/ext_services /usr/lib/python2.7/dist-packages/ceilometer/network/
60 sudo cp -r ceilometer-plugins/network/statistics/onos /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
Zack Williams3670f442016-10-04 17:37:12 -070061 sudo cp ceilometer-plugins/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
Scott Baker50421662016-06-27 22:09:48 -070062 sudo cp ceilometer-plugins/entry_points.txt /usr/lib/python2.7/dist-packages/ceilometer-*egg-info/
63 sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
64 echo "Restarting ceilometer-agent-notification"
65 sudo service ceilometer-agent-notification restart
66 echo "Restarting ceilometer-agent-central"
67 sudo service ceilometer-agent-central restart
68
69ceilometer_devstack_cord_plugins:
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000070 #if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
71 #git clone https://github.com/srikanthvavila/ceilometer-plugins.git
72 #sudo cp -r ceilometer-plugins/network/ext_services /opt/stack/ceilometer/ceilometer/network/
73 #sudo cp ceilometer-plugins/entry_points.txt /opt/stack/ceilometer/ceilometer*egg-info/
74 #sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
75 #echo "Remember to restart ceilometer-anotification ceilometer-acentral screens"
Scott Baker50421662016-06-27 22:09:48 -070076
77ceilometer_pub_sub:
78 if [ -d ./pub-sub ]; then rm -fr ./pub-sub; fi
79 git clone https://github.com/srikanthvavila/pub-sub.git
80 echo "Starting Ceilometer PUB/SUB service...Ensure zookeeper and kafka services are launched (if required)"
Zack Williams3670f442016-10-04 17:37:12 -070081 cd pub-sub/ceilometer_pub_sub/ ; python sub_main.py &
Scott Baker50421662016-06-27 22:09:48 -070082 cd ../..
83
Scott Baker50421662016-06-27 22:09:48 -070084devstack_net_fix:
Zack Williams3670f442016-10-04 17:37:12 -070085 sudo $(COMMON_DIR)/devstack/net-fix.sh
Scott Baker50421662016-06-27 22:09:48 -070086 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"
87
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000088devstack_ceilometer_custom_images:
89 #Assuming Openstack Mitaka backend. The glance commands require --os-image-api-version 1 to be passed to use v1 version of glance APIs
90 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 -070091
92cloudlab_ceilometer_custom_images:
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000093 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 "
94