airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: fixing issues
Date Tue, 08 Jul 2014 17:05:43 GMT
Repository: airavata
Updated Branches:
  refs/heads/master d1d3fae86 -> 40198cc57


fixing issues


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/40198cc5
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/40198cc5
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/40198cc5

Branch: refs/heads/master
Commit: 40198cc57cbfdb9c9e8d7e692b6ebe04988c8c2f
Parents: d1d3fae
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Tue Jul 8 13:05:41 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Tue Jul 8 13:05:41 2014 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  | 23 +++++++----
 .../client/tools/DocumentCreatorNew.java        | 42 ++++++++++++++++----
 2 files changed, 50 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/40198cc5/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 45120c6..9cc3e12 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -58,6 +58,12 @@ public class CreateLaunchExperiment {
     private static final String DEFAULT_USER = "default.registry.user";
     private static final String DEFAULT_GATEWAY = "default.registry.gateway";
     private static Airavata.Client client;
+    private static String localHostAppId;
+    private static String sshHostAppId;
+    private static String pbsEchoAppId;
+    private static String pbsWRFAppId;
+    private static String slurmAppId;
+    private static String sgeAppId;
     public static void main(String[] args) {
         try {
             AiravataUtils.setExecutionAsClient();
@@ -190,12 +196,13 @@ public class CreateLaunchExperiment {
         try {
         	DocumentCreatorNew documentCreator = new DocumentCreatorNew(client);
 //            DocumentCreator documentCreator = new DocumentCreator(getAiravataAPI());
-            documentCreator.createLocalHostDocs();
-            documentCreator.createSSHHostDocs();
+            localHostAppId = documentCreator.createLocalHostDocs();
+            sshHostAppId = documentCreator.createSSHHostDocs();
 //            documentCreator.createGramDocs();
-            documentCreator.createPBSDocsForOGCE();
-            documentCreator.createSlurmDocs();
-            documentCreator.createSGEDocs();
+            pbsEchoAppId =documentCreator.createPBSDocsForOGCE_Echo();
+            pbsWRFAppId =documentCreator.createPBSDocsForOGCE_WRF();
+            slurmAppId = documentCreator.createSlurmDocs();
+            sgeAppId = documentCreator.createSGEDocs();
 //            documentCreator.createEchoHostDocs();
 //            documentCreator.createBigRedDocs();
         } catch (Exception e) {
@@ -368,7 +375,7 @@ public class CreateLaunchExperiment {
             String projectId = client.createProject(project);
 
             Experiment simpleExperiment =
-                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment",
"Echo Test", "Echo", exInputs);
+                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment",
"Echo Test", localHostAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
 
             ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("localhost",
1, 1, 1, "normal", 0, 0, 1, "");
@@ -413,7 +420,7 @@ public class CreateLaunchExperiment {
             String projectId = client.createProject(project);
 
             Experiment simpleExperiment =
-                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "sshEchoExperiment",
"SSHEcho1", "SSHEcho1", exInputs);
+                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "sshEchoExperiment",
"SSHEcho1", sshHostAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
 
             ComputationalResourceScheduling scheduling = ExperimentModelUtil.createComputationResourceScheduling("gw111.iu.xsede.org",
1, 1, 1, "normal", 0, 0, 1, "sds128");
@@ -459,7 +466,7 @@ public class CreateLaunchExperiment {
             String projectId = client.createProject(project);
 
             Experiment simpleExperiment =
-                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment",
"SimpleEcho3", "SimpleEcho3", exInputs);
+                    ExperimentModelUtil.createSimpleExperiment(projectId, "admin", "echoExperiment",
"SimpleEcho3", slurmAppId, exInputs);
             simpleExperiment.setExperimentOutputs(exOut);
 
             ComputationalResourceScheduling scheduling =

http://git-wip-us.apache.org/repos/asf/airavata/blob/40198cc5/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreatorNew.java
----------------------------------------------------------------------
diff --git a/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreatorNew.java
b/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreatorNew.java
index eceac93..f6a4f26 100644
--- a/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreatorNew.java
+++ b/modules/airavata-client/src/main/java/org/apache/airavata/client/tools/DocumentCreatorNew.java
@@ -61,7 +61,7 @@ public class DocumentCreatorNew {
     	this.client = client;
 	}
 
-    public void createLocalHostDocs() throws AppCatalogException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
+    public String createLocalHostDocs() throws AppCatalogException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
     	//Define compute resource host
     	ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(
     			"localhost", new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})),
new HashSet<String>(Arrays.asList(new String[]{"127.0.0.1"})));
@@ -105,6 +105,7 @@ public class DocumentCreatorNew {
         String gatewayId = client.registerGatewayResourceProfile(gatewayResourceProfile);
         gatewayResourceProfile.setGatewayID(gatewayId);
         client.addGatewayComputeResourcePreference(gatewayResourceProfile.getGatewayID(),
host.getComputeResourceId(), computeResourcePreference);
+        return application.getApplicationInterfaceId();
     }
 
     private GatewayResourceProfile getGatewayResourceProfile() throws InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
@@ -124,7 +125,7 @@ public class DocumentCreatorNew {
         return gatewayResourceProfile;
 
     }
-    public void createSSHHostDocs() throws AppCatalogException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
+    public String createSSHHostDocs() throws AppCatalogException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
         ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription("gw111.iu.xsede.org",
null, null);
         host.addToIpAddresses("gw111.iu.xsede.org");
         host.addToHostAliases("gw111.iu.xsede.org");
@@ -157,6 +158,7 @@ public class DocumentCreatorNew {
         application.addToApplicationOutputs(DocumentCreatorUtils.createAppOutput("echo_output",
null, DataType.STRING));
         client.registerApplicationInterface(application);
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(),
host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(),
"/tmp", null, false, null, null, null));
+        return application.getApplicationInterfaceId();
     }
     
 //
