particle-iot/dray-client

Name: dray-client

Owner: Particle

Description: Node.js wrapper for managing Dray jobs

Created: 2016-06-24 10:52:16.0

Updated: 2017-05-04 17:21:33.0

Pushed: 2018-01-03 18:24:36.0

Homepage: https://spark.github.io/dray-client/

Size: 1282

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Coverage Status

Usage

Before creating jobs, you need to initialize the job manager:

rt { DrayManager } from 'dray-client';

manager = new DrayManager(
'http://0.0.0.0:3000',   // Dray URL
'redis://127.0.0.1:6379' // Redis URL

Fire and forget
job = manager.createJob();

addStep('foo/bar') // Container to be run
submit(); // Fire and forget!
Wait for result
job = manager.createJob();
setInput('foo') // Data passed to container
addStep('centurylink/upper'); // Container to be run
ire and wait for promise
submit().then((value) => {
console.log("Result:", value);
reason) => {
console.error("Something bad happened:", reason)

Start compilation job
rt { BuildpackJob } from 'dray-client';
compilation = new BuildpackJob(manager);
ilation.addFiles([
{name: 'foo.ino', data: new Buffer()}

ilation.setEnvironment({
PLATFORM_ID: 6

ilation.setBuildpacks([
'particle/buildpack-wiring-preprocessor',
'particle/buildpack-particle-firmware:0.5.1-photon'

ilation.submit().then((binaries) => {
// Do something with binaries
reason) => {
console.error("Compilation error:", reason)

API Reference
Development
Releasing
  1. Prebuid dist directory using npm build
  2. Bump version with npm version <major|minor|patch>
  3. Push the repo
  4. Publish on npm: npm publish

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.