use of edu.iu.dsc.tws.api.resource.IWorker in project twister2 by DSC-SPIDAL.
the class MPIWorkerStarter method startWorker.
/**
* start the Worker class specified in conf files
*/
public static boolean startWorker(IWorkerController workerController, IPersistentVolume pv, String podName) {
IWorker worker = JobUtils.initializeIWorker(job);
K8sVolatileVolume volatileVolume = null;
if (computeResource.getDiskGigaBytes() > 0) {
volatileVolume = new K8sVolatileVolume(jobID, workerID);
}
MPIWorkerManager mpiWorkerManager = new MPIWorkerManager();
return mpiWorkerManager.execute(config, job, workerController, pv, volatileVolume, worker);
}
use of edu.iu.dsc.tws.api.resource.IWorker in project twister2 by DSC-SPIDAL.
the class NomadWorkerStarter method startWorker.
private void startWorker() {
LOG.log(Level.INFO, "A worker process is starting...");
// lets create the resource plan
this.workerController = createWorkerController();
JobMasterAPI.WorkerInfo workerNetworkInfo = workerController.getWorkerInfo();
try {
LOG.log(Level.INFO, "Worker IP..:" + Inet4Address.getLocalHost().getHostAddress());
} catch (UnknownHostException e) {
e.printStackTrace();
}
try {
List<JobMasterAPI.WorkerInfo> workerInfos = workerController.getAllWorkers();
} catch (TimeoutException timeoutException) {
LOG.log(Level.SEVERE, timeoutException.getMessage(), timeoutException);
return;
}
IWorker worker = JobUtils.initializeIWorker(job);
MPIWorkerManager workerManager = new MPIWorkerManager();
workerManager.execute(config, job, workerController, null, null, worker);
}
use of edu.iu.dsc.tws.api.resource.IWorker in project twister2 by DSC-SPIDAL.
the class MesosDockerWorker method startWorker.
public static void startWorker(IWorkerController workerController, IPersistentVolume pv) {
JobAPI.Job job = JobUtils.readJobFile("twister2-job/" + jobID + ".job");
MesosVolatileVolume volatileVolume = null;
// TODO method SchedulerContext.volatileDiskRequested deleted
// volatileVolume needs to be checked from job object
// if (SchedulerContext.volatileDiskRequested(config)) {
// volatileVolume =
// new MesosVolatileVolume(SchedulerContext.jobID(config), workerID);
// }
// lets create the resource plan
// Map<Integer, String> processNames = MPIWorker.createResourcePlan(config);
// now create the resource plan
// AllocatedResources resourcePlan = MPIWorker.addContainers(config, processNames);
// AllocatedResources resourcePlan = MesosWorkerUtils.createAllocatedResources("mesos",
// workerID, job);
// resourcePlan = new AllocatedResources(SchedulerContext.clusterType(config), workerID);
IWorker worker = JobUtils.initializeIWorker(job);
worker.execute(config, job, jobMasterAgent.getJMWorkerController(), pv, volatileVolume);
}
use of edu.iu.dsc.tws.api.resource.IWorker in project twister2 by DSC-SPIDAL.
the class AuroraWorkerStarter method main.
public static void main(String[] args) {
// create the worker
AuroraWorkerStarter workerStarter = createAuroraWorker();
// get the number of workers from some where
// wait for all of them
// print their list and exit
workerStarter.waitAndGetAllWorkers();
String workerClass = SchedulerContext.workerClass(workerStarter.config);
IWorker worker;
try {
Object object = ReflectionUtils.newInstance(workerClass);
worker = (IWorker) object;
LOG.info("loaded worker class: " + workerClass);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
LOG.log(Level.SEVERE, String.format("failed to load the worker class %s", workerClass), e);
throw new RuntimeException(e);
}
// TODO: need to provide all parameters
worker.execute(workerStarter.config, workerStarter.job, null, null, null);
// close the things, let others know that it is done
workerStarter.close();
}
use of edu.iu.dsc.tws.api.resource.IWorker in project twister2 by DSC-SPIDAL.
the class K8sWorkerStarter method startWorker.
/**
* start the Worker class specified in conf files
*/
public static boolean startWorker(IWorkerController workerController, IPersistentVolume pv) {
IWorker worker = JobUtils.initializeIWorker(job);
K8sVolatileVolume volatileVolume = null;
if (computeResource.getDiskGigaBytes() > 0) {
volatileVolume = new K8sVolatileVolume(jobID, workerID);
}
WorkerManager workerManager = new WorkerManager(config, job, workerController, pv, volatileVolume, worker);
return workerManager.execute();
}
Aggregations