use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class RegisterSampleApplications method registerUltrascanInterface.
private void registerUltrascanInterface() {
try {
System.out.println("#### Registering Ultrascan Application Interface ####");
List<String> appModules = new ArrayList<String>();
appModules.add(ultrascanModuleId);
InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("input", null, DataType.URI, null, 1, true, true, false, "input file", null);
List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
applicationInputs.add(input1);
OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("output/analysis-results.tar", "", DataType.URI, true, true, null);
OutputDataObjectType output2 = RegisterSampleApplicationsUtils.createAppOutput("STDOUT", "", DataType.STDOUT, true, true, null);
OutputDataObjectType output3 = RegisterSampleApplicationsUtils.createAppOutput("STDERR", "", DataType.STDERR, true, true, null);
List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
applicationOutputs.add(output1);
applicationOutputs.add(output2);
applicationOutputs.add(output3);
String ultrascanInterfaceId = airavataClient.registerApplicationInterface(new AuthzToken(""), DEFAULT_GATEWAY, RegisterSampleApplicationsUtils.createApplicationInterfaceDescription("Ultrascan", "Ultrascan application", appModules, applicationInputs, applicationOutputs));
System.out.println("Ultrascan Application Interface Id " + ultrascanInterfaceId);
} catch (TException e) {
e.printStackTrace();
}
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class RegisterUS3Application method registerComputeHost.
public static String registerComputeHost(String hostName, String hostDesc, ResourceJobManagerType resourceJobManagerType, String monitoringEndPoint, String jobMangerBinPath, SecurityProtocol securityProtocol, int portNumber, String jobManagerCommand) throws TException {
ComputeResourceDescription computeResourceDescription = RegisterSampleApplicationsUtils.createComputeResourceDescription(hostName, hostDesc, null, null);
String computeResourceId = airavataClient.registerComputeResource(new AuthzToken(""), computeResourceDescription);
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);
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 RegisterUS3Application method registerUltrascanInterface.
public static void registerUltrascanInterface() {
try {
System.out.println("#### Registering WRF 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 RegisterUS3Application method registerGatewayResourceProfile.
public static void registerGatewayResourceProfile() {
try {
System.out.println("#### Registering Gateway proflie #### \n");
ComputeResourcePreference stampedeResourcePreferences = RegisterSampleApplicationsUtils.createComputeResourcePreference(stampedeResourceId, "TG-MCB070039N", false, null, null, null, "/scratch/01623/us3/jobs/");
ComputeResourcePreference trestlesResourcePreferences = RegisterSampleApplicationsUtils.createComputeResourcePreference(trestlesResourceId, "uot111", false, null, null, null, "/oasis/projects/nsf/uot111/us3/airavata-workdirs/");
ComputeResourcePreference lonestarResourcePreferences = RegisterSampleApplicationsUtils.createComputeResourcePreference(lonestarResourceId, "ULTRASCAN", false, null, null, null, "/scratch/01623/us3/airavata/");
ComputeResourcePreference alamoResourcePreferences = RegisterSampleApplicationsUtils.createComputeResourcePreference(alamoResourceId, null, false, null, null, null, "/mnt/glusterfs/work/");
GatewayResourceProfile gatewayResourceProfile = new GatewayResourceProfile();
gatewayResourceProfile.setGatewayID(DEFAULT_GATEWAY);
gatewayResourceProfile.addToComputeResourcePreferences(stampedeResourcePreferences);
gatewayResourceProfile.addToComputeResourcePreferences(trestlesResourcePreferences);
gatewayResourceProfile.addToComputeResourcePreferences(lonestarResourcePreferences);
gatewayResourceProfile.addToComputeResourcePreferences(alamoResourcePreferences);
String gatewayProfile = airavataClient.registerGatewayResourceProfile(new AuthzToken(""), gatewayResourceProfile);
System.out.println("Gateway Profile is registered with Id " + gatewayProfile);
} catch (TException e) {
e.printStackTrace();
}
}
use of org.apache.airavata.model.security.AuthzToken in project airavata by apache.
the class RegisterUS3Application 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;
}
Aggregations