use of org.apache.airavata.gfac.core.GFacException in project airavata by apache.
the class DataTransferrer method publishFinalOutputs.
public void publishFinalOutputs() throws GFacException {
try {
if (!resultantOutputsLst.isEmpty()) {
log.debug("Publishing the list of outputs to the registry instance..");
ExperimentCatalog experimentCatalog = processContext.getExperimentCatalog();
experimentCatalog.add(ExpCatChildDataType.EXPERIMENT_OUTPUT, resultantOutputsLst, processContext.getExperimentId());
}
} catch (RegistryException e) {
throw new GFacException("Cannot publish outputs to the registry.");
}
}
use of org.apache.airavata.gfac.core.GFacException in project airavata by apache.
the class LocalRemoteCluster method getJobStatuses.
@Override
public void getJobStatuses(String userName, Map<String, JobStatus> jobStatusMap) throws GFacException {
try {
RawCommandInfo userBasedMonitorCommand = jobManagerConfiguration.getUserBasedMonitorCommand(userName);
LocalCommandOutput localCommandOutput = new LocalCommandOutput();
executeCommand(userBasedMonitorCommand, localCommandOutput);
outputParser.parseJobStatuses(userName, jobStatusMap, localCommandOutput.getStandardOut());
} catch (IOException e) {
throw new GFacException("Error while getting job statuses", e);
}
}
use of org.apache.airavata.gfac.core.GFacException in project airavata by apache.
the class LocalRemoteCluster method submitBatchJob.
@Override
public JobSubmissionOutput submitBatchJob(String jobScriptFilePath, String workingDirectory) throws GFacException {
try {
JobSubmissionOutput jsoutput = new JobSubmissionOutput();
// scp script file to working directory
copyTo(jobScriptFilePath, workingDirectory + File.separator + new File(jobScriptFilePath).getName());
RawCommandInfo submitCommand = jobManagerConfiguration.getSubmitCommand(workingDirectory, jobScriptFilePath);
submitCommand.setRawCommand(submitCommand.getRawCommand());
LocalCommandOutput localCommandOutput = new LocalCommandOutput();
executeCommand(submitCommand, localCommandOutput);
jsoutput.setJobId(outputParser.parseJobSubmission(localCommandOutput.getStandardOut()));
jsoutput.setExitCode(localCommandOutput.getExitCode());
jsoutput.setStdOut(localCommandOutput.getStandardOut());
jsoutput.setStdErr(localCommandOutput.getStandardErrorString());
return jsoutput;
} catch (IOException e) {
throw new GFacException("Error while submitting local batch job", e);
}
}
use of org.apache.airavata.gfac.core.GFacException in project airavata by apache.
the class LocalRemoteCluster method scpThirdParty.
@Override
public void scpThirdParty(String sourceFile, Session srcSession, String destinationFile, Session destSession, DIRECTION inOrOut, boolean ignoreEmptyFile) throws GFacException {
int retryCount = 0;
try {
while (retryCount < MAX_RETRY_COUNT) {
retryCount++;
log.info("Transferring from:" + sourceFile + " To: " + destinationFile);
try {
if (inOrOut == DIRECTION.TO) {
SSHUtils.scpThirdParty(sourceFile, srcSession, destinationFile, destSession, ignoreEmptyFile);
} else {
SSHUtils.scpThirdParty(sourceFile, srcSession, destinationFile, destSession, ignoreEmptyFile);
}
// exit while loop
break;
} catch (JSchException e) {
if (retryCount == MAX_RETRY_COUNT) {
log.error("Retry count " + MAX_RETRY_COUNT + " exceeded for transferring from:" + sourceFile + " To: " + destinationFile, e);
throw e;
}
log.error("Issue with jsch, Retry transferring from:" + sourceFile + " To: " + destinationFile, e);
}
}
} catch (IOException | JSchException e) {
throw new GFacException("Failed scp file:" + sourceFile + " to remote file " + destinationFile, e);
}
}
use of org.apache.airavata.gfac.core.GFacException in project airavata by apache.
the class LocalRemoteCluster method getJobIdByJobName.
@Override
public String getJobIdByJobName(String jobName, String userName) throws GFacException {
try {
RawCommandInfo jobIdMonitorCommand = jobManagerConfiguration.getJobIdMonitorCommand(jobName, userName);
LocalCommandOutput localCommandOutput = new LocalCommandOutput();
executeCommand(jobIdMonitorCommand, localCommandOutput);
return outputParser.parseJobId(jobName, localCommandOutput.getStandardOut());
} catch (IOException e) {
throw new GFacException("Error while getting jobId using JobName", e);
}
}
Aggregations