use of org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription in project airavata by apache.
the class DocumentCreatorUtils method createApplicationDeployment.
public static ApplicationDeploymentDescription createApplicationDeployment(String computeResourceId, String appModuleId, String executablePath, ApplicationParallelismType parallelism, String appDeploymentDescription) {
ApplicationDeploymentDescription deployment = new ApplicationDeploymentDescription();
// deployment.setIsEmpty(false);
deployment.setAppDeploymentDescription(appDeploymentDescription);
deployment.setAppModuleId(appModuleId);
deployment.setComputeHostId(computeResourceId);
deployment.setExecutablePath(executablePath);
deployment.setParallelism(parallelism);
return deployment;
}
use of org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription in project airavata by apache.
the class RegisterSampleApplicationsUtils method createApplicationDeployment.
public static ApplicationDeploymentDescription createApplicationDeployment(String appModuleId, String computeResourceId, String executablePath, ApplicationParallelismType parallelism, String appDeploymentDescription, List<CommandObject> moduleLoadCmds, List<CommandObject> preJobCmds, List<CommandObject> postJobCmds) {
ApplicationDeploymentDescription deployment = new ApplicationDeploymentDescription();
// deployment.setIsEmpty(false);
deployment.setAppDeploymentDescription(appDeploymentDescription);
deployment.setAppModuleId(appModuleId);
deployment.setComputeHostId(computeResourceId);
deployment.setExecutablePath(executablePath);
deployment.setParallelism(parallelism);
deployment.setModuleLoadCmds(moduleLoadCmds);
deployment.setPreJobCommands(preJobCmds);
deployment.setPostJobCommands(postJobCmds);
return deployment;
}
use of org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription in project airavata by apache.
the class AppDeploymentUtil method createAppDeployment.
public static ApplicationDeploymentDescription createAppDeployment(String moduleId, String computeHost, String executablePath, String appDepDescription, String moduleLoadCmd) {
ApplicationDeploymentDescription description = new ApplicationDeploymentDescription();
description.setAppModuleId(moduleId);
description.setComputeHostId(computeHost);
description.setExecutablePath(executablePath);
description.setAppDeploymentDescription(appDepDescription);
// description.setModuleLoadCmd(moduleLoadCmd);
return description;
}
use of org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription in project airavata by apache.
the class ApplicationDeploymentImpl method getApplicationDeployements.
@Override
public List<ApplicationDeploymentDescription> getApplicationDeployements(Map<String, String> filters) throws AppCatalogException {
List<ApplicationDeploymentDescription> deploymentDescriptions = new ArrayList<ApplicationDeploymentDescription>();
try {
AppDeploymentResource resource = new AppDeploymentResource();
boolean firstTry = true;
for (String fieldName : filters.keySet()) {
List<ApplicationDeploymentDescription> tmpDescriptions = new ArrayList<ApplicationDeploymentDescription>();
if (fieldName.equals(AppCatAbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID)) {
List<AppCatalogResource> resources = resource.get(AppCatAbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, filters.get(fieldName));
if (resources != null && !resources.isEmpty()) {
tmpDescriptions = AppCatalogThriftConversion.getAppDepDescList(resources);
}
} else if (fieldName.equals(AppCatAbstractResource.ApplicationDeploymentConstants.COMPUTE_HOST_ID)) {
List<AppCatalogResource> resources = resource.get(AppCatAbstractResource.ApplicationDeploymentConstants.COMPUTE_HOST_ID, filters.get(fieldName));
if (resources != null && !resources.isEmpty()) {
tmpDescriptions = AppCatalogThriftConversion.getAppDepDescList(resources);
}
} else {
logger.error("Unsupported field name for app deployment.", new IllegalArgumentException());
throw new IllegalArgumentException("Unsupported field name for app deployment.");
}
if (firstTry) {
deploymentDescriptions.addAll(tmpDescriptions);
firstTry = false;
} else {
List<String> ids = new ArrayList<String>();
for (ApplicationDeploymentDescription applicationDeploymentDescription : deploymentDescriptions) {
ids.add(applicationDeploymentDescription.getAppDeploymentId());
}
List<ApplicationDeploymentDescription> tmp2Descriptions = new ArrayList<ApplicationDeploymentDescription>();
for (ApplicationDeploymentDescription applicationDeploymentDescription : tmpDescriptions) {
if (ids.contains(applicationDeploymentDescription.getAppDeploymentId())) {
tmp2Descriptions.add(applicationDeploymentDescription);
}
}
deploymentDescriptions.clear();
deploymentDescriptions.addAll(tmp2Descriptions);
}
}
} catch (Exception e) {
logger.error("Error while retrieving app deployment list...", e);
throw new AppCatalogException(e);
}
return deploymentDescriptions;
}
use of org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription in project airavata by apache.
the class ApplicationDeploymentImpl method getAllApplicationDeployements.
@Override
public List<ApplicationDeploymentDescription> getAllApplicationDeployements(String gatewayId) throws AppCatalogException {
List<ApplicationDeploymentDescription> deploymentDescriptions = new ArrayList<ApplicationDeploymentDescription>();
try {
AppDeploymentResource resource = new AppDeploymentResource();
resource.setGatewayId(gatewayId);
List<AppCatalogResource> resources = resource.getAll();
if (resources != null && !resources.isEmpty()) {
deploymentDescriptions = AppCatalogThriftConversion.getAppDepDescList(resources);
}
} catch (Exception e) {
logger.error("Error while retrieving app deployment list...", e);
throw new AppCatalogException(e);
}
return deploymentDescriptions;
}
Aggregations