use of org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription in project airavata by apache.
the class DocumentCreatorNew method createSlumWRFDocs.
public String createSlumWRFDocs() throws AppCatalogException, TException {
ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(stampedeHostAddress, null, null);
host.addToHostAliases(stampedeHostAddress);
host.addToIpAddresses(stampedeHostAddress);
host.setComputeResourceId(client.registerComputeResource(authzToken, host));
ResourceJobManager resourceJobManager = DocumentCreatorUtils.createResourceJobManager(ResourceJobManagerType.SLURM, "/usr/bin/", null, "push");
SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
sshJobSubmission.setResourceJobManager(resourceJobManager);
sshJobSubmission.setSecurityProtocol(SecurityProtocol.GSI);
sshJobSubmission.setSshPort(2222);
client.addSSHJobSubmissionDetails(authzToken, host.getComputeResourceId(), 1, sshJobSubmission);
SCPDataMovement scpDataMovement = new SCPDataMovement();
scpDataMovement.setSecurityProtocol(SecurityProtocol.GSI);
scpDataMovement.setSshPort(22);
client.addSCPDataMovementDetails(authzToken, host.getComputeResourceId(), 1, scpDataMovement);
client.addSCPDataMovementDetails(authzToken, host.getComputeResourceId(), 1, scpDataMovement);
client.addGatewayComputeResourcePreference(authzToken, getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
ApplicationModule module2 = DocumentCreatorUtils.createApplicationModule("wrf", "1.0.0", null);
module2.setAppModuleId(client.registerApplicationModule(authzToken, DEFAULT_GATEWAY, module2));
ApplicationInterfaceDescription application2 = new ApplicationInterfaceDescription();
// application2.setIsEmpty(false);
application2.setApplicationName("WRF");
application2.addToApplicationModules(module2.getAppModuleId());
application2.addToApplicationInputs(DocumentCreatorUtils.createAppInput("WRF_Namelist", "WRF_Namelist", null, null, DataType.URI));
application2.addToApplicationInputs(DocumentCreatorUtils.createAppInput("WRF_Boundary_File", "WRF_Boundary_File", null, null, DataType.URI));
application2.addToApplicationInputs(DocumentCreatorUtils.createAppInput("WRF_Input_File", "WRF_Input_File", null, null, DataType.URI));
application2.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("WRF_Output", null, DataType.URI));
application2.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("WRF_Execution_Log", null, DataType.URI));
application2.setApplicationInterfaceId(client.registerApplicationInterface(authzToken, DEFAULT_GATEWAY, application2));
ApplicationDeploymentDescription deployment2 = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module2.getAppModuleId(), "/home1/01437/ogce/production/app_wrappers/wrf_wrapper.sh", ApplicationParallelismType.MPI, "WRF");
deployment2.setAppDeploymentId(client.registerApplicationDeployment(authzToken, DEFAULT_GATEWAY, deployment2));
return host.getComputeResourceId() + "," + application2.getApplicationInterfaceId();
}
use of org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription in project airavata by apache.
the class ApplicationInterfaceImpl method getApplicationInterfaces.
@Override
public List<ApplicationInterfaceDescription> getApplicationInterfaces(Map<String, String> filters) throws AppCatalogException {
List<ApplicationInterfaceDescription> appInterfaces = new ArrayList<ApplicationInterfaceDescription>();
try {
AppInterfaceResource resource = new AppInterfaceResource();
for (String fieldName : filters.keySet()) {
if (fieldName.equals(AppCatAbstractResource.ApplicationInterfaceConstants.APPLICATION_NAME)) {
List<AppCatalogResource> resources = resource.get(AppCatAbstractResource.ApplicationInterfaceConstants.APPLICATION_NAME, filters.get(fieldName));
appInterfaces = AppCatalogThriftConversion.getAppInterfaceDescList(resources);
} else {
logger.error("Unsupported field name for app interface.", new IllegalArgumentException());
throw new IllegalArgumentException("Unsupported field name '" + fieldName + "' for app interface.");
}
}
} catch (Exception e) {
logger.error("Error while retrieving app interface list...", e);
throw new AppCatalogException(e);
}
return appInterfaces;
}
use of org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription in project airavata by apache.
the class OrchestratorServerHandler method getModuleId.
private String getModuleId(AppCatalog appCatalog, String applicationId) throws AppCatalogException, OrchestratorException {
ApplicationInterfaceDescription applicationInterface = appCatalog.getApplicationInterface().getApplicationInterface(applicationId);
List<String> applicationModules = applicationInterface.getApplicationModules();
if (applicationModules.size() == 0) {
throw new OrchestratorException("No modules defined for application " + applicationId);
}
// AiravataAPI airavataAPI = getAiravataAPI();
String selectedModuleId = applicationModules.get(0);
return selectedModuleId;
}
use of org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription in project airavata by apache.
the class SimpleOrchestratorImpl method isArchive.
private boolean isArchive(ProcessModel processModel, String gatewayId) throws AppCatalogException {
AppCatalog appCatalog = RegistryFactory.getAppCatalog();
ApplicationInterfaceDescription appInterface = appCatalog.getApplicationInterface().getApplicationInterface(processModel.getApplicationInterfaceId());
return appInterface.isArchiveWorkingDirectory();
}
use of org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription in project airavata by apache.
the class DocumentCreatorNew method createSGEDocs.
public String createSGEDocs() throws AppCatalogException, InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(lonestarHostAddress, null, null);
host.addToHostAliases(lonestarHostAddress);
host.addToIpAddresses(lonestarHostAddress);
host.setComputeResourceId(client.registerComputeResource(authzToken, host));
ResourceJobManager resourceJobManager = DocumentCreatorUtils.createResourceJobManager(ResourceJobManagerType.UGE, "/opt/sge6.2/bin/lx24-amd64/", null, null);
SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
sshJobSubmission.setResourceJobManager(resourceJobManager);
sshJobSubmission.setSecurityProtocol(SecurityProtocol.GSI);
sshJobSubmission.setSshPort(22);
client.addSSHJobSubmissionDetails(authzToken, host.getComputeResourceId(), 1, sshJobSubmission);
SCPDataMovement scpDataMovement = new SCPDataMovement();
scpDataMovement.setSecurityProtocol(SecurityProtocol.GSI);
scpDataMovement.setSshPort(22);
client.addSCPDataMovementDetails(authzToken, host.getComputeResourceId(), 1, scpDataMovement);
ApplicationModule module = DocumentCreatorUtils.createApplicationModule("echo", "1.4", null);
module.setAppModuleId(client.registerApplicationModule(authzToken, DEFAULT_GATEWAY, module));
ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
// application.setIsEmpty(false);
application.setApplicationName("SimpleEcho4");
application.addToApplicationModules(module.getAppModuleId());
application.addToApplicationInputs(DocumentCreatorUtils.createAppInput("echo_input", "echo_input", null, null, DataType.STRING));
application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output", null, DataType.STRING));
application.setApplicationInterfaceId(client.registerApplicationInterface(authzToken, DEFAULT_GATEWAY, application));
ApplicationDeploymentDescription deployment = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(), module.getAppModuleId(), "/bin/echo", ApplicationParallelismType.SERIAL, "EchoLocal");
deployment.setAppDeploymentId(client.registerApplicationDeployment(authzToken, DEFAULT_GATEWAY, deployment));
client.addGatewayComputeResourcePreference(authzToken, getGatewayResourceProfile().getGatewayID(), host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(), "/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
return host.getComputeResourceId() + "," + application.getApplicationInterfaceId();
}
Aggregations