Search in sources :

Example 1 with ComputeResourceProperties

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;
}
Also used : HashMap(java.util.HashMap) LOCALDataMovement(org.apache.airavata.model.data.movement.LOCALDataMovement) ComputeResourceProperties(org.apache.airavata.testsuite.multitenantedairavata.utils.ComputeResourceProperties) AiravataClientException(org.apache.airavata.model.error.AiravataClientException)

Example 2 with 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;
}
Also used : ComputeResourceProperties(org.apache.airavata.testsuite.multitenantedairavata.utils.ComputeResourceProperties) TException(org.apache.thrift.TException) AiravataClientException(org.apache.airavata.model.error.AiravataClientException)

Aggregations

AiravataClientException (org.apache.airavata.model.error.AiravataClientException)2 ComputeResourceProperties (org.apache.airavata.testsuite.multitenantedairavata.utils.ComputeResourceProperties)2 HashMap (java.util.HashMap)1 LOCALDataMovement (org.apache.airavata.model.data.movement.LOCALDataMovement)1 TException (org.apache.thrift.TException)1