Search in sources :

Example 6 with ComputeResourceDescription

use of org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription in project airavata by apache.

the class DocumentCreatorNew method createSlurmDocs.

public String createSlurmDocs() throws AppCatalogException, InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
    ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(stampedeHostAddress, null, null);
    host.addToHostAliases(stampedeHostAddress);
    host.addToIpAddresses(stampedeHostAddress);
    host.setComputeResourceId(client.registerComputeResource(authzToken, host));
    ResourceJobManager resourceJobManager = DocumentCreatorUtils.createResourceJobManager(ResourceJobManagerType.SLURM, "/usr/bin/", null, "push");
    SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
    sshJobSubmission.setResourceJobManager(resourceJobManager);
    sshJobSubmission.setSecurityProtocol(SecurityProtocol.GSI);
    sshJobSubmission.setSshPort(2222);
    client.addSSHJobSubmissionDetails(authzToken, host.getComputeResourceId(), 1, sshJobSubmission);
    SCPDataMovement scpDataMovement = new SCPDataMovement();
    scpDataMovement.setSecurityProtocol(SecurityProtocol.GSI);
    scpDataMovement.setSshPort(22);
    client.addSCPDataMovementDetails(authzToken, host.getComputeResourceId(), 1, scpDataMovement);
    ApplicationModule module = DocumentCreatorUtils.createApplicationModule("echo", "1.3", null);
    module.setAppModuleId(client.registerApplicationModule(authzToken, DEFAULT_GATEWAY, module));
    ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
    // application.setIsEmpty(false);
    application.setApplicationName("SimpleEcho3");
    application.addToApplicationModules(module.getAppModuleId());
    application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", null, null, DataType.STRING));
    application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
    application.setApplicationInterfaceId(client.registerApplicationInterface(authzToken, DEFAULT_GATEWAY, application));
    ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module.getAppModuleId(), "/bin/echo", ApplicationParallelismType.SERIAL, "EchoLocal");
    deployment.setAppDeploymentId(client.registerApplicationDeployment(authzToken, DEFAULT_GATEWAY, deployment));
    client.addGatewayComputeResourcePreference(authzToken, getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
    return host.getComputeResourceId() + "," + application.getApplicationInterfaceId();
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription) ComputeResourceDescription(org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription) ResourceJobManager(org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager) ApplicationInterfaceDescription(org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription) SSHJobSubmission(org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission) ApplicationModule(org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule)

Example 7 with ComputeResourceDescription

use of org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription in project airavata by apache.

the class DocumentCreatorNew method createSlumWRFDocs.

public String createSlumWRFDocs() throws AppCatalogException, TException {
    ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(stampedeHostAddress, null, null);
    host.addToHostAliases(stampedeHostAddress);
    host.addToIpAddresses(stampedeHostAddress);
    host.setComputeResourceId(client.registerComputeResource(authzToken, host));
    ResourceJobManager resourceJobManager = DocumentCreatorUtils.createResourceJobManager(ResourceJobManagerType.SLURM, "/usr/bin/", null, "push");
    SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
    sshJobSubmission.setResourceJobManager(resourceJobManager);
    sshJobSubmission.setSecurityProtocol(SecurityProtocol.GSI);
    sshJobSubmission.setSshPort(2222);
    client.addSSHJobSubmissionDetails(authzToken, host.getComputeResourceId(), 1, sshJobSubmission);
    SCPDataMovement scpDataMovement = new SCPDataMovement();
    scpDataMovement.setSecurityProtocol(SecurityProtocol.GSI);
    scpDataMovement.setSshPort(22);
    client.addSCPDataMovementDetails(authzToken, host.getComputeResourceId(), 1, scpDataMovement);
    client.addSCPDataMovementDetails(authzToken, host.getComputeResourceId(), 1, scpDataMovement);
    client.addGatewayComputeResourcePreference(authzToken, getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
    ApplicationModule module2 = DocumentCreatorUtils.createApplicationModule("wrf", "1.0.0", null);
    module2.setAppModuleId(client.registerApplicationModule(authzToken, DEFAULT_GATEWAY, module2));
    ApplicationInterfaceDescription application2 = new ApplicationInterfaceDescription();
    // application2.setIsEmpty(false);
    application2.setApplicationName("WRF");
    application2.addToApplicationModules(module2.getAppModuleId());
    application2.addToApplicationInputs(DocumentCreatorUtils.createAppInput("WRF_Namelist", "WRF_Namelist", null, null, DataType.URI));
    application2.addToApplicationInputs(DocumentCreatorUtils.createAppInput("WRF_Boundary_File", "WRF_Boundary_File", null, null, DataType.URI));
    application2.addToApplicationInputs(DocumentCreatorUtils.createAppInput("WRF_Input_File", "WRF_Input_File", null, null, DataType.URI));
    application2.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("WRF_Output", null, DataType.URI));
    application2.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("WRF_Execution_Log", null, DataType.URI));
    application2.setApplicationInterfaceId(client.registerApplicationInterface(authzToken, DEFAULT_GATEWAY, application2));
    ApplicationDeploymentDescription deployment2 = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module2.getAppModuleId(), "/home1/01437/ogce/production/app_wrappers/wrf_wrapper.sh", ApplicationParallelismType.MPI, "WRF");
    deployment2.setAppDeploymentId(client.registerApplicationDeployment(authzToken, DEFAULT_GATEWAY, deployment2));
    return host.getComputeResourceId() + "," + application2.getApplicationInterfaceId();
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription) ComputeResourceDescription(org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription) ResourceJobManager(org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager) ApplicationInterfaceDescription(org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription) SSHJobSubmission(org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission) ApplicationModule(org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule)

