Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 1 | include ../common/Makedefs |
| 2 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 3 | MYIP:=$(shell hostname -i) |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 4 | CONFIG_DIR:=$(shell pwd) |
| 5 | DOCKER_COMPOSE_YML=./onboarding-docker-compose/docker-compose.yml |
| 6 | BOOTSTRAP_YML=./docker-compose-bootstrap.yml |
| 7 | DOCKER_PROJECT=acord |
| 8 | BOOTSTRAP_PROJECT=acordbs |
| 9 | XOS_BOOTSTRAP_PORT=9998 |
| 10 | XOS_UI_PORT=9999 |
| 11 | ADMIN_USERNAME=padmin@vicci.org |
| 12 | ADMIN_PASSWORD=letmein |
| 13 | RUN_TOSCA_BOOTSTRAP=python ../common/run_tosca.py $(XOS_BOOTSTRAP_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD) |
| 14 | RUN_TOSCA=python ../common/run_tosca.py $(XOS_UI_PORT) $(ADMIN_USERNAME) $(ADMIN_PASSWORD) |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 15 | |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 16 | cloudlab: download_xos common_cloudlab local_containers xos |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 17 | |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 18 | devstack: download_xos upgrade_pkgs common_devstack local_containers xos devstack_net_fix |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 19 | |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 20 | xos: dirs download_services bootstrap onboarding develconfig |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 21 | |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 22 | dirs: |
| 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 | |
| 27 | download_xos: |
| 28 | make -f ../common/Makefile.services xos_core |
| 29 | |
| 30 | download_services: |
| 31 | make -f ../common/Makefile.services |
| 32 | |
| 33 | bootstrap: |
| 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 | |
| 42 | onboarding: |
| 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 | |
| 48 | develconfig: |
| 49 | $(RUN_TOSCA) ../common/cloudlab-openstack.yaml |
| 50 | $(RUN_TOSCA) ../setup/nodes.yaml |
| 51 | |
| 52 | cord-monitoringservice: devstack_ceilometer_custom_images onboard-monitoringservice ceilometer_devstack_cord_plugins |
| 53 | $(RUN_TOSCA) ceilometer.yaml |
| 54 | |
| 55 | onboard-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 | |
| 63 | download-monitoringservice: |
| 64 | make -f ../common/Makefile.services monitoring_services |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 65 | |
| 66 | exampleservice: |
| 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 | |
| 70 | containers: |
| 71 | cd ../../../containers/xos; make devel |
| 72 | cd ../../../containers/synchronizer; make |
| 73 | |
| 74 | common_cloudlab: |
| 75 | make -C ../common -f Makefile.cloudlab |
| 76 | |
| 77 | common_devstack: |
| 78 | make -C ../common -f Makefile.devstack |
| 79 | |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 80 | local_containers: |
| 81 | make -f ../common/Makefile.containers update_certs xos_base xos_devel synchronizer onboarding_synchronizer |
| 82 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 83 | ceilometer_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 | |
| 96 | ceilometer_devstack_cord_plugins: |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 97 | #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 Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 103 | |
| 104 | ceilometer_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 | |
| 111 | stop: |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 112 | 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 Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 114 | |
| 115 | rm: stop |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 116 | 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 Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 118 | |
| 119 | showlogs: |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 120 | sudo docker-compose -p $(DOCKER_PROJECT) -f $(DOCKER_COMPOSE_YML) logs |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 121 | |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 122 | showlogs_bootstrap: |
| 123 | sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) logs |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 124 | |
| 125 | cleanup: stop rm |
| 126 | ./cleanup.sh |
| 127 | bash -c "source ../setup/admin-openrc.sh; nova list --all-tenants; neutron net-list" |
| 128 | |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 129 | ps: |
| 130 | sudo MYIP=$(MYIP) docker-compose ps |
| 131 | |
Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 132 | devstack_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 | |
| 136 | upgrade_pkgs: |
| 137 | sudo pip install httpie --upgrade |
| 138 | |
| 139 | rebuild_xos: |
| 140 | make -C ../../../containers/xos devel |
| 141 | |
| 142 | rebuild_synchronizer: |
| 143 | make -C ../../../containers/synchronizer |
| 144 | |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 145 | devstack_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 Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 148 | |
| 149 | cloudlab_ceilometer_custom_images: |
Srikanth Vavilapalli | f95cd5b | 2016-07-10 19:08:04 +0000 | [diff] [blame] | 150 | 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 | |