use of org.apache.airavata.testsuite.multitenantedairavata.utils.ComputeResourceProperties in project airavata by apache.
the class ComputeResourceRegister method registerComputeHost.
public ComputeResourceProperties registerComputeHost(String hostName, String hostDesc, ResourceJobManagerType resourceJobManagerType, String monitoringEndPoint, String jobMangerBinPath, SecurityProtocol securityProtocol, String jobManagerCommand) throws TException {
ComputeResourceDescription computeResourceDescription = createComputeResourceDescription(hostName, hostDesc, null, null);
ComputeResourceProperties computeResourceProperties = new ComputeResourceProperties();
String computeResourceId = airavata.registerComputeResource(authzToken, computeResourceDescription);
computeResourceProperties.setComputeResourceId(computeResourceId);
if (computeResourceId.isEmpty())
throw new AiravataClientException();
ResourceJobManager resourceJobManager = createResourceJobManager(resourceJobManagerType, monitoringEndPoint, jobMangerBinPath, null);
if (jobManagerCommand != null) {
Map<JobManagerCommand, String> jobManagerCommandStringMap = new HashMap<JobManagerCommand, String>();
jobManagerCommandStringMap.put(JobManagerCommand.SUBMISSION, jobManagerCommand);
resourceJobManager.setJobManagerCommands(jobManagerCommandStringMap);
}
LOCALSubmission localobSubmission = new LOCALSubmission();
localobSubmission.setResourceJobManager(resourceJobManager);
localobSubmission.setSecurityProtocol(securityProtocol);
String localJobSubmissionId = airavata.addLocalSubmissionDetails(authzToken, computeResourceId, 0, localobSubmission);
computeResourceProperties.setJobSubmissionId(localJobSubmissionId);
airavata.addLocalDataMovementDetails(authzToken, computeResourceId, DMType.COMPUTE_RESOURCE, 0, new LOCALDataMovement());
return computeResourceProperties;
}
use of org.apache.airavata.testsuite.multitenantedairavata.utils.ComputeResourceProperties in project airavata by apache.
the class ComputeResourceRegister method addComputeResources.
public ComputeResourceProperties addComputeResources() throws Exception {
ComputeResourceProperties computeResourceProperties = null;
try {
for (String resourceName : loginNamesWithResourceMap.keySet()) {
if (resourceName.contains(RESOURCE_NAME)) {
computeResourceProperties = registerComputeHost(HOST_NAME, HOST_DESC, ResourceJobManagerType.FORK, null, "", SecurityProtocol.LOCAL, TestFrameworkConstants.LocalEchoProperties.LocalEchoComputeResource.JOB_MANAGER_COMMAND);
System.out.println("Local Resource Id " + computeResourceProperties.getComputeResourceId());
}
}
} catch (Exception e) {
logger.error("Error occured while adding compute resources", e);
throw new Exception("Error occured while adding compute resources", e);
}
return computeResourceProperties;
}
Aggregations