use of org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel 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);
}
use of org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel in project airavata by apache.
the class CreateLaunchBES method createEchoExperimentForFSD.
public static String createEchoExperimentForFSD(Airavata.Client client) throws TException {
try {
List<InputDataObjectType> exInputs = client.getApplicationInputs(new AuthzToken(""), echoAppId);
for (InputDataObjectType inputDataObjectType : exInputs) {
if (inputDataObjectType.getName().equalsIgnoreCase("Input_to_Echo")) {
inputDataObjectType.setValue("Hello World");
} else if (inputDataObjectType.getName().equalsIgnoreCase("Input_to_Echo2")) {
inputDataObjectType.setValue("http://www.textfiles.com/100/ad.txt");
} else if (inputDataObjectType.getName().equalsIgnoreCase("Input_to_Echo3")) {
inputDataObjectType.setValue("file:///tmp/test.txt");
}
}
List<OutputDataObjectType> exOut = client.getApplicationOutputs(new AuthzToken(""), echoAppId);
ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment(DEFAULT_GATEWAY, "default", "admin", "echoExperiment", "SimpleEcho2", echoAppId, exInputs);
simpleExperiment.setExperimentOutputs(exOut);
Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(new AuthzToken(""), echoAppId);
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, 1, 1, 1, "normal", 30, 1048576);
UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
userConfigurationData.setAiravataAutoSchedule(false);
userConfigurationData.setOverrideManualScheduledParams(false);
userConfigurationData.setComputationalResourceScheduling(scheduling);
userConfigurationData.setGenerateCert(false);
userConfigurationData.setUserDN("");
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;
}
use of org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel in project airavata by apache.
the class CreateLaunchExperiment method createExperimentEchoForLocalHost.
public static String createExperimentEchoForLocalHost(Airavata.Client client) throws TException {
try {
List<InputDataObjectType> exInputs = client.getApplicationInputs(new AuthzToken(""), echoAppId);
for (InputDataObjectType inputDataObjectType : exInputs) {
if (inputDataObjectType.getName().equalsIgnoreCase("Input_to_Echo")) {
inputDataObjectType.setValue("Hello World");
}
}
List<OutputDataObjectType> exOut = client.getApplicationOutputs(new AuthzToken(""), echoAppId);
Project project = ProjectModelUtil.createProject("project1", "admin", "test project");
String projectId = client.createProject(new AuthzToken(""), DEFAULT_GATEWAY, project);
ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment(DEFAULT_GATEWAY, projectId, "admin", "echoExperiment", "Echo Test", echoAppId, exInputs);
simpleExperiment.setExperimentOutputs(exOut);
Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(new AuthzToken(""), echoAppId);
if (computeResources != null && computeResources.size() != 0) {
for (String id : computeResources.keySet()) {
String resourceName = computeResources.get(id);
if (resourceName.equals(localHost)) {
ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling(id, 1, 1, 1, "normal", 30, 1);
UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
userConfigurationData.setAiravataAutoSchedule(false);
userConfigurationData.setOverrideManualScheduledParams(false);
userConfigurationData.setComputationalResourceScheduling(scheduling);
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;
}
use of org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel in project airavata by apache.
the class CreateLaunchExperiment method createExperimentGROMACSStampede.
public static String createExperimentGROMACSStampede(Airavata.Client client) throws TException {
try {
List<InputDataObjectType> exInputs = client.getApplicationInputs(new AuthzToken(""), gromacsAppId);
setGROMACSInputs(exInputs);
List<OutputDataObjectType> exOut = client.getApplicationOutputs(new AuthzToken(""), gromacsAppId);
ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment(DEFAULT_GATEWAY, "default", "admin", "GromacsExperiment", "Testing", gromacsAppId, exInputs);
simpleExperiment.setExperimentOutputs(exOut);
Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(new AuthzToken(""), gromacsAppId);
if (computeResources != null && computeResources.size() != 0) {
for (String id : computeResources.keySet()) {
String resourceName = computeResources.get(id);
if (resourceName.equals(stampedeHostName)) {
ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling(id, 1, 16, 1, "development", 30, 1);
UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
userConfigurationData.setAiravataAutoSchedule(false);
userConfigurationData.setOverrideManualScheduledParams(false);
userConfigurationData.setComputationalResourceScheduling(scheduling);
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;
}
use of org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel in project airavata by apache.
the class CreateLaunchExperiment method createExperimentLAMMPSStampede.
public static String createExperimentLAMMPSStampede(Airavata.Client client) throws TException {
try {
List<InputDataObjectType> exInputs = client.getApplicationInputs(new AuthzToken(""), lammpsAppId);
setLAMMPSInputs(exInputs);
List<OutputDataObjectType> exOut = client.getApplicationOutputs(new AuthzToken(""), lammpsAppId);
ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment(DEFAULT_GATEWAY, "default", "admin", "LAMMPSExperiment", "Testing", lammpsAppId, exInputs);
simpleExperiment.setExperimentOutputs(exOut);
Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(new AuthzToken(""), lammpsAppId);
if (computeResources != null && computeResources.size() != 0) {
for (String id : computeResources.keySet()) {
String resourceName = computeResources.get(id);
if (resourceName.equals(stampedeHostName)) {
ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling(id, 1, 16, 1, "development", 30, 1);
UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
userConfigurationData.setAiravataAutoSchedule(false);
userConfigurationData.setOverrideManualScheduledParams(false);
userConfigurationData.setComputationalResourceScheduling(scheduling);
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;
}
Aggregations