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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
install
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.
index.js
Browse to demo webpage: http://localhost:8080/
Start Watching(add)
.
At the bottom of the screen you will see any job messages as a JSON string.Browse to your rabbitmq web portal (If locally running rabbit http://127.0.0.1:15672).
{"job":"123", "state":"R"}
.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.
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.
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",
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');
..
index.js
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.