Search in sources :

Example 61 with InputDataObjectType

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

the class SampleEchoExperiment method createEchoExperiment.

private void createEchoExperiment() throws TException {
    Project project = new Project();
    project.setName("default-project");
    project.setOwner(userId);
    String projectId = airavataClient.createProject(new AuthzToken(""), gatewayId, project);
    ExperimentModel experimentModel = new ExperimentModel();
    experimentModel.setExperimentName("dummy-echo-experiment");
    experimentModel.setProjectId(projectId);
    experimentModel.setUserName(userId);
    experimentModel.setGatewayId(gatewayId);
    experimentModel.setExecutionId(echoInterfaceId);
    UserConfigurationDataModel userConfigurationDataModel = new UserConfigurationDataModel();
    ComputationalResourceSchedulingModel computationalResourceSchedulingModel = new ComputationalResourceSchedulingModel();
    computationalResourceSchedulingModel.setNodeCount(1);
    computationalResourceSchedulingModel.setTotalCPUCount(1);
    computationalResourceSchedulingModel.setTotalPhysicalMemory(512);
    computationalResourceSchedulingModel.setResourceHostId(localhostId);
    userConfigurationDataModel.setComputationalResourceScheduling(computationalResourceSchedulingModel);
    experimentModel.setUserConfigurationData(userConfigurationDataModel);
    List<InputDataObjectType> experimentInputs = new ArrayList<>();
    experimentInputs.add(RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo", "Hello World", DataType.STRING, null, 1, true, true, false, "A test string to Echo", null));
    experimentModel.setExperimentInputs(experimentInputs);
    experimentModel.setExperimentOutputs(airavataClient.getApplicationOutputs(new AuthzToken(""), echoInterfaceId));
    echoExperimentId = airavataClient.createExperiment(new AuthzToken(""), gatewayId, experimentModel);
}
Also used : Project(org.apache.airavata.model.workspace.Project) UserConfigurationDataModel(org.apache.airavata.model.experiment.UserConfigurationDataModel) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) AuthzToken(org.apache.airavata.model.security.AuthzToken) ExperimentModel(org.apache.airavata.model.experiment.ExperimentModel) ArrayList(java.util.ArrayList) ComputationalResourceSchedulingModel(org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel)

Example 62 with InputDataObjectType

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

the class SampleEchoExperiment method registerEchoInterface.

private void registerEchoInterface() {
    try {
        System.out.println("#### Registering Echo Interface ####");
        List<String> appModules = new ArrayList<String>();
        appModules.add(echoModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo", "Hello World", DataType.STRING, null, 1, true, true, false, "A test string to Echo", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Output", "", DataType.STRING, true, false, null);
        List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
        applicationOutputs.add(output1);
        echoInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), gatewayId, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Echo", "Echo application description", appModules, applicationInputs, applicationOutputs));
        System.out.println("Echo Application Interface Id " + echoInterfaceId);
    } 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) ArrayList(java.util.ArrayList) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 63 with InputDataObjectType

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

the class RegisterOGCEUS3Application method registerUltrascanInterface.

public static void registerUltrascanInterface() {
    try {
        System.out.println("#### Registering Ultrascan Interface #### \n");
        List<String> appModules = new ArrayList<String>();
        appModules.add(ultrascanModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("input", null, DataType.URI, null, 1, true, true, false, "input tar file", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("output", "", DataType.URI, true, false, null);
        // OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("stdout",
        // "", DataType.URI);
        // OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("stderr",
        // "", DataType.URI);
        List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
        applicationOutputs.add(output1);
        ultrascanAppId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("ultrascan", "ultrascan application", appModules, applicationInputs, applicationOutputs));
        System.out.println("Ultrascan Application Interface Id " + ultrascanAppId);
    } 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) ArrayList(java.util.ArrayList) AuthzToken(org.apache.airavata.model.security.AuthzToken)

Example 64 with InputDataObjectType

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

the class RegisterSampleApplications method registerEchoInterface.

public void registerEchoInterface() {
    try {
        System.out.println("#### Registering Echo Interface #### \n");
        List<String> appModules = new ArrayList<String>();
        appModules.add(echoModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo", "", DataType.STRING, null, 1, false, true, false, "A test string to Echo", null);
        // InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo2", "",
        // DataType.URI, null, 2, false, false,false, "A sample input remote file", null);
        // 
        // InputDataObjectType input3 = RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo3", "file:///tmp/test.txt",
        // DataType.URI, null, 3,false, false, false, "A sample input local file", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        // applicationInputs.add(input2); applicationInputs.add(input3);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Output", "", DataType.STDOUT, true, false, null);
        OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Error", "", DataType.STDERR, true, false, null);
        List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
        applicationOutputs.add(output1);
        applicationOutputs.add(output2);
        echoInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(echoName, echoDescription, appModules, applicationInputs, applicationOutputs));
        System.out.println("Echo Application Interface Id " + echoInterfaceId);
    } 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 65 with InputDataObjectType

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

the class RegisterSampleApplications method registerTinkerMonteInterface.

private void registerTinkerMonteInterface() {
    try {
        System.out.println("#### Registering Tinker Monte Application Interface ####");
        List<String> appModules = new ArrayList<String>();
        appModules.add(monteXModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("xyzf", "O16.xyz", DataType.URI, null, 1, true, true, false, "Tinker monte input_1", null);
        InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("keyf", "O16.key", DataType.URI, "-k", 2, true, true, false, "Tinker monte input_2", null);
        InputDataObjectType input3 = RegisterSampleApplicationsUtils.createAppInput("stps", "20000", DataType.STRING, null, 3, true, true, false, "Tinker monte input_3", null);
        InputDataObjectType input4 = RegisterSampleApplicationsUtils.createAppInput("Ctc", "C", DataType.STRING, null, 4, true, true, false, "Tinker monte input_4", null);
        InputDataObjectType input5 = RegisterSampleApplicationsUtils.createAppInput("stpsZ", "3.0", DataType.STRING, null, 5, true, true, false, "Tinker monte input_5", null);
        InputDataObjectType input6 = RegisterSampleApplicationsUtils.createAppInput("temp", "298", DataType.STRING, null, 6, true, true, false, "Tinker monte input_6", null);
        InputDataObjectType input7 = RegisterSampleApplicationsUtils.createAppInput("Rconv", "0.01", DataType.STRING, null, 7, true, true, false, "Tinker monte input_7", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        applicationInputs.add(input2);
        applicationInputs.add(input3);
        applicationInputs.add(input4);
        applicationInputs.add(input5);
        applicationInputs.add(input6);
        applicationInputs.add(input7);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Diskoutputfile_with_dir", "", DataType.URI, false, false, 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("Tinker_Monte", "Monte application", appModules, applicationInputs, applicationOutputs));
        System.out.println("Monte 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)

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