use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class CreateLaunchExperiment method createExperimentESPRESSOStampede.
public static String createExperimentESPRESSOStampede(Airavata.Client client) throws TException {
try {
List<InputDataObjectType> exInputs = client.getApplicationInputs(new AuthzToken(""), espressoAppId);
setESPRESSOInputs(exInputs);
List<OutputDataObjectType> exOut = client.getApplicationOutputs(new AuthzToken(""), espressoAppId);
ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment(DEFAULT_GATEWAY, "default", "admin", "EspressoExperiment", "Testing", espressoAppId, exInputs);
simpleExperiment.setExperimentOutputs(exOut);
Map<String, String> computeResources = airavataClient.getAvailableAppInterfaceComputeResources(new AuthzToken(""), espressoAppId);
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.security.AuthzToken in project airavata by apache.
the class CreateLaunchExperiment method updateExperiment.
public static void updateExperiment(Airavata.Client client, String expId) throws TException {
try {
ExperimentModel experiment = client.getExperiment(new AuthzToken(""), expId);
experiment.setDescription("updatedDescription");
client.updateExperiment(new AuthzToken(""), expId, experiment);
} catch (TException e) {
logger.error("Error occured while creating the experiment...", e.getMessage());
throw new TException(e);
}
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class CreateLaunchExperimentUS3 method createUS3ExperimentForTrestles.
public static String createUS3ExperimentForTrestles(Airavata.Client client) throws AiravataSystemException, InvalidRequestException, AiravataClientException, TException {
try {
List<InputDataObjectType> exInputs = new ArrayList<InputDataObjectType>();
InputDataObjectType input = new InputDataObjectType();
input.setName("input");
input.setType(DataType.URI);
input.setValue("file:///home/sgg/chathuri/laptop_backup/airavata/ultrascan_input/hpcinput.tar");
InputDataObjectType input1 = new InputDataObjectType();
input1.setName("walltime");
input1.setType(DataType.STRING);
input1.setValue("-walltime=60");
InputDataObjectType input2 = new InputDataObjectType();
input2.setName("mgroupcount");
input2.setType(DataType.STRING);
input2.setValue("-mgroupcount=1");
exInputs.add(input);
exInputs.add(input1);
exInputs.add(input2);
List<OutputDataObjectType> exOut = new ArrayList<OutputDataObjectType>();
OutputDataObjectType output = new OutputDataObjectType();
output.setName("output");
output.setType(DataType.URI);
output.setValue("");
// OutputDataObjectType output1 = new OutputDataObjectType();
// output1.setName("stdout");
// output1.setType(DataType.STDOUT);
// output1.setValue("");
// OutputDataObjectType output2 = new OutputDataObjectType();
// output2.setName("stderr");
// output2.setType(DataType.STDERR);
// output2.setValue("");
exOut.add(output);
// exOut.add(output1);
// exOut.add(output2);
Project project = ProjectModelUtil.createProject("ultrascan", "ultrascan", "test project");
String projectId = client.createProject(new AuthzToken(""), DEFAULT_GATEWAY, project);
ExperimentModel simpleExperiment = ExperimentModelUtil.createSimpleExperiment(DEFAULT_GATEWAY, projectId, "ultrascan", "US3ExperimentTrestles", "US3AppTrestles", "ultrascan_7ce6cd43-622c-44e0-87c5-fb7a6528c799", exInputs);
simpleExperiment.setExperimentOutputs(exOut);
ComputationalResourceSchedulingModel scheduling = ExperimentModelUtil.createComputationResourceScheduling("trestles.sdsc.xsede.org_72b9181b-7156-4975-a386-ed98b4949496", 32, 1, 0, "shared", 30, 0);
UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
scheduling.setResourceHostId("trestles.sdsc.xsede.org_72b9181b-7156-4975-a386-ed98b4949496");
userConfigurationData.setAiravataAutoSchedule(false);
userConfigurationData.setOverrideManualScheduledParams(false);
/* AdvancedOutputDataHandling dataHandling = new AdvancedOutputDataHandling();
dataHandling.setOutputDataDir("/home/sgg/chathuri/laptop_backup/airavata");
userConfigurationData.setAdvanceOutputDataHandling(dataHandling);*/
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);
}
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class SampleEchoExperiment method registerLocalhost.
private void registerLocalhost() {
try {
System.out.println("\n #### Registering Localhost Computational Resource #### \n");
ComputeResourceDescription computeResourceDescription = RegisterSampleApplicationsUtils.createComputeResourceDescription("localhost", "LocalHost", null, null);
DataMovementInterface dataMovementInterface = new DataMovementInterface("localhost_data_movement_interface", DataMovementProtocol.LOCAL, 1);
computeResourceDescription.addToDataMovementInterfaces(dataMovementInterface);
JobSubmissionInterface jobSubmissionInterface = new JobSubmissionInterface("localhost_job_submission_interface", JobSubmissionProtocol.LOCAL, 1);
computeResourceDescription.addToJobSubmissionInterfaces(jobSubmissionInterface);
localhostId = airavataClient.registerComputeResource(new AuthzToken(""), computeResourceDescription);
ResourceJobManager resourceJobManager = RegisterSampleApplicationsUtils.createResourceJobManager(ResourceJobManagerType.FORK, null, null, null);
LOCALSubmission submission = new LOCALSubmission();
submission.setResourceJobManager(resourceJobManager);
String localSubmission = airavataClient.addLocalSubmissionDetails(new AuthzToken(""), localhostId, 1, submission);
System.out.println(localSubmission);
System.out.println("LocalHost Resource Id is " + localhostId);
} catch (TException e) {
e.printStackTrace();
}
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class SampleEchoExperiment method registerEchoDeployment.
private void registerEchoDeployment() throws TException {
System.out.println("#### Registering Application Deployments on Localhost ####");
// Register Echo
String echoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), gatewayId, RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, localhostId, "/bin/echo", ApplicationParallelismType.SERIAL, "Echo application description", null, null, null));
System.out.println("Successfully registered Echo application on localhost, application Id = " + echoAppDeployId);
}
Aggregations