@@ -251,7 +253,7 @@ public class DocumentCreatorNew {
 ////        }
 //    }
 //
-    public void createPBSDocsForOGCE() throws AppCatalogException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
+    public String createPBSDocsForOGCE_Echo() throws AppCatalogException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
     	
     	ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(trestleshpcHostAddress,
null, null);
     	host.addToIpAddresses(trestleshpcHostAddress);
@@ -273,7 +275,7 @@ public class DocumentCreatorNew {
     	
         ApplicationModule module1 = DocumentCreatorUtils.createApplicationModule("echo",
"1.2", null);
         module1.setAppModuleId(client.registerApplicationModule(module1));
-        
+
     	ApplicationInterfaceDescription application = new ApplicationInterfaceDescription();
 //    	application.setIsEmpty(false);
         application.setApplicationName("SimpleEcho2");
@@ -287,7 +289,30 @@ public class DocumentCreatorNew {
         deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
         
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(),
host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(),
"/oasis/scratch/trestles/ogce/temp_project/", "sds128", false, null, null, null));
+        return application.getApplicationInterfaceId();
+    }
+
+    public String createPBSDocsForOGCE_WRF() throws AppCatalogException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
 
+        ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(trestleshpcHostAddress,
null, null);
+        host.addToIpAddresses(trestleshpcHostAddress);
+        host.addToHostAliases(trestleshpcHostAddress);
+        host.setComputeResourceId(client.registerComputeResource(host));
+
+        SSHJobSubmission sshJobSubmission = new SSHJobSubmission();
+        ResourceJobManager resourceJobManager = DocumentCreatorUtils.createResourceJobManager(ResourceJobManagerType.PBS,
"/opt/torque/bin/", null, null);
+        sshJobSubmission.setResourceJobManager(resourceJobManager);
+        sshJobSubmission.setSecurityProtocol(SecurityProtocol.GSI);
+        sshJobSubmission.setSshPort(22);
+        client.addSSHJobSubmissionDetails(host.getComputeResourceId(), 1, sshJobSubmission);
+
+        SCPDataMovement scpDataMovement = new SCPDataMovement();
+        scpDataMovement.setSecurityProtocol(SecurityProtocol.GSI);
+        scpDataMovement.setSshPort(22);
+
+        client.addSCPDataMovementDetails(host.getComputeResourceId(), 1, scpDataMovement);
+
+        client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(),
host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(),
"/oasis/scratch/trestles/ogce/temp_project/", "sds128", false, null, null, null));
 
         ApplicationModule module2 = DocumentCreatorUtils.createApplicationModule("wrf", "1.0.0",
null);
         module2.setAppModuleId(client.registerApplicationModule(module2));
@@ -305,9 +330,10 @@ public class DocumentCreatorNew {
 
         ApplicationDeploymentDescription deployment2 = DocumentCreatorUtils.createApplicationDeployment(host.getComputeResourceId(),
module2.getAppModuleId(), "/home/ogce/apps/wrf_wrapper.sh", ApplicationParallelismType.MPI,"WRF");
         deployment2.setAppDeploymentId(client.registerApplicationDeployment(deployment2));
+        return application2.getApplicationInterfaceId();
     }
-    
-    public void createSlurmDocs() throws AppCatalogException, InvalidRequestException, AiravataClientException,
AiravataSystemException, TException {
+
+    public String createSlurmDocs() throws AppCatalogException, InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
     	ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(stampedeHostAddress,
null, null);
     	host.addToHostAliases(stampedeHostAddress);
     	host.addToIpAddresses(stampedeHostAddress);
@@ -340,9 +366,10 @@ public class DocumentCreatorNew {
         deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
         
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(),
host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(),
"/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
+        return application.getApplicationInterfaceId();
     }
 
-    public void createSGEDocs() throws AppCatalogException, InvalidRequestException, AiravataClientException,
AiravataSystemException, TException {
+    public String createSGEDocs() throws AppCatalogException, InvalidRequestException, AiravataClientException,
AiravataSystemException, TException {
     	ComputeResourceDescription host = DocumentCreatorUtils.createComputeResourceDescription(lonestarHostAddress,
null, null);
     	host.addToHostAliases(lonestarHostAddress);
     	host.addToIpAddresses(lonestarHostAddress);
@@ -376,6 +403,7 @@ public class DocumentCreatorNew {
         deployment.setAppDeploymentId(client.registerApplicationDeployment(deployment));
         
         client.addGatewayComputeResourcePreference(getGatewayResourceProfile().getGatewayID(),
host.getComputeResourceId(), DocumentCreatorUtils.createComputeResourcePreference(host.getComputeResourceId(),
"/home1/01437/ogce", "TG-STA110014S", false, null, null, null));
+        return application.getApplicationInterfaceId();
     }
 
 //	public void createEchoHostDocs() {


Mime
View raw message