Search in sources :

Example 41 with InputDataObjectType

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

the class InputNodeImpl method getInputObject.

@Override
public InputDataObjectType getInputObject() {
    if (inputDataObjectType == null) {
        inputDataObjectType = new InputDataObjectType(getName());
        inputDataObjectType.setValue(getValue());
        inputDataObjectType.setType(getDataType());
    // inputDataObjectType.setIsRequired(true);
    // inputDataObjectType.setDataStaged(true);
    // inputDataObjectType.setInputOrder(0);
    }
    return inputDataObjectType;
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType)

Example 42 with InputDataObjectType

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

the class ApplicationProcessor method getInputAsString.

private static String getInputAsString(ProcessContext context, String name) {
    List<InputDataObjectType> inputList = context.getProcessModel().getProcessInputs();
    String value = null;
    for (Iterator<InputDataObjectType> iterator = inputList.iterator(); iterator.hasNext(); ) {
        InputDataObjectType inputDataObjectType = iterator.next();
        if (inputDataObjectType.getName().equals(name)) {
            value = inputDataObjectType.getValue();
            break;
        }
    }
    return value;
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType)

Example 43 with InputDataObjectType

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

the class DataTransferrer method extractInFileParams.

public List<String> extractInFileParams() {
    List<String> filePrmsList = new ArrayList<String>();
    List<InputDataObjectType> applicationInputs = processContext.getProcessModel().getProcessInputs();
    if (applicationInputs != null && !applicationInputs.isEmpty()) {
        for (InputDataObjectType output : applicationInputs) {
            if (output.getType().equals(DataType.URI)) {
                filePrmsList.add(output.getValue());
            }
        }
    }
    return filePrmsList;
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) ArrayList(java.util.ArrayList)

Example 44 with InputDataObjectType

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

the class UASDataStagingProcessor method buildDataStagingFromInputContext.

private static void buildDataStagingFromInputContext(ProcessContext context, JobDefinitionType value, String smsUrl) throws Exception {
    // sort the inputs first and then build the command ListR
    Comparator<InputDataObjectType> inputOrderComparator = new Comparator<InputDataObjectType>() {

        @Override
        public int compare(InputDataObjectType inputDataObjectType, InputDataObjectType t1) {
            return inputDataObjectType.getInputOrder() - t1.getInputOrder();
        }
    };
    Set<InputDataObjectType> sortedInputSet = new TreeSet<InputDataObjectType>(inputOrderComparator);
    for (InputDataObjectType input : context.getProcessModel().getProcessInputs()) {
        sortedInputSet.add(input);
    }
    if (sortedInputSet != null && !sortedInputSet.isEmpty()) {
        for (InputDataObjectType input : sortedInputSet) {
            if ("".equals(input.getValue()) || input.getValue() == null) {
                continue;
            }
            if (input.getType().equals(DataType.URI)) {
                createInURISMSElement(value, smsUrl, input.getValue(), true);
            } else if (input.getType().equals(DataType.STRING) && input.isDataStaged()) {
                createInURISMSElement(value, smsUrl, input.getValue(), false);
            } else if (input.getType().equals(DataType.STRING) && !input.isDataStaged()) {
                ApplicationProcessor.addApplicationArgument(value, context, input.getValue());
            } else if (input.getType().equals(DataType.FLOAT) || input.getType().equals(DataType.INTEGER)) {
                if (!(input.getName().equals(BESConstants.NUMBER_OF_PROCESSES) || input.getName().equals(BESConstants.PROCESSES_PER_HOST))) {
                    // temp avoid environ going to app args
                    ApplicationProcessor.addApplicationArgument(value, context, String.valueOf(input.getValue()));
                }
            }
        }
    }
}
Also used : InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) TreeSet(java.util.TreeSet) Comparator(java.util.Comparator)

Example 45 with InputDataObjectType

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

the class DataRetrievalIT method runExperiment.

public String runExperiment(String user, String project) throws ApplicationSettingsException, AiravataClientException, InvalidRequestException, AiravataClientException, AiravataSystemException, TException, ExperimentNotFoundException {
    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", project, user, "echoExperiment", "SimpleEcho0", "SimpleEcho0", exInputs);
    simpleExperiment.setExperimentOutputs(exOut);
    ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost", 1, 1, 1, "normal", 0, 0);
    scheduling.setResourceHostId("localhost");
    UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
    userConfigurationData.setAiravataAutoSchedule(false);
    userConfigurationData.setOverrideManualScheduledParams(false);
    userConfigurationData.setComputationalResourceScheduling(scheduling);
    simpleExperiment.setUserConfigurationData(userConfigurationData);
    Client client = getClient();
    final String expId = client.createExperiment(authzToken, "default", simpleExperiment);
    client.launchExperiment(authzToken, expId, "testToken");
    return expId;
}
Also used : OutputDataObjectType(org.apache.airavata.model.application.io.OutputDataObjectType) InputDataObjectType(org.apache.airavata.model.application.io.InputDataObjectType) ArrayList(java.util.ArrayList) Client(org.apache.airavata.api.Airavata.Client) 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