Example 8 with ComputeResourceDescription

use of org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription in project airavata by apache.

the class DocumentCreatorUtils method createComputeResourceDescription.

public static ComputeResourceDescription createComputeResourceDescription(String hostName, List<String> hostAliases, List<String> ipAddresses) {
    ComputeResourceDescription host = new ComputeResourceDescription();
    host.setHostName(hostName);
    host.setIpAddresses(ipAddresses);
    host.setHostAliases(hostAliases);
    return host;
}
Also used : ComputeResourceDescription(org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription)

Example 9 with ComputeResourceDescription

use of org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription in project airavata by apache.

the class CreateLaunchBES method registerUnicoreEndpoint.

public static String registerUnicoreEndpoint(String hostName, String hostDesc, JobSubmissionProtocol protocol, SecurityProtocol securityProtocol) throws TException {
    ComputeResourceDescription computeResourceDescription = RegisterSampleApplicationsUtils.createComputeResourceDescription(hostName, hostDesc, null, null);
    fsdResourceId = airavataClient.registerComputeResource(new AuthzToken(""), computeResourceDescription);
    if (fsdResourceId.isEmpty())
        throw new AiravataClientException();
    System.out.println("FSD Compute ResourceID: " + fsdResourceId);
    JobSubmissionInterface jobSubmission = RegisterSampleApplicationsUtils.createJobSubmissionInterface(fsdResourceId, protocol, 2);
    UnicoreJobSubmission ucrJobSubmission = new UnicoreJobSubmission();
    ucrJobSubmission.setSecurityProtocol(securityProtocol);
    ucrJobSubmission.setUnicoreEndPointURL(unicoreEndPointURL);
    return jobSubmission.getJobSubmissionInterfaceId();
}
Also used : UnicoreJobSubmission(org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission) JobSubmissionInterface(org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface) ComputeResourceDescription(org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 10 with ComputeResourceDescription

use of org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription in project airavata by apache.

the class DocumentCreatorNew method createSGEDocs.

public String createSGEDocs() throws AppCatalogException, InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
    ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(lonestarHostAddress, null, null);
    host.addToHostAliases(lonestarHostAddress);
    host.addToIpAddresses(lonestarHostAddress);
    host.setComputeResourceId(client.registerComputeResource(authzToken, host));
    ResourceJobManager resourceJobManager = DocumentCreatorUtils.createResourceJobManager(ResourceJobManagerType.UGE, "/opt/sge6.2/bin/lx24-amd64/", null, null);
    SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
    sshJobSubmission.setResourceJobManager(resourceJobManager);
    sshJobSubmission.setSecurityProtocol(SecurityProtocol.GSI);
    sshJobSubmission.setSshPort(22);
    client.addSSHJobSubmissionDetails(authzToken, host.getComputeResourceId(), 1, sshJobSubmission);
    SCPDataMovement scpDataMovement = new SCPDataMovement();
    scpDataMovement.setSecurityProtocol(SecurityProtocol.GSI);
    scpDataMovement.setSshPort(22);
    client.addSCPDataMovementDetails(authzToken, host.getComputeResourceId(), 1, scpDataMovement);
    ApplicationModule module = DocumentCreatorUtils.createApplicationModule("echo", "1.4", null);
    module.setAppModuleId(client.registerApplicationModule(authzToken, DEFAULT_GATEWAY, module));
    ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
    // application.setIsEmpty(false);
    application.setApplicationName("SimpleEcho4");
    application.addToApplicationModules(module.getAppModuleId());
    application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", null, null, DataType.STRING));
    application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
    application.setApplicationInterfaceId(client.registerApplicationInterface(authzToken, DEFAULT_GATEWAY, application));
    ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module.getAppModuleId(), "/bin/echo", ApplicationParallelismType.SERIAL, "EchoLocal");
    deployment.setAppDeploymentId(client.registerApplicationDeployment(authzToken, DEFAULT_GATEWAY, deployment));
    client.addGatewayComputeResourcePreference(authzToken, getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
    return host.getComputeResourceId() + "," + application.getApplicationInterfaceId();
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription) ComputeResourceDescription(org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription) ResourceJobManager(org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager) ApplicationInterfaceDescription(org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription) SSHJobSubmission(org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission) ApplicationModule(org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule)

Aggregations

ComputeResourceDescription (org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription)22 ApplicationDeploymentDescription (org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription)13 ApplicationModule (org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule)12 ResourceJobManager (org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager)12 ApplicationInterfaceDescription (org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription)11 SSHJobSubmission (org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission)11 ArrayList (java.util.ArrayList)6 JobSubmissionInterface (org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface)4 ComputeResourcePreference (org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference)4 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)3 Test (org.junit.Test)3 JobManagerCommand (org.apache.airavata.model.appcatalog.computeresource.JobManagerCommand)2 UnicoreJobSubmission (org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission)2 GatewayResourceProfile (org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile)2 UserComputeResourcePreference (org.apache.airavata.model.appcatalog.userresourceprofile.UserComputeResourcePreference)2 AuthzToken (org.apache.airavata.model.security.AuthzToken)2 RegistryService (org.apache.airavata.registry.api.RegistryService)2 Channel (com.jcraft.jsch.Channel)1 ChannelExec (com.jcraft.jsch.ChannelExec)1 JSch (com.jcraft.jsch.JSch)1