airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: get remote data location till we have data storage preferences saved
Date Wed, 21 Oct 2015 18:04:15 GMT
Repository: airavata
Updated Branches:
  refs/heads/orchestratorTaskBreakdown d071d8ed3 -> 80ac14c35


get remote data location till we have data storage preferences saved


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

Branch: refs/heads/orchestratorTaskBreakdown
Commit: 80ac14c356ea135a741261a08a85dfc8843bcc78
Parents: d071d8e
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Wed Oct 21 14:04:06 2015 -0400
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Wed Oct 21 14:04:06 2015 -0400

----------------------------------------------------------------------
 .../airavata/common/utils/ServerSettings.java   | 10 ++++++++
 .../main/resources/airavata-server.properties   |  3 +++
 .../cpi/impl/SimpleOrchestratorImpl.java        | 24 ++++++++++++--------
 3 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/80ac14c3/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
----------------------------------------------------------------------
diff --git a/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
b/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
index becad00..6196c07 100644
--- a/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
+++ b/modules/commons/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
@@ -36,6 +36,8 @@ public class ServerSettings extends ApplicationSettings {
     private static final String DEFAULT_USER_PASSWORD = "default.registry.password";
     private static final String DEFAULT_USER_GATEWAY = "default.registry.gateway";
     private static final String LOCAL_DATA_DIR = "local.data.dir";
+    private static final String REMOTE_DATA_DIR = "remote.data.dir";
+    private static final String CLIENT_HOST_NAME = "client.host.name";
 
     public static final String IP = "ip";
 
@@ -378,4 +380,12 @@ public class ServerSettings extends ApplicationSettings {
     public static String getLocalDataLocation() {
         return getSetting(LOCAL_DATA_DIR, System.getProperty("java.io.tmpdir"));
     }
+
+    public static String getRemoteDataLocation() throws ApplicationSettingsException {
+        return getSetting(LOCAL_DATA_DIR);
+    }
+
+    public static String getClientHostName() throws ApplicationSettingsException {
+        return getSetting(CLIENT_HOST_NAME);
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/80ac14c3/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/airavata-server.properties b/modules/configuration/server/src/main/resources/airavata-server.properties
index cb4d93d..cf36a39 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -50,6 +50,9 @@ default.registry.password.hash.method=SHA
 default.registry.gateway=php_reference_gateway
 # this is the path used to store intermediate data, this will be removed with third party
file transfer implementation.
 local.data.dir=/home/airavata/experimentData/
+# FIXME : These properties need to be removed once we start saving data transfer preferences
+remote.data.dir=/var/www/portal/experimentData/
+client.host.name=gw75.iu.xsede.org
 
 #ip=127.0.0.1
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/80ac14c3/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
index 92bd991..2bba23f 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java
@@ -20,7 +20,9 @@
 */
 package org.apache.airavata.orchestrator.cpi.impl;
 
+import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.common.utils.ThriftUtils;
 import org.apache.airavata.gfac.core.task.TaskException;
 import org.apache.airavata.model.appcatalog.computeresource.*;
@@ -388,11 +390,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
             for (OutputDataObjectType processOutput : processOutputs) {
                 DataType type = processOutput.getType();
                 switch (type) {
-                    case STDERR:
-                        break;
-                    case STDOUT:
-                        break;
-                    case URI:
+                    case URI: case STDOUT : case STDERR:
                         try {
                             TaskModel outputDataStagingTask = getOutputDataStagingTask(processModel,
processOutput, gatewayId);
                             String taskId = (String) orchestratorContext.getRegistry().getExperimentCatalog().add(ExpCatChildDataType.TASK,
outputDataStagingTask,
@@ -400,7 +398,9 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
                             outputDataStagingTask.setTaskId(taskId);
                             dataStagingTaskIds.add(outputDataStagingTask.getTaskId());
                         } catch (TException e) {
-                            throw new RegistryException("Error while serializing data staging
sub task model");
+                            throw new RegistryException("Error while serializing data staging
sub task model", e);
+                        } catch (ApplicationSettingsException e) {
+                            throw new RegistryException("Error while reading airavata server
properties", e);
                         }
                         break;
                     default:
@@ -485,7 +485,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
         return taskModel;
     }
 
-    private TaskModel getOutputDataStagingTask(ProcessModel processModel, OutputDataObjectType
processOutput, String gatewayId) throws RegistryException, TException {
+    private TaskModel getOutputDataStagingTask(ProcessModel processModel, OutputDataObjectType
processOutput, String gatewayId) throws RegistryException, TException, ApplicationSettingsException
{
         try {
 
             // create new task model for this task
@@ -497,11 +497,15 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
             taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
             taskModel.setTaskStatus(taskStatus);
             taskModel.setTaskType(TaskTypes.DATA_STAGING);
-            // create data staging sub task model
+            // We assume output location is set at data storage preference
             DataStoragePreference dataStoragePreference = OrchestratorUtils.getDateStoragePreference(orchestratorContext,
processModel, gatewayId);
             ComputeResourcePreference computeResourcePreference = OrchestratorUtils.getComputeResourcePreference(orchestratorContext,
processModel, gatewayId);
             ComputeResourceDescription computeResource = orchestratorContext.getRegistry().getAppCatalog().getComputeResource().getComputeResource(processModel.getComputeResourceId());
-            String remoteOutputDir = dataStoragePreference.getFileSystemRootLocation();
+            // FIXME : need to fix once we start saving data storage preferences
+            String remoteOutputDir = ServerSettings.getRemoteDataLocation();
+            if (dataStoragePreference != null){
+                remoteOutputDir = dataStoragePreference.getFileSystemRootLocation();
+            }
             remoteOutputDir = remoteOutputDir.endsWith("/") ? remoteOutputDir : remoteOutputDir
+ "/";
             DataStagingTaskModel submodel = new DataStagingTaskModel();
             submodel.setType(DataStageType.OUPUT);
@@ -523,6 +527,8 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
             return taskModel;
         } catch (AppCatalogException | TaskException e) {
            throw new RegistryException("Error occurred while retrieving data movement from
app catalog", e);
+        } catch (ApplicationSettingsException e) {
+            throw new ApplicationSettingsException("Error occurred while reading airavata-server.properties",
e);
         }
     }
 


Mime
View raw message