blob: a83689b6e8e0405a7f7c7549b896e25a36008968 [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
Matteo Scandoloa317b872017-01-10 12:02:41 -080013XOS_BOOTSTRAP_PORT ?= 9001
14XOS_UI_PORT ?= 9000
Zack Williams3670f442016-10-04 17:37:12 -070015
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
Scott Baker62d24282016-10-21 09:19:11 -070023xos: prereqs config_dirs xos_download cord_services cord_libraries 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
Scott Bakerda3b1592016-10-24 10:45:36 -070041 $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000042 $(RUN_TOSCA_BOOTSTRAP) $(SERVICE_DIR)/monitoring/xos/monitoring-onboard.yaml
Scott Bakerda3b1592016-10-24 10:45:36 -070043 $(RUN_TOSCA_BOOTSTRAP) $(LIBRARY_DIR)/ng-xos-lib/ng-xos-lib-onboard.yaml
Zack Williams3670f442016-10-04 17:37:12 -070044 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) services/monitoring
45 bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
46 bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
Scott Baker50421662016-06-27 22:09:48 -070047
48exampleservice:
49 #Ensure exampleservice is enabled in xos/tools/xos-manage and xos/settings.py file before uncommenting below lines
50 #sudo docker-compose run xos python /opt/xos/tosca/run.py padmin@vicci.org /opt/xos/configurations/acord/acord-exampleservice.yaml
51
Scott Baker50421662016-06-27 22:09:48 -070052common_cloudlab:
Zack Williams3670f442016-10-04 17:37:12 -070053 make -C $(COMMON_DIR) -f Makefile.cloudlab
Scott Baker50421662016-06-27 22:09:48 -070054
55common_devstack:
Zack Williams3670f442016-10-04 17:37:12 -070056 make -C $(COMMON_DIR) -f Makefile.devstack
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000057
Scott Baker50421662016-06-27 22:09:48 -070058ceilometer_cloudlab_cord_plugins:
59 if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
60 git clone https://github.com/srikanthvavila/ceilometer-plugins.git
61 sudo cp -r ceilometer-plugins/network/ext_services /usr/lib/python2.7/dist-packages/ceilometer/network/
62 sudo cp -r ceilometer-plugins/network/statistics/onos /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
Zack Williams3670f442016-10-04 17:37:12 -070063 sudo cp ceilometer-plugins/network/statistics/__init__.py /usr/lib/python2.7/dist-packages/ceilometer/network/statistics/
Scott Baker50421662016-06-27 22:09:48 -070064 sudo cp ceilometer-plugins/entry_points.txt /usr/lib/python2.7/dist-packages/ceilometer-*egg-info/
65 sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
66 echo "Restarting ceilometer-agent-notification"
67 sudo service ceilometer-agent-notification restart
68 echo "Restarting ceilometer-agent-central"
69 sudo service ceilometer-agent-central restart
70
71ceilometer_devstack_cord_plugins:
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000072 #if [ -d ./ceilometer-plugins ]; then rm -fr ./ceilometer-plugins; fi
73 #git clone https://github.com/srikanthvavila/ceilometer-plugins.git
74 #sudo cp -r ceilometer-plugins/network/ext_services /opt/stack/ceilometer/ceilometer/network/
75 #sudo cp ceilometer-plugins/entry_points.txt /opt/stack/ceilometer/ceilometer*egg-info/
76 #sudo cp ceilometer-plugins/pipeline.yaml /etc/ceilometer/
77 #echo "Remember to restart ceilometer-anotification ceilometer-acentral screens"
Scott Baker50421662016-06-27 22:09:48 -070078
79ceilometer_pub_sub:
80 if [ -d ./pub-sub ]; then rm -fr ./pub-sub; fi
81 git clone https://github.com/srikanthvavila/pub-sub.git
82 echo "Starting Ceilometer PUB/SUB service...Ensure zookeeper and kafka services are launched (if required)"
Zack Williams3670f442016-10-04 17:37:12 -070083 cd pub-sub/ceilometer_pub_sub/ ; python sub_main.py &
Scott Baker50421662016-06-27 22:09:48 -070084 cd ../..
85
Scott Baker50421662016-06-27 22:09:48 -070086devstack_net_fix:
Zack Williams3670f442016-10-04 17:37:12 -070087 sudo $(COMMON_DIR)/devstack/net-fix.sh
Scott Baker50421662016-06-27 22:09:48 -070088 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"
89
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000090devstack_ceilometer_custom_images:
91 #Assuming Openstack Mitaka backend. The glance commands require --os-image-api-version 1 to be passed to use v1 version of glance APIs
92 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 -070093
94cloudlab_ceilometer_custom_images:
Srikanth Vavilapallif95cd5b2016-07-10 19:08:04 +000095 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 "
96