airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: fixing build errors
Date Mon, 26 Oct 2015 18:30:31 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 4db026e5e -> d96f35ac2


fixing build errors


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

Branch: refs/heads/master
Commit: d96f35ac23d9a8148fd9be949f34612fee2c89ed
Parents: 4db026e
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Mon Oct 26 14:30:20 2015 -0400
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Mon Oct 26 14:30:20 2015 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java   | 15 ++++++++-------
 .../resources/AppEnvironmentResource.java        | 18 +++++++++++++++---
 .../catalog/util/AppCatalogThriftConversion.java |  9 ++++++---
 .../airavata/app/catalog/AppDeploymentTest.java  | 19 ++++++++++---------
 .../src/test/resources/appcatalog-derby.sql      |  1 +
 .../src/test/resources/expcatalog-derby.sql      | 11 +++++++----
 6 files changed, 47 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d96f35ac/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 212c191..dbd8789 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
@@ -37,6 +37,7 @@ import org.apache.airavata.model.experiment.UserConfigurationDataModel;
 import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
 import org.apache.airavata.model.security.AuthzToken;
 import org.apache.airavata.model.status.ExperimentState;
+import org.apache.airavata.model.status.JobStatus;
 import org.apache.airavata.model.util.ExperimentModelUtil;
 import org.apache.airavata.model.util.ProjectModelUtil;
 import org.apache.airavata.model.workspace.Gateway;
