Duke-GCB/bespin-job-watcher

Name: bespin-job-watcher

Owner: Duke Center for Genomic and Computational Biology

Description: Allows users to receive job status notification updates for bespin-api

Created: 2017-02-03 21:13:17.0

Updated: 2017-02-03 21:13:24.0

Pushed: 2017-04-18 16:01:42.0

Homepage: null

Size: 57

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

bespin-job-watcher

Allows users to receive job status notification updates for bespin-api. Server subscribes to a rabbitmq exchange named 'job_status' and sends job status notifications to Websockets that have presented valid credentials for those jobs.

Requirements:
Setup:
Install node modules
install
Update Config

Edit config.json changing it as necessary for RabbitMQ and bespin-api.

As long as both are running locally the default values in config.json should be fine.

Run
 index.js
Demo Webpage

Browse to demo webpage: http://localhost:8080/

Browse to your rabbitmq web portal (If locally running rabbit http://127.0.0.1:15672).

Usage

Users should connect a websocket and send an add message passing the jobId and their bespin-api authToken. The websocket will receive the messages of status “ok” or “error”.

Example good message:


tatus":"ok",
ata":{
"job":"16",
"state":"R",
"step":"V"


Example error message:


tatus":"error",
ata":{
"message":"Checking authorization failed with status:404:null"


See static/index.html for sample Javascript.

Run with https
Create certificates
r sslcert
slcert && openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes && cd ..

You can just hit enter for all the openssl prompts.

Update config.json

You must specify the locations of the key and cert at listenOn.key and listenOn.cert:


istenOn": {
 "key": "sslcert/key.pem",
 "cert": "sslcert/cert.pem",

Update static/index.html

You will need to change the sample test program to use the wss protocol instead of ws.

ipt>
..
ar ws = new WebSocket('wss://' + host + ':8080');
..
Run as you normally would
 index.js
Running in docker

A docker container is automatically built for this repo at quay.io/repository/dukegcb/bespin-job-watcher. It can be run from the command line like so:

er run quay.io/dukegcb/bespin-job-watcher 

You can override the configuration by creating a file externally and overriding /usr/src/app/config.json inside the container.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.