1.0.0 • Published 6 years ago

cujoblaunch v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

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()