npm.io
1.0.0 • Published 8 years ago

cujoblaunch

Licence
ISC
Version
1.0.0
Deps
4
Size
9 kB
Vulns
3
Weekly
0

cuJobLaunch - quick start guide

Launch your first compute job on cuToken cloud

var cjl = require("cuJobLaunch");

// set healthcheck to re-launch instances as needed
// pathToHealthCheck, subString to find in the response
// How frequently heath check needs to be performed
cjl.setHCConfig("/", "UnBlockify", 60000);

// provide necessary configuration of the compute job
// cutokensPerInstance, instanceTime, instanceImage, minInstancesNeeded, restClientIP(leave empty for local miner), portList, callBackWithNodeUp, callBackWithNodeDown
cjl.setConfig(1, 5*60, 'https://cloud.cutoken.io/curatedTemplates/UnBlockify/1/docker-compose.yml', 1, '', '80'
, function(val){
  console.log("node is up: "  + val["details"][0].resourceName); 
}
, function(val){
  console.log("node is down: "  + val["details"][0].resourceName); 
});

// Start the cluster. This will post compute jobs as needed to
// the cutoken cloud to maintain the cluster size as nodes 
// go up and down
cjl.startMonitoring()

Keywords