Search in sources :

Example 16 with ApplicationDeploymentDescription

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;
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription)

Example 17 with ApplicationDeploymentDescription

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;
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription)

Example 18 with ApplicationDeploymentDescription

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;
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription)

Example 19 with ApplicationDeploymentDescription

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;
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription) ArrayList(java.util.ArrayList) AppCatalogException(org.apache.airavata.registry.cpi.AppCatalogException) AppCatalogException(org.apache.airavata.registry.cpi.AppCatalogException) ArrayList(java.util.ArrayList) List(java.util.List)

Example 20 with ApplicationDeploymentDescription

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;
}
Also used : ApplicationDeploymentDescription(org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription) AppCatalogException(org.apache.airavata.registry.cpi.AppCatalogException) ArrayList(java.util.ArrayList) AppCatalogException(org.apache.airavata.registry.cpi.AppCatalogException)

Aggregations

ApplicationDeploymentDescription (org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription)34 ApplicationModule (org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule)13 ApplicationInterfaceDescription (org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription)13 ComputeResourceDescription (org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription)13 ResourceJobManager (org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager)11 SSHJobSubmission (org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission)10 RegistryServiceException (org.apache.airavata.registry.api.exception.RegistryServiceException)5 TException (org.apache.thrift.TException)4 ArrayList (java.util.ArrayList)3 ApplicationSettingsException (org.apache.airavata.common.exception.ApplicationSettingsException)3 ApplicationParallelismType (org.apache.airavata.model.parallelism.ApplicationParallelismType)3 AiravataException (org.apache.airavata.common.exception.AiravataException)2 CommandObject (org.apache.airavata.model.appcatalog.appdeployment.CommandObject)2 JobManagerCommand (org.apache.airavata.model.appcatalog.computeresource.JobManagerCommand)2 ComputeResourcePreference (org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference)2 InputDataObjectType (org.apache.airavata.model.application.io.InputDataObjectType)2 OutputDataObjectType (org.apache.airavata.model.application.io.OutputDataObjectType)2 AppCatalogException (org.apache.airavata.registry.cpi.AppCatalogException)2 Writable (groovy.lang.Writable)1 GStringTemplateEngine (groovy.text.GStringTemplateEngine)1