private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.SCANNER.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.CHECKBRANCHES.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.DOCKERPOOL.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
private void initNotifiers() { if (this.config.isNotifyEndProcess()) { List<NotifierEngine> notifierEngines = LauncherUtils.initNotifierEngines(LOGGER); this.endProcessNotifier = new EndProcessNotifier(notifierEngines, LauncherType.REALTIME.name().toLowerCase()+" (runid: "+this.config.getRunId()+")"); } }
private void runPool() throws IOException { String runId = this.config.getRunId(); List<String> branchNames = this.readListOfBranches(); LOGGER.info("Find "+branchNames.size()+" branches to run."); this.docker = DockerHelper.initDockerClient(); String imageId = DockerHelper.findDockerImage(this.config.getDockerImageName(), this.docker); LOGGER.info("Found the following docker image id: "+imageId); ExecutorService executorService = Executors.newFixedThreadPool(this.config.getNbThreads()); for (String branchName : branchNames) { RunnablePipelineContainer runnablePipelineContainer = new RunnablePipelineContainer(imageId, branchName); submittedRunnablePipelineContainers.add(runnablePipelineContainer); executorService.submit(runnablePipelineContainer); } executorService.shutdown(); try { if (executorService.awaitTermination(this.config.getGlobalTimeout(), TimeUnit.DAYS)) { LOGGER.info("Job finished within time."); } else { LOGGER.warn("Timeout launched: the job is running for one day. Force stopped "+ submittedRunnablePipelineContainers.size()+" docker container(s)."); executorService.shutdownNow(); } } catch (InterruptedException e) { LOGGER.error("Error while await termination. Force stopped "+ submittedRunnablePipelineContainers.size()+" docker container(s).", e); executorService.shutdownNow(); } this.docker.close(); if (this.endProcessNotifier != null) { this.endProcessNotifier.notifyEnd(); } }
JsonObject element = (JsonObject)gson.toJsonTree(inspector.getJobStatus().getProperties()); element.addProperty("runId", RepairnatorConfig.getInstance().getRunId()); Date reproductionDateBeginning = inspector.getJobStatus().getProperties().getReproductionBuggyBuild().getReproductionDateBeginning(); reproductionDateBeginning = reproductionDateBeginning == null ? new Date() : reproductionDateBeginning;
this.treatedBuildTracking = treatedBuildTracking; this.containerName = "repairnator-pipeline_"+ Utils.formatFilenameDate(new Date())+"_"+this.inputBuildId.getBuggyBuildId()+"_"+this.repairnatorConfig.getRunId(); String output = (this.repairnatorConfig.isCreateOutputDir()) ? "/var/log/"+this.repairnatorConfig.getRunId() : "/var/log"; this.envValues.add("RUN_ID="+this.repairnatorConfig.getRunId()); this.envValues.add("REPAIR_MODE="+this.repairnatorConfig.getLauncherMode().name().toLowerCase()); this.envValues.add("PUSH_URL="+this.repairnatorConfig.getPushRemoteRepo());
public BuildRunner(RTScanner rtScanner) { LOGGER.info("Init build runner"); super.setDockerOutputDir(RepairnatorConfig.getInstance().getLogDirectory()); super.setRunId(RepairnatorConfig.getInstance().getRunId()); super.setEngines(rtScanner.getEngines()); }
private void runPool() throws IOException { String runId = this.config.getRunId(); HardwareInfoSerializer hardwareInfoSerializer = new HardwareInfoSerializer(this.engines, runId, "dockerPool"); hardwareInfoSerializer.serialize();
System.exit(-1); String runId = this.getConfig().getRunId();
private void initAndRunRTScanner() { LOGGER.info("Init RTScanner..."); LOGGER.info("RTScanner mode : " + this.config.getLauncherMode()); String runId = this.config.getRunId(); HardwareInfoSerializer hardwareInfoSerializer = new HardwareInfoSerializer(this.engines, runId, "rtScanner"); hardwareInfoSerializer.serialize(); RTScanner rtScanner = new RTScanner(runId, this.engines); if (this.summaryNotifier != null) { rtScanner.setSummaryNotifier(this.summaryNotifier); } 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(); }
private void mainProcess() { LOGGER.info("Start by getting the build (buildId: "+this.getConfig().getBuildId()+") with the following config: "+this.getConfig()); this.getBuildToBeInspected(); HardwareInfoSerializer hardwareInfoSerializer = new HardwareInfoSerializer(this.engines, this.getConfig().getRunId(), this.getConfig().getBuildId()+""); hardwareInfoSerializer.serialize(); List<AbstractDataSerializer> serializers = new ArrayList<>(); if (this.getConfig().getLauncherMode() == LauncherMode.BEARS) { serializers.add(new InspectorSerializer4Bears(this.engines)); } else { serializers.add(new InspectorSerializer(this.engines)); } serializers.add(new PropertiesSerializer(this.engines)); serializers.add(new InspectorTimeSerializer(this.engines)); serializers.add(new PipelineErrorSerializer(this.engines)); serializers.add(new PatchesSerializer(this.engines)); serializers.add(new ToolDiagnosticSerializer(this.engines)); ProjectInspector inspector; if (this.getConfig().getLauncherMode() == LauncherMode.BEARS) { inspector = new ProjectInspector4Bears(buildToBeInspected, this.getConfig().getWorkspacePath(), serializers, this.notifiers); } else if (this.getConfig().getLauncherMode() == LauncherMode.CHECKSTYLE) { inspector = new ProjectInspector4Checkstyle(buildToBeInspected, this.getConfig().getWorkspacePath(), serializers, this.notifiers); } else { inspector = new ProjectInspector(buildToBeInspected, this.getConfig().getWorkspacePath(), serializers, this.notifiers); } inspector.setPatchNotifier(this.patchNotifier); inspector.run(); LOGGER.info("Inspector is finished. The process will exit now."); System.exit(0); }
private Map<ScannedBuildStatus, List<BuildToBeInspected>> runScanner() throws IOException { Launcher.LOGGER.info("Start to scan projects in Travis..."); ProjectScanner scanner = new ProjectScanner(this.config.getLookFromDate(), this.config.getLookToDate(), this.config.getRunId()); Map<ScannedBuildStatus, List<BuildToBeInspected>> buildsToBeInspected = scanner.getListOfBuildsToBeInspectedFromProjects(this.config.getInputPath()); ProcessSerializer scannerSerializer; if (this.config.getLauncherMode() == LauncherMode.REPAIR) { scannerSerializer = new ScannerSerializer(this.engines, scanner); } else { scannerSerializer = new ScannerSerializer4Bears(this.engines, scanner); ScannerDetailedDataSerializer scannerDetailedDataSerializer = new ScannerDetailedDataSerializer(this.engines, buildsToBeInspected); scannerDetailedDataSerializer.serialize(); } scannerSerializer.serialize(); Launcher.LOGGER.info("---------------------------------------------------------------"); Launcher.LOGGER.info("Scanner results."); Launcher.LOGGER.info("---------------------------------------------------------------"); if (buildsToBeInspected.isEmpty()) { Launcher.LOGGER.info("No build interesting to be inspected has been found ("+scanner.getTotalScannedBuilds()+" scanned builds.)"); } else { Launcher.LOGGER.info(buildsToBeInspected.size()+" builds interesting to be inspected have been found ("+scanner.getTotalScannedBuilds()+" scanned builds.)"); } return buildsToBeInspected; }