Search in sources :

Example 36 with InputDataObjectType

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

the class RegisterSampleApplications method registerEspressoInterface.

public void registerEspressoInterface() {
    try {
        System.out.println("#### Registering Espresso Interface #### \n");
        List<String> appModules = new ArrayList<String>();
        appModules.add(espressoModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("AI_Primitive_Cell", null, DataType.URI, null, 1, true, true, false, "AI_Metal_Input_File - Al.sample.in", null);
        InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("AI_Pseudopotential_File", null, DataType.URI, null, 2, true, true, false, "Constant pressure and temperature for production stage - Al.pz-vbc.UPF", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        applicationInputs.add(input2);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("ESPRESSO_Execution_Log", null, DataType.URI, true, true, null);
        OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("ESPRESSO_WFC_Binary_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);
        espressoInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(espressoName, espressoDescription, appModules, applicationInputs, applicationOutputs));
        System.out.println("Espresso Application Interface Id " + espressoInterfaceId);
    } 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 37 with InputDataObjectType

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

the class RegisterSampleApplications method registerPhastaInterface.

public void registerPhastaInterface() {
    try {
        System.out.println("#### Registering PHASTA Interface #### \n");
        List<String> appModules = new ArrayList<String>();
        appModules.add(phastaModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Parasolid_Geometric_Model", null, DataType.URI, null, 1, true, true, false, "Parasolid geometric model - geom.xmt_txt", null);
        InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("Problem_Definition", null, DataType.URI, null, 2, true, true, false, "problem definition - geom.smd", null);
        InputDataObjectType input3 = RegisterSampleApplicationsUtils.createAppInput("Mesh_Description_File", null, DataType.URI, null, 3, true, true, false, "Mesh Description - geom.sms", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        applicationInputs.add(input2);
        applicationInputs.add(input3);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("PHASTA_Execution_Log", null, DataType.URI, true, true, null);
        OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("PHASTA_Output_tar", 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);
        phastaInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(phastaName, phastaDescription, appModules, applicationInputs, applicationOutputs));
        System.out.println("phasta Application Interface Id " + phastaInterfaceId);
    } 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 38 with InputDataObjectType

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

the class RegisterSampleApplications method registerNWChemInterface.

public void registerNWChemInterface() {
    try {
        System.out.println("#### Registering NWChem Interface #### \n");
        List<String> appModules = new ArrayList<String>();
        appModules.add(nwChemModuleId);
        InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Water_Molecule_Input", null, DataType.URI, null, 1, true, true, false, "Water Molecule Input File - water.nw", null);
        List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
        applicationInputs.add(input1);
        OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("NWChem_Execution_Log", null, DataType.URI, true, 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);
        nwChemInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription(nwChemName, nwChemDescription, appModules, applicationInputs, applicationOutputs));
        System.out.println("NWChem Application Interface Id " + nwChemInterfaceId);
    } 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 39 with InputDataObjectType

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

the class AppInterfaceUtil method createApplicationInput.

public static InputDataObjectType createApplicationInput(String name, String value, DataType type, String applicationArgument, int order, boolean standardInput, String userFriendlyDesc, String metadata) {
    InputDataObjectType appInput = new InputDataObjectType();
    appInput.setName(name);
    appInput.setValue(value);
    appInput.setType(type);
    appInput.setMetaData(metadata);
    appInput.setApplicationArgument(applicationArgument);
    appInput.setInputOrder(order);
    appInput.setUserFriendlyDescription(userFriendlyDesc);
    appInput.setStandardInput(standardInput);
    return appInput;
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType)

Example 40 with InputDataObjectType

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

the class OrchestratorClientSample method storeExperimentDetail.

/*

    public static void main(String[] args) {
        try {
            AiravataUtils.setExecutionAsClient();
            sysUser = ClientSettings.getSetting(DEFAULT_USER);
            sysUserPwd = ClientSettings.getSetting(DEFAULT_USER_PASSWORD);
            gateway = ClientSettings.getSetting(DEFAULT_GATEWAY);
            orchestratorClient = OrchestratorClientFactory.createOrchestratorClient("localhost", 8940);
            registry = RegistryFactory.getRegistry(gateway, sysUser, sysUserPwd);
            documentCreator = new DocumentCreator(getAiravataAPI());
            documentCreator.createLocalHostDocs();
            documentCreator.createGramDocs();
            documentCreator.createPBSDocsForOGCE();
            storeExperimentDetail();
        } catch (ApplicationSettingsException e) {
            e.printStackTrace();
        } catch (RegistryException e) {
            e.printStackTrace();
        }

    }

    private static AiravataAPI getAiravataAPI() {
        AiravataAPI airavataAPI = null;
            try {
                airavataAPI = AiravataAPIFactory.getAPI(gateway, sysUser);
            } catch (AiravataAPIInvocationException e) {
                e.printStackTrace();
            }
        return airavataAPI;
    }
*/
public static void storeExperimentDetail() {
    for (int i = 0; i < NUM_CONCURRENT_REQUESTS; i++) {
        Thread thread = new Thread() {

            public void run() {
                List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
                InputDataObjectType input = new InputDataObjectType();
                input.setName("echo_input");
                input.setType(DataType.STRING);
                input.setValue("echo_output=Hello World");
                exInputs.add(input);
                List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
                OutputDataObjectType output = new OutputDataObjectType();
                output.setName("echo_output");
                output.setType(DataType.STRING);
                output.setValue("");
                exOut.add(output);
                ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment(DEFAULT_GATEWAY, "default", "admin", "echoExperiment", "SimpleEcho2", "SimpleEcho2", exInputs);
                simpleExperiment.setExperimentOutputs(exOut);
                ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.edu", 1, 1, 1, "normal", 0, 0);
                scheduling.setResourceHostId("gsissh-trestles");
                UserConfigurationDataModel userConfigurationDataModel = new UserConfigurationDataModel();
                userConfigurationDataModel.setComputationalResourceScheduling(scheduling);
                simpleExperiment.setUserConfigurationData(userConfigurationDataModel);
                String expId = null;
                try {
                // expId = (String) registry.add(ParentDataType.EXPERIMENT, simpleExperiment);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                try {
                    orchestratorClient.launchExperiment(expId, "airavataToken");
                } catch (TException e) {
                    e.printStackTrace();
                }
            }
        };
        thread.start();
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
Also used : TException(org.apache.thrift.TException) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) ArrayList(java.util.ArrayList) ExperimentModel(org.apache.airavata.model.experiment.ExperimentModel) TException(org.apache.thrift.TException) OutputDataObjectType(org.apache.airavata.model.application.io.OutputDataObjectType) UserConfigurationDataModel(org.apache.airavata.model.experiment.UserConfigurationDataModel) 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