Name: im-runnable
Owner: InterMine
Description: Learn you some InterMine Web Services for good
Created: 2014-08-17 01:02:16.0
Updated: 2014-07-29 19:32:36.0
Pushed: 2014-02-28 12:29:20.0
Size: 1116
Language: null
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Learn you some InterMine Web Services for good.
Install Docker and test all is well:
cker run ubuntu /bin/echo hello world
Create an intermine
image based on a Dockerfile
:
cker build -t intermine server/
Install service dependencies:
m install
Start the service:
do PORT=5000 node index.js
While your container is still running, get its id and save it as an image:
cker commit <id> intermine
cker images
Now we have an image saved under intermine
. You can now exit from the container.
You can also edit the Dockerfile
in server/
and rerun the abovementioned command to update the image.
The following command in server/run.sh
is being run for each new job:
ho "$1" | sudo docker run -i intermine /bin/bash -c "$2"
The first argument is a script source, the second is one command out of server/config.coffee
e.g.:
t > script.js; node script.js
m install pm2 -g
RT=80 pm2 start index.js
You can post some code to get a job id back:
sr/bin/env coffee
ify = require 'restify'
nt = restify.createJsonClient
'url': 'http://0.0.0.0:5000'
nt.post '/api/v1/jobs.json',
'lang': 'javascript'
'src': 'console.log(3*6)'
rr, req, res, body) ->
throw err if err
message
when handling errors./owners/123/dogs
.responseCode
.200
in the header but not in the body; use ?suppress_response_codes=true
..json
, but default to JSON.?fields=name,color
.?limit=10&offset=0
. Metadata related to total count, limit & offset should be returned under metadata
key in response.?q=wulfie
to the resource or /search?q=wulfie
for a global one.toJSON()
so we can nicely debug in the browser.created_at
.data
key.