commit | a7ae651ac44fbceddae2ad8cf182081547d112ce | [log] [tgz] |
---|---|---|
author | Srikanth Vavilapalli <srikanth.vavilapalli@ericsson.com> | Mon Feb 13 02:29:21 2017 +0000 |
committer | Srikanth Vavilapalli <srikanth.vavilapalli@ericsson.com> | Tue Mar 07 01:00:44 2017 +0000 |
tree | 2fc77ce2cb84b977f58f0bfe0cee15828f7c63ac | |
parent | 904e87f318bcacdce279b22bd6680044f20fff6a [diff] |
CORD-871: Migrate monitoring service to new CORD build infrastructure - phase1 Usage of Monitoring Service build commands in new build system: ---------------------------------------------- Add the below alias to your bashrc file and source it. CiaB platform-install brings up monitoring-service synchronizer by default. Once the synchronizer is completely operational, run 'cord-monitoringservice' on your terminal. alias deploy-monitoringservice="pushd /opt/cord/build/platform-install; ansible-playbook -i inventory/rcord --extra-vars @../genconfig/config.yml onboard-monitoringservice-playbook.yml" alias instantiate-monitoringservice="pushd /opt/cord/build/platform-install; ansible-playbook -i inventory/rcord --extra-vars @../genconfig/config.yml instantiate-monitoringservice-playbook.yml" alias generate-install-infra-agents-config=“ansible-playbook -i /etc/maas/ansible/pod-inventory --extra-vars=@/opt/cord/build/genconfig/config.yml monitoringagent-infra-install-config.yml" alias install-infra-agents=“ansible-playbook -i /opt/cord_profile/monitoringagent_install.hosts monitoringagent-infra-install.yml" alias generate-enable-infra-monitoring-config=“ansible-playbook -i /etc/maas/ansible/pod-inventory --extra-vars=@/opt/cord/build/genconfig/config.yml monitoringservice-enable-inframonitoring-config.yml" alias enable-infra-monitoring=“ansible-playbook -i inventory/rcord --extra-vars @../genconfig/config.yml monitoringservice-enable-inframonitoring.yml" alias test-monitoringservice-initial=“ansible-playbook -i inventory/rcord --extra-vars @../genconfig/config.yml monitoringservice-test-initial.yaml" alias test-monitoringservice-inframetrics=“ansible-playbook -i inventory/rcord --extra-vars @../genconfig/config.yml monitoringservice-test-inframetrics.yaml" alias test-monitoringservice-vsgmetrics=“ansible-playbook -i inventory/rcord --extra-vars @../genconfig/config.yml monitoringservice-test-vsgmetrics.yaml" alias test-monitoringservice-exampleservicemetrics=“ansible-playbook -i inventory/rcord --extra-vars @../genconfig/config.yml monitoringservice-test-exampleservicemetrics.yaml" alias cord-monitoringservice="echo \"*******NOTE:Ensure monitoring service synchronizer is completely up and running********\"; instantiate-monitoringservice; test-monitoringservice-initial" alias install-inframonitoring-agent="generate-install-infra-agents-config; install-infra-agents" alias enable-inframonitoring="generate-enable-infra-monitoring-config; enable-infra-monitoring; test-monitoringservice-inframetrics" Change-Id: I9895dd1107de50e9817325f750f0608d9eb72be5
This repository contains Ansible playbooks for installing and configuring software components that build a CORD POD: OpenStack, ONOS, and XOS.
It is used as a sub-module of the main CORD repository, but can independently bring up various CORD profiles for development work.
If you want to set up an entire CORD pod on physical hardware, or set up the Cord-in-a-Box deployment, you should start at the CORD repository.
There's a helper script, scripts/cord-bootstrap.sh. that will install development environment prerequisites on a Ubuntu 14.04 node. You can download it with:
curl -o ~/cord-bootstrap.sh https://raw.githubusercontent.com/opencord/platform-install/master/scripts/cord-bootstrap.sh
Running the script will install the repo tool, Ansible, and Docker, as well as make a checkout of the CORD manifest into ~/cord
.
You can specify which gerrit changesets you would like repo to checkout using the -b
option on the script as documented here.
Once you have done this, if you're not already in the docker
group, you should logout and log back into your system to refresh your user account's group membership. If you don't do this, any docker command you run or ansible runs for you will fail. You can check your group membership by running groups
.
Once you log back in, you may want to run tmux
to maintain a server-side session you can reconnect to, in case of network trouble.
All of the commands below assume you're in the cord/build/platform-install
directory.
If you are doing work that does not involve openstack
you can create a development environment inside a VM on your local machine. This environment is mostly designed to do GUI
, APIs
and modeling
related work. It can also be useful to test a synchronizer
whose job is synchronizing data using REST APIs.
To do that we provided a Vagrant
VM. From this folder just execute vagrant up head-node
. We'll create an Ubuntu based VM with all the cord
code shared from your local machine, so that you can make your changes locally and quickly test the outcome.
Once the vm
is created you can connect to it with vagrant ssh head-node
and then from the ~/cord/build/platform-install
execute the profile you are interested in. For instance you can spin up the frontend
configuration with: ansible-playbook -i inventory/frontend deploy-xos-playbook.yml
.
Note that the cord-bootstrap.sh
script is automatically invoked by the provisioning script and the vagrant
vm requires VirtualBox
Credentials will be autogenerated and placed in the credentials/
directory when the playbooks are run, where the credential name is the filename, and the contents of the file is the password.
For most profiles the XOS admin user is named xosadmin@opencord.org
.
Most profiles are run by specifying an inventory file when running ansible-playbook
. For most frontend or mock profiles, you'll want to run the deploy-xos-playbook.yml
playbook.
For example, to run the frontend
config, you would run:
ansible-playbook -i inventory/frontend deploy-xos-playbook.yml
Assuming it runs without error, you can then explore the environment you've set up. When you're ready to tear down your environment, run:
ansible-playbook -i inventory/frontend teardown-playbook.yml
This will destroy all the docker containers created, and delete the ~/cord_profile
directory. Note that you must run the teardown-playbook.yml
using the same inventory file it was created with, otherwise rogue docker containers may still be running after the teardown.
You can then make chnages to code and re-run the same or a different profile.
To create a new CORD profile, you should:
inventory/
that defines the cord_profile
variable, with the name of your profile.[all:vars] cord_profile=my-profile
Create a .yaml variables file in profile_manifests/
with the name of your profile (ex: my-profile.yaml
), and populate it with your configuration.
To test the profile, run the deploy-xos-playbook.yml
playbook using your inventory profile: ansible-playbook -i inventory/my-profile deploy-xos-playbook.yml
Before commit, please run ./scripts/lintcheck.sh .
in the repo root, which will perform the same ansible-lint check that Jenkins performs when in review in gerrit.
This profile runs API tests for both the REST and TOSCA APIs. This can be done in an automated fashion:
ansible-playbook -i inventory/api-test api-test-playbook.yml
The XOS credentials in this config are padmin@vicci.org
and letmein
(until the tests are modified to support generated credentials).
Builds a basic XOS frontend installation, useful for UI testing and experimentation.
Builds a Mock R-CORD or Mock M-CORD pod, without running service synchronizers in a manner similar to frontend.
Used as a part of the OpenCloud deployment. Similar to rcord
.
This is a part of the R-CORD deployment - start using the steps specified in that repo.
This profile is designed to integrate XOS with physical infrastructure pieces like MaaS, OpenStack, and ONOS. See the CORD-in-a-Box Quick Start Guide for how to set up a virtual multi-node R-CORD pod on a single host.
If you've already built a CiaB and want to go through the dev loop described above on the head/production node, when running ansible-playbook
you must pass the path to the configuration file that was generated by Gradle during the build:
ansible-playbook -i inventory/head-localhost --extra-vars @../genconfig/config.yml playbook.yml
You may find the following shell aliases to be helpful during development:
alias xos-teardown="pushd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml teardown-playbook.yml" alias xos-deploy="pushd /opt/cord/build/platform-install; ansible-playbook -i inventory/head-localhost --extra-vars @/opt/cord/build/genconfig/config.yml deploy-xos-playbook.yml" alias compute-node-refresh="pushd /opt/cord/build/platform-install; ansible-playbook -i /etc/maas/ansible/pod-inventory --extra-vars=@/opt/cord/build/genconfig/config.yml compute-node-refresh-playbook.yml" alias xos-cleanup-images="docker rmi xosproject/xos-ui xosproject/xos"