use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class RegisterOGCEUS3Application method updateComputeHost.
public static String updateComputeHost(String computeResourceId, String hostName, String hostDesc, ResourceJobManagerType resourceJobManagerType, String monitoringEndPoint, String jobMangerBinPath, SecurityProtocol securityProtocol, int portNumber, String jobManagerCommand) throws TException {
if (computeResourceId.isEmpty())
throw new AiravataClientException();
ResourceJobManager resourceJobManager = RegisterSampleApplicationsUtils.createResourceJobManager(resourceJobManagerType, monitoringEndPoint, jobMangerBinPath, null);
if (jobManagerCommand != null) {
Map<JobManagerCommand, String> jobManagerCommandStringMap = new HashMap<JobManagerCommand, String>();
jobManagerCommandStringMap.put(JobManagerCommand.SUBMISSION, jobManagerCommand);
resourceJobManager.setJobManagerCommands(jobManagerCommandStringMap);
}
SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
sshJobSubmission.setResourceJobManager(resourceJobManager);
sshJobSubmission.setSecurityProtocol(securityProtocol);
sshJobSubmission.setSshPort(portNumber);
airavataClient.addSSHJobSubmissionDetails(new AuthzToken(""), computeResourceId, 1, sshJobSubmission);
ComputeResourceDescription computeResourceDescription = airavataClient.getComputeResource(new AuthzToken(""), computeResourceId);
computeResourceDescription.getJobSubmissionInterfacesIterator();
SCPDataMovement scpDataMovement = new SCPDataMovement();
scpDataMovement.setSecurityProtocol(securityProtocol);
scpDataMovement.setSshPort(portNumber);
airavataClient.addSCPDataMovementDetails(new AuthzToken(""), computeResourceId, DMType.COMPUTE_RESOURCE, 1, scpDataMovement);
return computeResourceId;
}
use of org.apache.airavata.model.security.AuthzToken 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();
}
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class RegisterSampleApplications method registerStampedeApps.
public void registerStampedeApps() {
try {
System.out.println("#### Registering Application Deployments on Stampede #### \n");
// Register Echo
String echoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId, stampedeResourceId, "/home1/01437/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL, echoDescription, null, null, null));
System.out.println("Echo on stampede deployment Id " + echoAppDeployId);
// Register Amber
List<CommandObject> moduleLoadCMDs = new ArrayList<>();
CommandObject cmd = new CommandObject("module load amber");
moduleLoadCMDs.add(cmd);
ApplicationDeploymentDescription amberStampedeDeployment = RegisterSampleApplicationsUtils.createApplicationDeployment(amberModuleId, stampedeResourceId, "/opt/apps/intel13/mvapich2_1_9/amber/12.0/bin/sander.MPI -O", ApplicationParallelismType.MPI, amberDescription, moduleLoadCMDs, null, null);
String amberAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, amberStampedeDeployment);
System.out.println("Amber on stampede deployment Id " + amberAppDeployId);
// Register ESPRESSO
String espressoAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(espressoModuleId, stampedeResourceId, "/home1/01437/ogce/production/app_wrappers/espresso_wrapper.sh", ApplicationParallelismType.MPI, espressoDescription, null, null, null));
System.out.println("ESPRESSO on stampede deployment Id " + espressoAppDeployId);
// Register GROMACS
String gromacsAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(gromacsModuleId, stampedeResourceId, "/home1/01437/ogce/production/app_wrappers/gromacs_wrapper.sh", ApplicationParallelismType.MPI, gromacsDescription, null, null, null));
System.out.println("GROMACS on stampede deployment Id " + gromacsAppDeployId);
// Register LAMMPS
List<CommandObject> preJobCommands = new ArrayList();
preJobCommands.add(new CommandObject("cp /home1/00421/ccguser/apps/ds_lammps/data/* $workingDir"));
String lammpsAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(lammpsModuleId, stampedeResourceId, "~/apps/ds_lammps/bin/lmp_stampede", ApplicationParallelismType.MPI, lammpsDescription, null, preJobCommands, null));
System.out.println("LAMMPS on stampede deployment Id " + lammpsAppDeployId);
// Register NWChem
List<CommandObject> nwChemModuleCmds = new ArrayList();
nwChemModuleCmds.add(new CommandObject("module load nwchem"));
String nwChemAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(nwChemModuleId, stampedeResourceId, "nwchem", ApplicationParallelismType.MPI, nwChemDescription, nwChemModuleCmds, null, null));
System.out.println("NWChem on stampede deployment Id " + nwChemAppDeployId);
// Register Trinity
String trinityAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(trinityModuleId, stampedeResourceId, "/home1/01437/ogce/production/app_wrappers/trinity_wrapper.sh", ApplicationParallelismType.MPI, trinityDescription, null, null, null));
System.out.println("Trinity on stampede deployment Id " + trinityAppDeployId);
// Register WRF
String wrfAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(wrfModuleId, stampedeResourceId, "/home1/01437/ogce/production/app_wrappers/wrf_wrapper.sh", ApplicationParallelismType.MPI, wrfDescription, null, null, null));
System.out.println("WRF on stampede deployment Id " + wrfAppDeployId);
List<CommandObject> monteXModuleCmds = new ArrayList();
// monteXModuleCmds.add("module load globus");
// monteXModuleCmds.add("module load uberftp");
monteXModuleCmds.add(new CommandObject("module load fftw3"));
String monteXAppDeployId = airavataClient.registerApplicationDeployment(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationDeployment(monteXModuleId, stampedeResourceId, "/home1/00421/ccguser/apps/tinker/tinker/bin/monte.x", ApplicationParallelismType.OPENMP, monteXDescription, monteXModuleCmds, null, null));
System.out.println("Tinker Monte on trestles deployment Id " + monteXAppDeployId);
} catch (TException e) {
e.printStackTrace();
}
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class RegisterSampleApplications method registerUnicoreEndpoint.
public static String registerUnicoreEndpoint(String hostName, String hostDesc, JobSubmissionProtocol protocol, SecurityProtocol securityProtocol) throws TException {
ComputeResourceDescription computeResourceDescription = RegisterSampleApplicationsUtils.createComputeResourceDescription(hostName, hostDesc, null, null);
fsdResourceId = airavataClient.registerComputeResource(new AuthzToken(""), computeResourceDescription);
if (fsdResourceId.isEmpty())
throw new AiravataClientException();
System.out.println("FSD Compute ResourceID: " + fsdResourceId);
JobSubmissionInterface jobSubmission = RegisterSampleApplicationsUtils.createJobSubmissionInterface(fsdResourceId, protocol, 2);
UnicoreJobSubmission ucrJobSubmission = new UnicoreJobSubmission();
ucrJobSubmission.setSecurityProtocol(securityProtocol);
ucrJobSubmission.setUnicoreEndPointURL(unicoreEndPointURL);
// ucrJobSubmission.setAuthenticationMode(AuthenticationMode.MYPROXY_ISSUED);
jobSubmission.setJobSubmissionProtocol(JobSubmissionProtocol.UNICORE);
airavataClient.addUNICOREJobSubmissionDetails(new AuthzToken(""), fsdResourceId, 0, ucrJobSubmission);
return jobSubmission.getJobSubmissionInterfaceId();
}
use of org.apache.airavata.model.security.AuthzToken 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();
}
}
Aggregations