OnBots Installation Guide
Want to know about OneDevOps OnBot Components?
Learn about components to setup local development environment here.
OnBots Components and Architecture
Basic Components of the OnBots Framework:
Kubernetes Environment-Creates base environment required to execute and maintain Bots. Kubernetes spawn docker image with base Ubuntu 16.04 with additional software's like NodeJS,CoffeeScript,npm e.tc.
Elastic Search-Holds logs,metrics related information
MongoDB - Used to maintain Approval flow. Generates and Maintain Ticket related information.
MiddleWare Application - Act as a interceptor to read admin response and manages communication between various
Bots.
This section will help you to setup Environment for OnBot. Browse various categories provided below:
ElasticSearch Setup
Run the below commands to install Java 8 in your Ubuntu machine:
1) sudo apt-get update
2) sudo apt-get install openjdk-8-jre
The binary packages of Elasticsearch have only one dependency: Java. The minimum supported version is Java 8
Now run the below commands to download and install elasticsearch (steps shown for elasticsearch version-5.4.1):
1) curl -L -O{*}https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.1.deb*
2) sudo dpkg -i elasticsearch-5.4.1.deb
Go inside /etc/elasticsearch folder and open elasticsearch.yml file. Next, edit the following lines in it:
path.data: /home/487398/elasticsearch-5.4.1/data path.logs: /home/487398/elasticsearch-5.4.1/logs network.host: 0.0.0.0
http.port: 9200
data will specify storage location for elasticsearch indices logs will specify storage location of elasticsearch logs
host should be set to 0.0.0.0 for remotely connecting with the installed elasticsearch port will specify on which port elasticsearch is running
Start the elasticsearch by giving the following:
1) sudo /etc/init.d/elasticsearch start
Verify whether elasticsearch is running by the following command:
curl {*}http://localhost:9200*
You should get the following JSON body as response:
{
"name" : "_mykWLH",
"cluster_name" : "elasticsearch", "cluster_uuid" : "vwEaY6m1TJ6HpKuduu9MGQ", "version" : {
"number" : "5.4.1", "build_hash" : "2cfe0df",
"build_date" : "2017-05-29T16:05:51.443Z", "build_snapshot" : false,
"lucene_version" : "6.5.1"
},
"tagline" : "You Know, for Search"
}Bots Framework Setup
Install npm and nodejs by executing the following commands:
1. apt-get install npm
2. apt-get install nodejs
Clone webapplication from github
1. git clone of chatops respository (git clone –b <branchname> <cloning link>)
2. Copy $HOME/admin.conf file generated by installing kuberentes inside Bots folder of webapp
3. Update Configurations in Bots\app\config\config.json
Configuration settings
Map your configuration in config.json file from app/config directory: ElasticSearch : elasticsearch url
Kubernetes_End_Ppoint : Kubernetes url
MongoDB : mongodb Host
MONITOR_INTERVAL : Time Interval for monitoring bot
MONITOR_RETENSION : mapped to 1 (stores a jsonobj in elasticsearch which has all hubot metrics of a current second)
MONGO_DB_URL : mongodb database name for approval process of bot actions
MONGO_COLL : mongodb collection name for approval process of bot actions
MONGO_COUNTER : mongodb collection name for storing the number of next ticket to be generated
MONGO_TICKETIDGEN : stores the Id of the collection referred by MONGO_COUNTER
Run Application
1. Install npm modules by running the following from Bots folder
npm install
2. Run application
nodejs app
This will run application in specified port
Middleware Application SetUp
1. Clone slack-app from repository
2. Run npm install inside slackapp folder from the cloned directory
3. Run the application with the command nodejs app. (Application will run in 3000 port)
The application has to be reachable from internet. Slack will post data to this application for approval flow
Add Comment