Giter VIP home page Giter VIP logo

devopsjs's Introduction

devopsjs

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)

Install

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;

Operations

  1. Set up the general Deflect system - https://wiki.deflect.ca/wiki/Deflect_DIY
  2. Configure src/node/nrpeCheck.js to run frequently
  3. Configure src/node/edgemanage.js -r to auto-rotate as required
  4. Configure src/node/watchnotify.js to run regularly
  5. Use edgemanage on its own for edge management operations

Style Guide

[idi] https://github.com/equalitie/idiomatic.js 'idiomatic.js'

General development workflow

development follows two tracks:

  1. unit testing the tests grunt watch:devUnit
    This will run unit tests against the test helper classes

  2. running the bdd tests

src/node/yadda-tests/lib/bdd-test-runner.js 

Following Flags available:

  1. -S or --site [sitename] site to run the tests against
  2. -f write the results to a file src/node/yadda-tests/results.js
  3. -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

  1. Sanity Tests To run the unit and config tests
grunt sanity-test

Documentation

Annotated Source will be generated by grunt in a folder called docs/annotated-source config in Gruntfile.js

Linting

Code is linted using jslint, following the style guide set out above should keep you within those restrictions

Code Quality

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.

  1. Initial wiki definition
  2. Refine with stakeholders
  3. Create BDD feature and scenarios on wiki
  4. Refine with stakeholders
  5. Generate cucumber stubs from test cases server nodejs code downloads features & scenarios based on query, generates stubs
  6. Tests 'pending' on wiki change or manual trigger, server nodejs runs tests and posts to solr, client js queries solr and displays results
  7. Implement test cases on server
  8. Tests 'fail'
  9. Implement code on server
  10. Tests 'pass'
  11. Validate with stakeholders
  12. Function and interface testing
  13. Refine definitions
  14. Operationalize
  15. add ''Every'' keyword to scenarios per ''Every'' definition, server nodejs runs tests and posts to solr
  16. can view current and historical test results

Credits

Developed for the Equalit.ie Deflect project and Concordia CSFG.

devopsjs's People

Contributors

vid avatar willdoran avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.