use of fr.inria.spirals.repairnator.serializer.HardwareInfoSerializer in project repairnator by Spirals-Team.
the class RTLauncher method initAndRunRTScanner.
private void initAndRunRTScanner() {
LOGGER.info("Init RTScanner...");
String runId = this.config.getRunId();
HardwareInfoSerializer hardwareInfoSerializer = new HardwareInfoSerializer(this.engines, runId, "rtScanner");
hardwareInfoSerializer.serialize();
RTScanner rtScanner = new RTScanner(runId, this.engines);
if (this.config.getDuration() != null && this.endProcessNotifier != null) {
rtScanner.setEndProcessNotifier(this.endProcessNotifier);
}
if (this.config.getWhiteList() != null) {
rtScanner.initWhiteListedRepository(this.config.getWhiteList());
}
if (this.config.getBlackList() != null) {
rtScanner.initBlackListedRepository(this.config.getBlackList());
}
LOGGER.info("Start RTScanner...");
rtScanner.launch();
}
use of fr.inria.spirals.repairnator.serializer.HardwareInfoSerializer in project repairnator by Spirals-Team.
the class Launcher method runPool.
private void runPool() throws IOException {
String runId = this.config.getRunId();
HardwareInfoSerializer hardwareInfoSerializer = new HardwareInfoSerializer(this.engines, runId, "dockerPool");
hardwareInfoSerializer.serialize();
EndProcessSerializer endProcessSerializer = new EndProcessSerializer(this.engines, runId);
List<InputBuildId> buildIds = this.readListOfBuildIds();
LOGGER.info("Find " + buildIds.size() + " builds to run.");
endProcessSerializer.setNbBuilds(buildIds.size());
String imageId = this.findDockerImage(this.config.getDockerImageName());
LOGGER.info("Found the following docker image id: " + imageId);
this.setDockerOutputDir(this.config.getLogDirectory());
this.setRunId(runId);
this.setEngines(this.engines);
ExecutorService executorService = Executors.newFixedThreadPool(this.config.getNbThreads());
for (InputBuildId inputBuildId : buildIds) {
executorService.submit(this.submitBuild(imageId, inputBuildId));
}
executorService.shutdown();
try {
if (executorService.awaitTermination(this.config.getGlobalTimeout(), TimeUnit.DAYS)) {
LOGGER.info("Job finished within time.");
endProcessSerializer.setStatus("ok");
} else {
LOGGER.warn("Timeout launched: the job is running for one day. Force stopped " + submittedRunnablePipelineContainers.size() + " docker container(s).");
executorService.shutdownNow();
this.setStatusForUnexecutedJobs();
endProcessSerializer.setStatus("timeout");
}
} catch (InterruptedException e) {
LOGGER.error("Error while await termination. Force stopped " + submittedRunnablePipelineContainers.size() + " docker container(s).", e);
executorService.shutdownNow();
this.setStatusForUnexecutedJobs();
endProcessSerializer.setStatus("interrupted");
}
this.getDockerClient().close();
endProcessSerializer.serialize();
if (this.endProcessNotifier != null) {
this.endProcessNotifier.notifyEnd();
}
}
use of fr.inria.spirals.repairnator.serializer.HardwareInfoSerializer in project repairnator by Spirals-Team.
the class Launcher method mainProcess.
private void mainProcess() throws IOException {
LOGGER.info("Start by getting the build (buildId: " + this.config.getBuildId() + ") with the following config: " + this.config);
this.getBuildToBeInspected();
HardwareInfoSerializer hardwareInfoSerializer = new HardwareInfoSerializer(this.engines, this.config.getRunId(), this.config.getBuildId() + "");
hardwareInfoSerializer.serialize();
List<AbstractDataSerializer> serializers = new ArrayList<>();
if (this.config.getLauncherMode() == LauncherMode.REPAIR) {
serializers.add(new InspectorSerializer(this.engines));
serializers.add(new InspectorTimeSerializer(this.engines));
} else {
serializers.add(new InspectorSerializer4Bears(this.engines));
serializers.add(new InspectorTimeSerializer4Bears(this.engines));
}
serializers.add(new NopolSerializer(this.engines));
serializers.add(new NPEFixSerializer(this.engines));
serializers.add(new AstorSerializer(this.engines));
serializers.add(new MetricsSerializer(this.engines));
serializers.add(new PipelineErrorSerializer(this.engines));
ProjectInspector inspector;
if (config.getLauncherMode() == LauncherMode.BEARS) {
inspector = new ProjectInspector4Bears(buildToBeInspected, this.config.getWorkspacePath(), serializers, this.notifiers);
} else {
inspector = new ProjectInspector(buildToBeInspected, this.config.getWorkspacePath(), serializers, this.notifiers);
}
inspector.run();
LOGGER.info("Inspector is finished. The process will now exit.");
System.exit(0);
}
Aggregations