Search in sources :

Example 26 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class RegisterSampleApplications method registerGromacsInterface.

public void registerGromacsInterface() {
    try {
        System.out.println("#### Registering Gromacs Interface #### \n");
        List<String> appModules = new ArrayList<String>();
        appModules.add(gromacsModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Portable_Input_Binary_File", null, DataType.URI, null, 1, true, true, false, "Coordinates velocities, molecular topology and simulation parameters - pdb1y6l-EM-vacuum.tpr", null);
        InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("GROMOS_Coordinate_File", null, DataType.URI, null, 2, true, true, false, "Trajectory Coordinates Molecular Structure in Gromos87 format - pdb1y6l-EM-vacuum.gro", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        applicationInputs.add(input2);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("GROMACS_Execution_Log", null, DataType.URI, true, true, null);
        OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("Full_Precision_Trajectory_file", null, DataType.URI, true, true, null);
        OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("Portable_Energy_file", null, DataType.URI, true, true, null);
        OutputDataObjectType output4 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT", null, DataType.STDOUT, true, true, null);
        OutputDataObjectType output5 = RegisterSampleApplicationsUtils.createAppOutput("STDERR", null, DataType.STDERR, true, true, null);
        List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
        applicationOutputs.add(output1);
        applicationOutputs.add(output2);
        applicationOutputs.add(output3);
        applicationOutputs.add(output4);
        applicationOutputs.add(output5);
        gromacsInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(gromacsName, gromacsDescription, appModules, applicationInputs, applicationOutputs));
        System.out.println("Gromacs Application Interface Id " + gromacsInterfaceId);
    } catch (TException e) {
        e.printStackTrace();
    }
}
Also used : TException(org.apache.thrift.TException) OutputDataObjectType(org.apache.airavata.model.application.io.OutputDataObjectType) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 27 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class RegisterSampleApplications method registerTrinityInterface.

public void registerTrinityInterface() {
    try {
        System.out.println("#### Registering Trinity Interface #### \n");
        List<String> appModules = new ArrayList<String>();
        appModules.add(trinityModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("RNA_Seq_Left_Input", null, DataType.URI, null, 1, true, true, false, "RNA-Seq Left Library - reads.left.fq", null);
        InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("RNA_Seq_Right_Input", null, DataType.URI, null, 2, true, true, false, "RNA-Seq Right Library - reads.right.fq", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        applicationInputs.add(input2);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Trinity_Execution_Log", null, DataType.URI, true, true, null);
        OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("Trinity_FASTA_File", null, DataType.URI, true, true, null);
        OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT", null, DataType.STDOUT, true, true, null);
        OutputDataObjectType output4 = RegisterSampleApplicationsUtils.createAppOutput("STDERR", null, DataType.STDERR, true, true, null);
        List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
        applicationOutputs.add(output1);
        applicationOutputs.add(output2);
        applicationOutputs.add(output3);
        applicationOutputs.add(output4);
        trinityInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(trinityName, trinityDescription, appModules, applicationInputs, applicationOutputs));
        System.out.println("Trinity Application Interface Id " + trinityInterfaceId);
    } catch (TException e) {
        e.printStackTrace();
    }
}
Also used : TException(org.apache.thrift.TException) OutputDataObjectType(org.apache.airavata.model.application.io.OutputDataObjectType) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 28 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class RegisterSampleApplications method registerGaussianInterface.

private void registerGaussianInterface() {
    try {
        System.out.println("#### Registering Gaussian Application Interface ####");
        List<String> appModules = new ArrayList<String>();
        appModules.add(gaussianModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("MainInputFile", null, DataType.URI, null, 1, true, true, false, "Gaussian main input file", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("gaussian.out", "", DataType.URI, true, true, null);
        OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT", null, DataType.STDOUT, true, true, null);
        OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDERR", null, DataType.STDERR, true, true, null);
        List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
        applicationOutputs.add(output1);
        applicationOutputs.add(output2);
        applicationOutputs.add(output3);
        String addApplicationInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Gaussian", "Gaussian application", appModules, applicationInputs, applicationOutputs));
        System.out.println("Gaussian Application Interface Id " + addApplicationInterfaceId);
    } catch (TException e) {
        e.printStackTrace();
    }
}
Also used : TException(org.apache.thrift.TException) OutputDataObjectType(org.apache.airavata.model.application.io.OutputDataObjectType) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 29 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class RegisterSampleApplications method registerAutoDockInterface.

public void registerAutoDockInterface() {
    try {
        System.out.println("#### Registering AutoDock Interface #### \n");
        List<String> appModules = new ArrayList<String>();
        appModules.add(autoDockModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Heat_Restart_File", null, DataType.URI, null, 1, true, true, false, "Heating up the system equilibration stage", null);
        InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("Production_Control_File", null, DataType.URI, null, 2, true, true, false, "Constant pressure and temperature for production stage", null);
        InputDataObjectType input3 = RegisterSampleApplicationsUtils.createAppInput("Parameter_Topology_File", null, DataType.URI, null, 3, true, true, false, "Parameter and Topology coordinates", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        applicationInputs.add(input2);
        applicationInputs.add(input3);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT", null, DataType.STDOUT, true, true, null);
        OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDERR", null, DataType.STDERR, true, true, null);
        List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
        applicationOutputs.add(output1);
        applicationOutputs.add(output2);
        autoDockInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(autoDockName, autoDockDescription, appModules, applicationInputs, applicationOutputs));
        System.out.println("AutoDock Application Interface Id " + autoDockInterfaceId);
    } catch (TException e) {
        e.printStackTrace();
    }
}
Also used : TException(org.apache.thrift.TException) OutputDataObjectType(org.apache.airavata.model.application.io.OutputDataObjectType) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 30 with InputDataObjectType

use of org.apache.airavata.model.application.io.InputDataObjectType in project airavata by apache.

the class CreateLaunchBES method createMPIExperimentForFSD.

public static String createMPIExperimentForFSD(Airavata.Client client) throws TException {
    try {
        List<InputDataObjectType> exInputs = client.getApplicationInputs(new AuthzToken(""), mpiAppId);
        for (InputDataObjectType inputDataObjectType : exInputs) {
            // }
            if (inputDataObjectType.getName().equalsIgnoreCase("NumberOfProcesses")) {
                inputDataObjectType.setValue("32");
            }
            if (inputDataObjectType.getName().equalsIgnoreCase("US3INPUT")) {
                inputDataObjectType.setValue("file://home/m.memon/us3input/smallerdata/hpcinput-uslims3.uthscsa.edu-uslims3_cauma3-01594.tar");
            }
            if (inputDataObjectType.getName().equalsIgnoreCase("US3INPUTARG")) {
                inputDataObjectType.setValue("hpcinput-uslims3.uthscsa.edu-uslims3_cauma3-01594.tar");
            }
        }
        List<OutputDataObjectType> exOut = client.getApplicationOutputs(new AuthzToken(""), mpiAppId);
        for (OutputDataObjectType outputDataObjectType : exOut) {
            if (outputDataObjectType.getName().equals("US3OUT")) {
                outputDataObjectType.setValue("output/analysis-results.tar");
            }
        }
        ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment(DEFAULT_GATEWAY, "default", "admin", "mpiExperiment", "HelloMPI", mpiAppId, exInputs);
        simpleExperiment.setExperimentOutputs(exOut);
        Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(new AuthzToken(""), mpiAppId);
        if (computeResources != null && computeResources.size() != 0) {
            for (String id : computeResources.keySet()) {
                String resourceName = computeResources.get(id);
                if (resourceName.equals(unicoreHostName)) {
                    ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling(id, 0, 4, 0, null, 10, 0);
                    UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
                    userConfigurationData.setAiravataAutoSchedule(false);
                    userConfigurationData.setOverrideManualScheduledParams(false);
                    userConfigurationData.setComputationalResourceScheduling(scheduling);
                    userConfigurationData.setGenerateCert(true);
                    userConfigurationData.setUserDN("CN=m.memon, O=Ultrascan Gateway, C=DE");
                    simpleExperiment.setUserConfigurationData(userConfigurationData);
                    return client.createExperiment(new AuthzToken(""), DEFAULT_GATEWAY, simpleExperiment);
                }
            }
        }
    } catch (AiravataSystemException e) {
        logger.error("Error occured while creating the experiment...", e.getMessage());
        throw new AiravataSystemException(e);
    } catch (InvalidRequestException e) {
        logger.error("Error occured while creating the experiment...", e.getMessage());
        throw new InvalidRequestException(e);
    } catch (AiravataClientException e) {
        logger.error("Error occured while creating the experiment...", e.getMessage());
        throw new AiravataClientException(e);
    } catch (TException e) {
        logger.error("Error occured while creating the experiment...", e.getMessage());
        throw new TException(e);
    }
    return null;
}
Also used : TException(org.apache.thrift.TException) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) ExperimentModel(org.apache.airavata.model.experiment.ExperimentModel) OutputDataObjectType(org.apache.airavata.model.application.io.OutputDataObjectType) UserConfigurationDataModel(org.apache.airavata.model.experiment.UserConfigurationDataModel) AuthzToken(org.apache.airavata.model.security.AuthzToken) ComputationalResourceSchedulingModel(org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel)

Aggregations

InputDataObjectType (org.apache.airavata.model.application.io.InputDataObjectType)86 OutputDataObjectType (org.apache.airavata.model.application.io.OutputDataObjectType)60 TException (org.apache.thrift.TException)49 AuthzToken (org.apache.airavata.model.security.AuthzToken)46 UserConfigurationDataModel (org.apache.airavata.model.experiment.UserConfigurationDataModel)35 ComputationalResourceSchedulingModel (org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel)35 ExperimentModel (org.apache.airavata.model.experiment.ExperimentModel)34 ArrayList (java.util.ArrayList)20 Project (org.apache.airavata.model.workspace.Project)17 AiravataClientException (org.apache.airavata.model.error.AiravataClientException)7 AiravataSystemException (org.apache.airavata.model.error.AiravataSystemException)7 InvalidRequestException (org.apache.airavata.model.error.InvalidRequestException)7 RegistryException (org.apache.airavata.registry.cpi.RegistryException)6 HashMap (java.util.HashMap)3 DocumentCreatorNew (org.apache.airavata.integration.tools.DocumentCreatorNew)3 AppCatalogException (org.apache.airavata.registry.cpi.AppCatalogException)3 BeforeTest (org.testng.annotations.BeforeTest)3 Test (org.testng.annotations.Test)3 JSchException (com.jcraft.jsch.JSchException)2 Session (com.jcraft.jsch.Session)2