Support comprehensive configuration, resource usage, monitoring and development using high level components.
This is the documentatin for setup. Further documentation is at https://wiki.deflect.ca/wiki/Devopsjs . If you'd like to set this system up please contact us so we can make the documenation better.
Components of devopsjs:
- NRPE for system tests
- node.js for scripting components and command line interaction
- Semantic Mediawiki for configuration
- node-logstash for systems data processing
- ElasticsEarch for data storage
- Kibana for visualization
- BDD to define and test systems (in development)
First, set up ElasticSearch. Configuration for a typical Debian server is in the host/ directory. Use the put_mapping script to push the schema.
You will need some additional system libraries, on a Debian distro this may include libgeoip-dev, libpcre3-dev, zlib1g-dev. Also, install MaxMind's GeoLiteCity.dat to /usr/local/geoip. Then:
cd devopsjs
npm install
Edit config/localConfig.js based on this:
var c = {};
/* configure DNets */
c.dnets = ['dnet1.deflect.ca', 'dnet2.deflect.ca'];
c.domain = '.deflect.ca';
c.defaultDNET = 'default';
c.httpCheckURI = 'http://somedefaultURLonhosts';
/* configuration for notifier */
c.notify = {emailSubject : 'devopsjs notifications',
emailFrom : 'someone@somewhere'
}
var nodemailer = require("nodemailer");
var transport = nodemailer.createTransport("Sendmail", "/usr/sbin/sendmail");
transport.sendNotification = function(msg, callback) {
this.sendMail(msg, callback);
}
c.notify.notifyTransport = transport;
/* configuration for wiki */
c.wikiConfig = {
server: 'your.configwiki',
protocol: 'https',
path: '/mediawiki',
username: 'Wiki bot',
password: 'wiki password',
debug: false
}
/* configuration for elasticsearch */
c.elasticSearchConfig = {
_index : 'devopsjs',
server : {
host : 'your.elasticsearchinstance',
port : 9200
}
}
GLOBAL.CONFIG = c;
DNets can be added to the config directory as dnetname.js, eg,
var c = GLOBAL.CONFIG;
c.flatHostsFile = '/usr/local/deflect/etc/edges/edges.dnet1.live';
c.allFlatHostsFile = '/usr/local/deflect/etc/edges/edges.dnet1';
c.minActive = 6;
c.subdomain = 'deflect.ca';
c.rotationTimeMinutes = 60;
GLOBAL.CONFIG = c;
- Set up the general Deflect system - https://wiki.deflect.ca/wiki/Deflect_DIY
- Configure src/node/nrpeCheck.js to run frequently
- Configure src/node/edgemanage.js -r to auto-rotate as required
- Configure src/node/watchnotify.js to run regularly
- Use edgemanage on its own for edge management operations
[idi] https://github.com/equalitie/idiomatic.js 'idiomatic.js'
development follows two tracks:
-
unit testing the tests grunt watch:devUnit
This will run unit tests against the test helper classes -
running the bdd tests
src/node/yadda-tests/lib/bdd-test-runner.js
Following Flags available:
- -S or --site [sitename] site to run the tests against
- -f write the results to a file src/node/yadda-tests/results.js
- -O or --outfile [filename] write results in json format to specefied [filename]
Default runner is the spec runner which should provide helpful error messages where failures occur
- Sanity Tests To run the unit and config tests
grunt sanity-test
Annotated Source will be generated by grunt in a folder called docs/annotated-source config in Gruntfile.js
Code is linted using jslint, following the style guide set out above should keep you within those restrictions
plato is used to create a report on code quality metrics, this will again be triggered with grunt. Results will be available in reports folder
Under development itself.
- Initial wiki definition
- Refine with stakeholders
- Create BDD feature and scenarios on wiki
- Refine with stakeholders
- Generate cucumber stubs from test cases server nodejs code downloads features & scenarios based on query, generates stubs
- Tests 'pending' on wiki change or manual trigger, server nodejs runs tests and posts to solr, client js queries solr and displays results
- Implement test cases on server
- Tests 'fail'
- Implement code on server
- Tests 'pass'
- Validate with stakeholders
- Function and interface testing
- Refine definitions
- Operationalize
- add ''Every'' keyword to scenarios per ''Every'' definition, server nodejs runs tests and posts to solr
- can view current and historical test results
Developed for the Equalit.ie Deflect project and Concordia CSFG.