You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2015/03/30 19:56:23 UTC
airavata git commit: adding app catalog related functions -
AIRAVATA-1652
Repository: airavata
Updated Branches:
refs/heads/master 17b8740c2 -> aff5d9288
adding app catalog related functions - AIRAVATA-1652
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/aff5d928
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/aff5d928
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/aff5d928
Branch: refs/heads/master
Commit: aff5d9288dfccd6b5d7dd8e22dd1f7d6e1c67b48
Parents: 17b8740
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Mon Mar 30 13:56:16 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Mon Mar 30 13:56:16 2015 -0400
----------------------------------------------------------------------
.../ApplicationRegister.java | 301 +++++++++++++++++++
.../ComputeResourceRegister.java | 157 ++++++++--
.../utils/TestFrameworkConstants.java | 27 ++
.../main/resources/test-framework.properties | 9 +-
4 files changed, 469 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/aff5d928/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
index 56a9633..b11e572 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ApplicationRegister.java
@@ -21,5 +21,306 @@
package org.apache.airavata.testsuite.multitenantedairavata;
+import org.apache.airavata.api.Airavata;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationParallelismType;
+import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
+import org.apache.airavata.model.appcatalog.appinterface.DataType;
+import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
+import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
+import org.apache.airavata.model.workspace.Gateway;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.TestFrameworkConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
public class ApplicationRegister {
+ private Airavata.Client airavata;
+ private List<Gateway> allGateways;
+ private Map<String, String> applicationInterfaceListPerGateway;
+ private Map<String, String> applicationDeployementListPerGateway;
+ private final static Logger logger = LoggerFactory.getLogger(ApplicationRegister.class);
+ private String stampedeResourceId;
+ private String trestlesResourceId;
+ private String br2ResourceId;
+
+
+ public ApplicationRegister(Airavata.Client airavata) throws Exception {
+ this.airavata = airavata;
+ allGateways = getAllGateways(airavata);
+ applicationInterfaceListPerGateway = new HashMap<String, String>();
+ applicationDeployementListPerGateway = new HashMap<String, String>();
+ Map<String, String> allComputeResourceNames = airavata.getAllComputeResourceNames();
+ for (String resourceId : allComputeResourceNames.keySet()){
+ String resourceName = allComputeResourceNames.get(resourceId);
+ if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.STAMPEDE_RESOURCE_NAME)){
+ stampedeResourceId = resourceId;
+ }else if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.TRESTLES_RESOURCE_NAME)){
+ trestlesResourceId = resourceId;
+ }else if (resourceName.equals(TestFrameworkConstants.AppcatalogConstants.BR2_RESOURCE_NAME)){
+ br2ResourceId = resourceId;
+ }
+ }
+ }
+
+ public List<Gateway> getAllGateways(Airavata.Client client) throws Exception{
+ try {
+ return client.getAllGateways();
+ }catch (Exception e){
+ logger.error("Error while getting all the gateways", e);
+ throw new Exception("Error while getting all the gateways", e);
+ }
+ }
+
+
+
+ public void addApplications () throws Exception{
+ addAmberApplication();
+ addEchoApplication();
+ addLAMMPSApplication();
+ }
+
+ public void addAmberApplication () throws Exception{
+ for (Gateway gateway : allGateways){
+ // add amber module
+ String amberModuleId = airavata.registerApplicationModule(gateway.getGatewayId(),
+ createApplicationModule(TestFrameworkConstants.AppcatalogConstants.AMBER_APP_NAME, "12.0", TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION));
+ System.out.println("Amber Module Id " + amberModuleId);
+
+ // add amber interface
+ String amberInterfaceId = registerAmberInterface(gateway, amberModuleId);
+ applicationInterfaceListPerGateway.put(amberInterfaceId, gateway.getGatewayId());
+
+ // add amber deployment
+ List<String> moduleLoadCMDs = new ArrayList<String>();
+ moduleLoadCMDs.add("module load amber");
+ String amberStampedeAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+ createApplicationDeployment(amberModuleId, stampedeResourceId,
+ "/opt/apps/intel13/mvapich2_1_9/amber/12.0/bin/sander.MPI -O", ApplicationParallelismType.MPI,
+ TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION, moduleLoadCMDs, null, null));
+
+ String amberTrestlesAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+ createApplicationDeployment(amberModuleId, trestlesResourceId,
+ "/opt/amber/bin/sander.MPI -O", ApplicationParallelismType.MPI,
+ TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION, moduleLoadCMDs, null, null));
+
+ List<String> amberModuleLoadCMDsBr2 = new ArrayList<String>();
+ amberModuleLoadCMDsBr2.add("module load amber/gnu/mpi/12");
+ amberModuleLoadCMDsBr2.add("module swap PrgEnv-cray PrgEnv-gnu");
+ String amberBr2AppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+ createApplicationDeployment(amberModuleId, br2ResourceId,
+ "/N/soft/cle4/amber/gnu/mpi/12/amber12/bin/sander.MPI -O", ApplicationParallelismType.MPI,
+ TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION, amberModuleLoadCMDsBr2, null, null));
+
+ applicationDeployementListPerGateway.put(amberStampedeAppDeployId, gateway.getGatewayId());
+ applicationDeployementListPerGateway.put(amberTrestlesAppDeployId, gateway.getGatewayId());
+ applicationDeployementListPerGateway.put(amberBr2AppDeployId, gateway.getGatewayId());
+ }
+
+ }
+
+ private String registerAmberInterface(Gateway gateway, String amberModuleId) throws org.apache.thrift.TException {
+ List<String> appModules = new ArrayList<String>();
+ appModules.add(amberModuleId);
+
+ InputDataObjectType input1 = createAppInput("Heat_Restart_File", null,
+ DataType.URI, null, 1, true, true,false, "Heating up the system equilibration stage - 02_Heat.rst", null);
+
+ InputDataObjectType input2 = createAppInput("Production_Control_File", null,
+ DataType.URI, null, 2, true, true, false, "Constant pressure and temperature for production stage - 03_Prod.in", null);
+
+ InputDataObjectType input3 = createAppInput("Parameter_Topology_File", null,
+ DataType.URI, null, 3, true, true, false, "Parameter and Topology coordinates - prmtop", null);
+
+ List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
+ applicationInputs.add(input1);
+ applicationInputs.add(input2);
+ applicationInputs.add(input3);
+
+ OutputDataObjectType output1 = createAppOutput("AMBER_Execution_Summary", "03_Prod.info", DataType.URI, true, true);
+ OutputDataObjectType output2 = createAppOutput("AMBER_Execution_log", "03_Prod.out", DataType.URI, true, true);
+ OutputDataObjectType output3 = createAppOutput("AMBER_Trajectory_file", "03_Prod.mdcrd", DataType.URI, true, true);
+ OutputDataObjectType output4 = createAppOutput("AMBER_Restart_file", "03_Prod.rst", DataType.URI, true, true);
+ OutputDataObjectType output5 = createAppOutput("STDOUT", null, DataType.STDOUT, true, false);
+ OutputDataObjectType output6 = createAppOutput("STDERR", null, DataType.STDERR, true, false);
+ List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
+ applicationOutputs.add(output1);
+ applicationOutputs.add(output2);
+ applicationOutputs.add(output3);
+ applicationOutputs.add(output4);
+ applicationOutputs.add(output5);
+ applicationOutputs.add(output6);
+
+ String amberInterfaceId = airavata.registerApplicationInterface(gateway.getGatewayId(),
+ createApplicationInterfaceDescription(TestFrameworkConstants.AppcatalogConstants.AMBER_APP_NAME, TestFrameworkConstants.AppcatalogConstants.AMBER_DESCRIPTION,
+ appModules, applicationInputs, applicationOutputs));
+ System.out.println("Amber Application Interface Id " + amberInterfaceId);
+ return amberInterfaceId;
+ }
+
+ private String registerEchoInterface(Gateway gateway, String moduleId) throws org.apache.thrift.TException {
+ List<String> appModules = new ArrayList<String>();
+ appModules.add(moduleId);
+
+ InputDataObjectType input1 = createAppInput("input_to_Echo", null,
+ DataType.STRING, null, 1, true, true,false, "Sample input to Echo", null);
+
+ List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
+ applicationInputs.add(input1);
+
+ OutputDataObjectType output1 = createAppOutput("STDOUT", null, DataType.STDOUT, true, false);
+ OutputDataObjectType output2 = createAppOutput("STDERR", null, DataType.STDERR, true, false);
+ List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
+ applicationOutputs.add(output1);
+ applicationOutputs.add(output2);
+
+ String echoInterfaceId = airavata.registerApplicationInterface(gateway.getGatewayId(),
+ createApplicationInterfaceDescription(TestFrameworkConstants.AppcatalogConstants.ECHO_NAME, TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION,
+ appModules, applicationInputs, applicationOutputs));
+ System.out.println("Echo Application Interface Id " + echoInterfaceId);
+ return echoInterfaceId;
+ }
+
+
+ public void addEchoApplication() throws Exception{
+ for (Gateway gateway : allGateways){
+ // add echo module
+ String echoModuleId = airavata.registerApplicationModule(gateway.getGatewayId(),
+ createApplicationModule(TestFrameworkConstants.AppcatalogConstants.ECHO_NAME, "1.0", TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION));
+ System.out.println("Echo Module Id " + echoModuleId);
+
+ // add amber interface
+ String echoInterfaceId = registerEchoInterface(gateway, echoModuleId);
+ applicationInterfaceListPerGateway.put(echoInterfaceId, gateway.getGatewayId());
+
+ // add amber deployment
+ String echoStampedeAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+ createApplicationDeployment(echoModuleId, stampedeResourceId,
+ "/home1/01437/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
+ TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION, null, null, null));
+
+ String echoTrestlesAppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+ createApplicationDeployment(echoModuleId, trestlesResourceId,
+ "/home/ogce/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
+ TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION, null, null, null));
+
+ String echoBr2AppDeployId = airavata.registerApplicationDeployment(gateway.getGatewayId(),
+ createApplicationDeployment(echoModuleId, br2ResourceId,
+ "/N/u/cgateway/BigRed2/production/app_wrappers/echo_wrapper.sh", ApplicationParallelismType.SERIAL,
+ TestFrameworkConstants.AppcatalogConstants.ECHO_DESCRIPTION, null, null, null));
+
+ applicationDeployementListPerGateway.put(echoStampedeAppDeployId, gateway.getGatewayId());
+ applicationDeployementListPerGateway.put(echoTrestlesAppDeployId, gateway.getGatewayId());
+ applicationDeployementListPerGateway.put(echoBr2AppDeployId, gateway.getGatewayId());
+ }
+ }
+
+ public void addLAMMPSApplication() throws Exception{
+ // add LAMPPS module
+ // add LAMPSS interface
+ // add LAMPSS deployment
+ }
+
+
+ public static ApplicationDeploymentDescription createApplicationDeployment(String appModuleId,
+ String computeResourceId,
+ String executablePath,
+ ApplicationParallelismType parallelism,
+ String appDeploymentDescription,
+ List<String> moduleLoadCmds,
+ List<String> preJobCmds,
+ List<String> postJobCmds) {
+ ApplicationDeploymentDescription deployment = new ApplicationDeploymentDescription();
+ 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;
+ }
+
+ public static ApplicationModule createApplicationModule(String appModuleName,
+ String appModuleVersion, String appModuleDescription) {
+ ApplicationModule module = new ApplicationModule();
+ module.setAppModuleDescription(appModuleDescription);
+ module.setAppModuleName(appModuleName);
+ module.setAppModuleVersion(appModuleVersion);
+ return module;
+ }
+
+ public static InputDataObjectType createAppInput (String inputName,
+ String value,
+ DataType type,
+ String applicationArgument,
+ int order,
+ boolean isRequired,
+ boolean requiredToCMD,
+ boolean stdIn,
+ String description,
+ String metadata) {
+ InputDataObjectType input = new InputDataObjectType();
+ if (inputName != null) input.setName(inputName);
+ if (value != null) input.setValue(value);
+ if (type != null) input.setType(type);
+ if (applicationArgument != null) input.setApplicationArgument(applicationArgument);
+ input.setInputOrder(order);
+ input.setIsRequired(isRequired);
+ input.setRequiredToAddedToCommandLine(requiredToCMD);
+ if (description != null) input.setUserFriendlyDescription(description);
+ input.setStandardInput(stdIn);
+ if (metadata != null) input.setMetaData(metadata);
+ return input;
+ }
+
+ public static OutputDataObjectType createAppOutput(String inputName,
+ String value,
+ DataType type,
+ boolean isRequired,
+ boolean requiredToCMD) {
+ OutputDataObjectType outputDataObjectType = new OutputDataObjectType();
+ if (inputName != null) outputDataObjectType.setName(inputName);
+ if (value != null) outputDataObjectType.setValue(value);
+ if (type != null) outputDataObjectType.setType(type);
+ outputDataObjectType.setIsRequired(isRequired);
+ outputDataObjectType.setRequiredToAddedToCommandLine(requiredToCMD);
+ return outputDataObjectType;
+ }
+
+ public static ApplicationInterfaceDescription createApplicationInterfaceDescription
+ (String applicationName, String applicationDescription, List<String> applicationModules,
+ List<InputDataObjectType> applicationInputs, List<OutputDataObjectType>applicationOutputs) {
+ ApplicationInterfaceDescription applicationInterfaceDescription = new ApplicationInterfaceDescription();
+
+ applicationInterfaceDescription.setApplicationName(applicationName);
+ if (applicationDescription != null) applicationInterfaceDescription.setApplicationDescription(applicationDescription);
+ if (applicationModules != null) applicationInterfaceDescription.setApplicationModules(applicationModules);
+ if (applicationInputs != null) applicationInterfaceDescription.setApplicationInputs(applicationInputs);
+ if (applicationOutputs != null) applicationInterfaceDescription.setApplicationOutputs(applicationOutputs);
+
+ return applicationInterfaceDescription;
+ }
+
+ public Map<String, String> getApplicationInterfaceListPerGateway() {
+ return applicationInterfaceListPerGateway;
+ }
+
+ public void setApplicationInterfaceListPerGateway(Map<String, String> applicationInterfaceListPerGateway) {
+ this.applicationInterfaceListPerGateway = applicationInterfaceListPerGateway;
+ }
+
+ public Map<String, String> getApplicationDeployementListPerGateway() {
+ return applicationDeployementListPerGateway;
+ }
+
+ public void setApplicationDeployementListPerGateway(Map<String, String> applicationDeployementListPerGateway) {
+ this.applicationDeployementListPerGateway = applicationDeployementListPerGateway;
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/aff5d928/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
index af1c779..9127fc9 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/ComputeResourceRegister.java
@@ -23,42 +23,92 @@ package org.apache.airavata.testsuite.multitenantedairavata;
import org.apache.airavata.api.Airavata;
import org.apache.airavata.model.appcatalog.computeresource.*;
+import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
+import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.PropertyFileType;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.PropertyReader;
+import org.apache.airavata.testsuite.multitenantedairavata.utils.TestFrameworkConstants;
import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
public class ComputeResourceRegister {
private Airavata.Client airavata;
private List<String> computeResourceIds;
+ private PropertyReader propertyReader;
+ private Map<String, String> loginNamesWithResourceMap;
+ private final static Logger logger = LoggerFactory.getLogger(ComputeResourceRegister.class);
- public ComputeResourceRegister(Airavata.Client airavata) {
+ public ComputeResourceRegister(Airavata.Client airavata) throws Exception {
this.airavata = airavata;
computeResourceIds = new ArrayList<String>();
+ propertyReader = new PropertyReader();
+ loginNamesWithResourceMap = getLoginNamesMap();
+
}
- public void addComputeResources () throws TException {
- // adding stampede
- String stampedeResourceId = registerComputeHost("stampede.tacc.xsede.org", "TACC Stampede Cluster",
- ResourceJobManagerType.SLURM, "push", "/usr/bin", SecurityProtocol.SSH_KEYS, 22, null);
- System.out.println("Stampede Resource Id is " + stampedeResourceId);
-
- //Register Trestles
- String trestlesResourceId = registerComputeHost("trestles.sdsc.xsede.org", "SDSC Trestles Cluster",
- ResourceJobManagerType.PBS, "push", "/opt/torque/bin/", SecurityProtocol.SSH_KEYS, 22, null);
- System.out.println("Trestles Resource Id is " + trestlesResourceId);
-
- //Register BigRedII
- String bigredResourceId = registerComputeHost("bigred2.uits.iu.edu", "IU BigRed II Cluster",
- ResourceJobManagerType.PBS, "push", "/opt/torque/torque-4.2.3.1/bin/", SecurityProtocol.SSH_KEYS, 22, "aprun -n");
- System.out.println("BigredII Resource Id is " + bigredResourceId);
-
- computeResourceIds.add(stampedeResourceId);
- computeResourceIds.add(trestlesResourceId);
- computeResourceIds.add(bigredResourceId);
+ public Map<String, String> getLoginNamesMap() throws Exception {
+ loginNamesWithResourceMap = new HashMap<String, String>();
+ List<String> loginNameList = new ArrayList<String>();
+ List<String> computerResources = new ArrayList<String>();
+ String loginNames = propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.LOGIN_USERNAME_LIST, PropertyFileType.TEST_FRAMEWORK);
+ if (loginNames != null && !loginNames.isEmpty()){
+ String[] names = loginNames.split(",");
+ loginNameList = Arrays.asList(names);
+ }
+ String clist = propertyReader.readProperty(TestFrameworkConstants.FrameworkPropertiesConstants.COMPUTE_RESOURCE_LIST, PropertyFileType.TEST_FRAMEWORK);
+ if (clist != null && !clist.isEmpty()) {
+ String[] resources = clist.split(",");
+ computerResources = Arrays.asList(resources);
+ }
+
+ if (computerResources.size() == loginNameList.size()){
+ for (int i=0; i < computerResources.size(); i++){
+ loginNamesWithResourceMap.put(computerResources.get(i), loginNameList.get(i));
+ }
+ }else {
+ logger.error("Each compute resource should have a login user name. Please check whether you specified them correctly " +
+ "in test-framework.properties files..");
+ throw new Exception("Each compute resource should have a login user name. Please check whether you specified them correctly " +
+ "in test-framework.properties files..");
+ }
+ return loginNamesWithResourceMap;
+ }
+
+ public void addComputeResources () throws Exception {
+ String stampedeResourceId = null;
+ String trestlesResourceId = null;
+ String bigredResourceId = null;
+ try {
+ for (String resourceName : loginNamesWithResourceMap.keySet()) {
+ if (resourceName.contains("stampede")) {
+ // adding stampede
+ stampedeResourceId = registerComputeHost(resourceName, "TACC Stampede Cluster",
+ ResourceJobManagerType.SLURM, "push", "/usr/bin", SecurityProtocol.SSH_KEYS, 22, null);
+ System.out.println("Stampede Resource Id is " + stampedeResourceId);
+ } else if (resourceName.contains("trestles")) {
+ //Register Trestles
+ trestlesResourceId = registerComputeHost("trestles.sdsc.xsede.org", "SDSC Trestles Cluster",
+ ResourceJobManagerType.PBS, "push", "/opt/torque/bin/", SecurityProtocol.SSH_KEYS, 22, null);
+ System.out.println("Trestles Resource Id is " + trestlesResourceId);
+ } else if (resourceName.contains("bigred2")) {
+ //Register BigRedII
+ bigredResourceId = registerComputeHost("bigred2.uits.iu.edu", "IU BigRed II Cluster",
+ ResourceJobManagerType.PBS, "push", "/opt/torque/torque-4.2.3.1/bin/", SecurityProtocol.SSH_KEYS, 22, "aprun -n");
+ System.out.println("BigredII Resource Id is " + bigredResourceId);
+ }
+ }
+ computeResourceIds.add(stampedeResourceId);
+ computeResourceIds.add(trestlesResourceId);
+ computeResourceIds.add(bigredResourceId);
+ }catch (Exception e) {
+ logger.error("Error occured while adding compute resources", e);
+ throw new Exception("Error occured while adding compute resources", e);
+ }
+
}
public String registerComputeHost(String hostName, String hostDesc,
@@ -114,4 +164,63 @@ public class ComputeResourceRegister {
resourceJobManager.setJobManagerCommands(jobManagerCommands);
return resourceJobManager;
}
+
+ public void registerGatewayResourceProfile() throws Exception{
+ try {
+ ComputeResourcePreference stampedeResourcePreferences = null;
+ ComputeResourcePreference trestlesResourcePreferences = null;
+ ComputeResourcePreference bigRedResourcePreferences = null;
+
+ for (String resourceName : loginNamesWithResourceMap.keySet()) {
+ if (resourceName.contains("stampede")) {
+ stampedeResourcePreferences = createComputeResourcePreference(resourceName, "TG-STA110014S", false, null,
+ JobSubmissionProtocol.SSH, DataMovementProtocol.SCP, "/scratch/01437/ogce/gta-work-dirs", loginNamesWithResourceMap.get(resourceName));
+ }else if (resourceName.contains("trestles")){
+ trestlesResourcePreferences = createComputeResourcePreference(resourceName, "sds128", false, null, JobSubmissionProtocol.SSH,
+ DataMovementProtocol.SCP, "/oasis/scratch/trestles/ogce/temp_project/gta-work-dirs", loginNamesWithResourceMap.get(resourceName));
+ }else if (resourceName.contains("bigred2")){
+ bigRedResourcePreferences = createComputeResourcePreference(resourceName, "TG-STA110014S", false, null, null, null,
+ "/N/dc2/scratch/cgateway/gta-work-dirs", loginNamesWithResourceMap.get(resourceName));
+ }
+ }
+
+ List<GatewayResourceProfile> allGatewayComputeResources = airavata.getAllGatewayComputeResources();
+ for (GatewayResourceProfile gatewayResourceProfile : allGatewayComputeResources){
+ gatewayResourceProfile.addToComputeResourcePreferences(stampedeResourcePreferences);
+ gatewayResourceProfile.addToComputeResourcePreferences(trestlesResourcePreferences);
+ gatewayResourceProfile.addToComputeResourcePreferences(bigRedResourcePreferences);
+ airavata.updateGatewayResourceProfile(gatewayResourceProfile.getGatewayID(), gatewayResourceProfile);
+ }
+ } catch (TException e) {
+ logger.error("Error occured while updating gateway resource profiles", e);
+ throw new Exception("Error occured while updating gateway resource profiles", e);
+ }
+ }
+
+ public static ComputeResourcePreference
+ createComputeResourcePreference(String computeResourceId, String allocationProjectNumber,
+ boolean overridebyAiravata, String preferredBatchQueue,
+ JobSubmissionProtocol preferredJobSubmissionProtocol,
+ DataMovementProtocol preferredDataMovementProtocol,
+ String scratchLocation,
+ String loginUserName) {
+ ComputeResourcePreference computeResourcePreference = new ComputeResourcePreference();
+ computeResourcePreference.setComputeResourceId(computeResourceId);
+ computeResourcePreference.setOverridebyAiravata(overridebyAiravata);
+ computeResourcePreference.setAllocationProjectNumber(allocationProjectNumber);
+ computeResourcePreference.setPreferredBatchQueue(preferredBatchQueue);
+ computeResourcePreference.setPreferredDataMovementProtocol(preferredDataMovementProtocol);
+ computeResourcePreference.setPreferredJobSubmissionProtocol(preferredJobSubmissionProtocol);
+ computeResourcePreference.setScratchLocation(scratchLocation);
+ computeResourcePreference.setLoginUserName(loginUserName);
+ return computeResourcePreference;
+ }
+
+ public List<String> getComputeResourceIds() {
+ return computeResourceIds;
+ }
+
+ public void setComputeResourceIds(List<String> computeResourceIds) {
+ this.computeResourceIds = computeResourceIds;
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/aff5d928/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
index 557f95c..c4bf8e4 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/java/org/apache/airavata/testsuite/multitenantedairavata/utils/TestFrameworkConstants.java
@@ -53,7 +53,34 @@ public class TestFrameworkConstants {
public static final class AppcatalogConstants {
public static final String AMBER_APP_NAME = "amber_sander";
+ public static final String ECHO_NAME = "Echo";
+ public static final String ESPRESSO_NAME = "ESPRESSO";
+ public static final String GROMACS_NAME = "GROMACS";
+ public static final String LAMMPS_NAME = "LAMMPS";
+ public static final String NWCHEM_NAME = "NWChem";
+ public static final String TRINITY_NAME = "Trinity";
+ public static final String WRF_NAME = "WRF";
+ public static final String PHASTA_NAME = "PHASTA";
+ public static final String TINKER_MONTE_NAME = "TinkerMonte";
+ public static final String GAUSSIAN_NAME = "Gaussian";
+ public static final String GAMESS_NAME = "Gamess";
+ public static final String ECHO_DESCRIPTION = "A Simple Echo Application";
+ public static final String AMBER_DESCRIPTION = "Assisted Model Building with Energy Refinement MD Package";
+ public static final String ESPRESSO_DESCRIPTION = "Nanoscale electronic-structure calculations and materials modeling";
+ public static final String GROMACS_DESCRIPTION = "GROMACS Molecular Dynamics Package";
+ public static final String LAMMPS_DESCRIPTION = "Large-scale Atomic/Molecular Massively Parallel Simulator";
+ public static final String NWCHEM_DESCRIPTION = "Ab initio computational chemistry software package";
+ public static final String TRINITY_DESCRPTION = "de novo reconstruction of transcriptomes from RNA-seq data";
+ public static final String WRF_DESCRIPTION = "Weather Research and Forecasting";
+ public static final String PHASTA_DESCRIPTION = "Computational fluid dynamics solver";
+ public static final String TINKER_MONTE_DESCRIPTION = "Grid Chem Tinker Monte Application";
+ public static final String GAUSSIAN_DESCRIPTION = "Grid Chem Gaussian Application";
+ public static final String GAMESS_DESCRIPTION = "A Gamess Application";
+
+ public static final String STAMPEDE_RESOURCE_NAME = "stampede.tacc.xsede.org";
+ public static final String TRESTLES_RESOURCE_NAME = "trestles.sdsc.xsede.org";
+ public static final String BR2_RESOURCE_NAME = "bigred2.uits.iu.edu";
}
public static final class CredentialStoreConstants {
http://git-wip-us.apache.org/repos/asf/airavata/blob/aff5d928/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
----------------------------------------------------------------------
diff --git a/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties b/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
index e7056ac..fe83905 100644
--- a/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
+++ b/modules/test-suite/multi-tenanted-airavata/src/main/resources/test-framework.properties
@@ -21,7 +21,7 @@
# Test environment related properties
numberof.gateways=10
users.per.gateway=10
-compute.resoure.list=trestles,stampede,br2
+compute.resoure.list=trestles.sdsc.xsede.org,stampede.tacc.xsede.org,bigred2.uits.iu.edu
login.usernames=ogce,ogce,cgateway
application.list=amber_sander,echo
ssh.pub.key.location=ssh_key_location
@@ -29,3 +29,10 @@ ssh.private.key.location=ssh_key_location
ssh.password=pwd
ssh.username=username
+# Application Inputs
+# Amber input file locations
+02_Heat.rst_location=/a/b/c/02_Heat.rst
+03_Prod.in_location=/a/b/c/03_Prod.in
+prmtop_location=/a/b/c/prmtop
+
+