@@ -53,7 +54,7 @@ import java.util.Map;
 public class CreateLaunchExperiment {
 
     //FIXME: Read from a config file
-    public static final String THRIFT_SERVER_HOST = "gw119.iu.xsede.org";
+    public static final String THRIFT_SERVER_HOST = "gw56.iu.xsede.org";
     public static final int THRIFT_SERVER_PORT = 8930;
 //	public static final String THRIFT_SERVER_HOST = "gw111.iu.xsede.org";
 //	public static final int THRIFT_SERVER_PORT = 9930;
@@ -92,12 +93,12 @@ public class CreateLaunchExperiment {
         AuthzToken token = new AuthzToken("empty_token");
         System.out.println("API version is " + airavataClient.getAPIVersion(token));
 //        registerApplications(); // run this only the first time
-//        Map<String, JobStatus> jobStatuses = airavataClient.getJobStatuses(token,
"SLM1-Echo-BR2_ae9573d1-cc1e-49e5-b59c-99ad10bd09ee");
-//        for (String jobId : jobStatuses.keySet()){
-//            JobStatus jobStatus = jobStatuses.get(jobId);
-//            System.out.println(jobId);
-//            System.out.println(jobStatus.getJobState().toString());
-//        }
+        Map<String, JobStatus> jobStatuses = airavataClient.getJobStatuses(token, "Test1_Nek_a706cdc7-8abf-4db2-b7c7-13679c714e90");
+        for (String jobId : jobStatuses.keySet()){
+            JobStatus jobStatus = jobStatuses.get(jobId);
+            System.out.println(jobId);
+            System.out.println(jobStatus.getJobState().toString());
+        }
 //        createAndLaunchExp();
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d96f35ac/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppEnvironmentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppEnvironmentResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppEnvironmentResource.java
index f94b5bf..46d16dc 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppEnvironmentResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppEnvironmentResource.java
@@ -36,12 +36,12 @@ import javax.persistence.EntityManager;
 import javax.persistence.Query;
 import java.util.*;
 
-public class AppEnvironmentResource extends AppCatAbstractResource {
+public class AppEnvironmentResource extends AppCatAbstractResource{
     private final static Logger logger = LoggerFactory.getLogger(AppEnvironmentResource.class);
     private String deploymentId;
     private String name;
     private String value;
-    private Integer order;
+    private Integer order = 0;
     private AppDeploymentResource appDeploymentResource;
 
     public String getDeploymentId() {
@@ -178,7 +178,17 @@ public class AppEnvironmentResource extends AppCatAbstractResource {
                         appEnvironmentList.add(resource);
                     }
                     Collections.sort(appEnvironmentList,
-                            (o1, o2) -> ((AppEnvironmentResource) o1).getOrder() - ((AppEnvironmentResource)
o2).getOrder());
+                            (o1, o2) -> {
+                                AppEnvironmentResource order1 = (AppEnvironmentResource)
o1;
+                                AppEnvironmentResource order2 = (AppEnvironmentResource)
o2;
+                                if (order1.getOrder() == null){
+                                    return (order2.getOrder() == null) ? 0 : -1;
+                                }
+                                if (order2.getOrder() == null) {
+                                    return 1;
+                                }
+                                return order1.getOrder().compareTo(order2.getOrder());
+                            });
                 }
             } else {
                 em.getTransaction().commit();
@@ -233,12 +243,14 @@ public class AppEnvironmentResource extends AppCatAbstractResource {
             if (existigAppEnv !=  null){
                 existigAppEnv.setValue(value);
                 existigAppEnv.setApplicationDeployment(deployment);
+                existigAppEnv.setOrder(order);
                 em.merge(existigAppEnv);
             }else {
                 AppEnvironment appEnvironment = new AppEnvironment();
                 appEnvironment.setDeploymentID(deploymentId);
                 appEnvironment.setName(name);
                 appEnvironment.setValue(value);
+                appEnvironment.setOrder(order);
                 appEnvironment.setApplicationDeployment(deployment);
                 em.persist(appEnvironment);
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d96f35ac/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
index 604cadb..a399fe2 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
@@ -706,9 +706,12 @@ public class AppCatalogThriftConversion {
             envPaths.setValue(((LibraryApendPathResource) resource).getValue());
             return envPaths;
         }else if (resource instanceof AppEnvironmentResource){
-            envPaths.setName(((AppEnvironmentResource) resource).getName());
-            envPaths.setValue(((AppEnvironmentResource) resource).getValue());
-            envPaths.setEnvPathOrder(((AppEnvironmentResource) resource).getOrder());
+            AppEnvironmentResource environmentResource = (AppEnvironmentResource) resource;
+            envPaths.setName(environmentResource.getName());
+            envPaths.setValue(environmentResource.getValue());
+            if (environmentResource.getOrder() != null){
+                envPaths.setEnvPathOrder(environmentResource.getOrder());
+            }
             return envPaths;
         }else {
             return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/d96f35ac/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppDeploymentTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppDeploymentTest.java
b/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppDeploymentTest.java
index 5ccb61d..a6b8a01 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppDeploymentTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/AppDeploymentTest.java
@@ -90,22 +90,22 @@ public class AppDeploymentTest {
         cmd1.setCommand("cmd1");
         cmd1.setCommandOrder(1);
         CommandObject cmd2 = new CommandObject();
-        cmd1.setCommand("cmd1");
-        cmd1.setCommandOrder(1);
+        cmd2.setCommand("cmd1");
+        cmd2.setCommandOrder(1);
         description.addToModuleLoadCmds(cmd1);
         description.addToModuleLoadCmds(cmd2);
 
         List<SetEnvPaths> libPrepandPaths = new ArrayList<SetEnvPaths>();
-        libPrepandPaths.add(createSetEnvPath("name1", "val1"));
-        libPrepandPaths.add(createSetEnvPath("name2", "val2"));
+        libPrepandPaths.add(createSetEnvPath("name1", "val1", 1));
+        libPrepandPaths.add(createSetEnvPath("name2", "val2", 2));
         description.setLibPrependPaths(libPrepandPaths);
         List<SetEnvPaths> libApendPaths = new ArrayList<SetEnvPaths>();
-        libApendPaths.add(createSetEnvPath("name3", "val3"));
-        libApendPaths.add(createSetEnvPath("name4", "val4"));
+        libApendPaths.add(createSetEnvPath("name3", "val3", 1));
+        libApendPaths.add(createSetEnvPath("name4", "val4", 2));
         description.setLibAppendPaths(libApendPaths);
         List<SetEnvPaths> appEvns = new ArrayList<SetEnvPaths>();
-        appEvns.add(createSetEnvPath("name5", "val5"));
-        appEvns.add(createSetEnvPath("name6", "val6"));
+        appEvns.add(createSetEnvPath("name5", "val5", 1));
+        appEvns.add(createSetEnvPath("name6", "val6", 2));
         description.setSetEnvironment(appEvns);
 
         String appDepId = appDep.addApplicationDeployment(description, ServerSettings.getDefaultUserGateway());
@@ -142,10 +142,11 @@ public class AppDeploymentTest {
         assertTrue("App interface saved successfully", app != null);
     }
 
-    public SetEnvPaths createSetEnvPath (String name, String val){
+    public SetEnvPaths createSetEnvPath (String name, String val, int order){
         SetEnvPaths setEnvPaths = new SetEnvPaths();
         setEnvPaths.setName(name);
         setEnvPaths.setValue(val);
+        setEnvPaths.setEnvPathOrder(order);
         return setEnvPaths;
 
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d96f35ac/modules/registry/registry-core/src/test/resources/appcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/resources/appcatalog-derby.sql b/modules/registry/registry-core/src/test/resources/appcatalog-derby.sql
index a572618..3d57f0e 100644
--- a/modules/registry/registry-core/src/test/resources/appcatalog-derby.sql
+++ b/modules/registry/registry-core/src/test/resources/appcatalog-derby.sql
@@ -318,6 +318,7 @@ CREATE TABLE GATEWAY_PROFILE
          GATEWAY_ID VARCHAR(255),
          CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
          UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+         CS_TOKEN VARCHAR (255),
          PRIMARY KEY(GATEWAY_ID)
 );
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d96f35ac/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
index 31aa701..215dd7e 100644
--- a/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
@@ -157,6 +157,7 @@ CREATE TABLE USER_CONFIGURATION_DATA (
   QUEUE_NAME varchar(255),
   WALL_TIME_LIMIT INT,
   TOTAL_PHYSICAL_MEMORY INT,
+  STATIC_WORKING_DIR varchar(255),
   PRIMARY KEY (EXPERIMENT_ID),
   FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 );
@@ -258,6 +259,7 @@ CREATE TABLE PROCESS_RESOURCE_SCHEDULE (
   QUEUE_NAME varchar(255),
   WALL_TIME_LIMIT INT,
   TOTAL_PHYSICAL_MEMORY INT,
+  STATIC_WORKING_DIR varchar(255),
   PRIMARY KEY (PROCESS_ID),
   FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
 );
@@ -294,19 +296,20 @@ CREATE TABLE TASK_ERROR (
   TRANSIENT_OR_PERSISTENT SMALLINT,
   ROOT_CAUSE_ERROR_ID_LIST CLOB,
   PRIMARY KEY (ERROR_ID, TASK_ID),
-  FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE);
+  FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
+);
 
 CREATE TABLE JOB (
   JOB_ID varchar(255),
   TASK_ID varchar(255),
   PROCESS_ID varchar(255),
-  JOB_DESCRIPTION CLOB,
+  JOB_DESCRIPTION CLOB NOT NULL,
   CREATION_TIME  timestamp DEFAULT '0000-00-00 00:00:00',
   COMPUTE_RESOURCE_CONSUMED varchar(255),
   JOB_NAME varchar(255),
   WORKING_DIR varchar(255),
-  STDOUT CLOB,
-  STDERR CLOB,
+  STD_OUT CLOB,
+  STD_ERR CLOB,
   EXIT_CODE INT,
   PRIMARY KEY (JOB_ID, PROCESS_ID),
   FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE


Mime
View raw message