airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: read intermediat data dir path from airavata properties file
Date Wed, 26 Aug 2015 18:39:12 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 3d3999a05 -> fdcf2c96a


read intermediat data dir path from airavata properties file


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

Branch: refs/heads/master
Commit: fdcf2c96adc44cd67c6dc8f106f50ba3cc40b828
Parents: 3d3999a
Author: Shameera Rathanyaka <shameerainfo@gmail.com>
Authored: Wed Aug 26 14:39:00 2015 -0400
Committer: Shameera Rathanyaka <shameerainfo@gmail.com>
Committed: Wed Aug 26 14:39:00 2015 -0400

----------------------------------------------------------------------
 .../airavata/common/utils/ServerSettings.java   |  6 +++---
 .../main/resources/airavata-server.properties   |  3 ++-
 .../test/resources/airavata-server.properties   |  2 ++
 .../main/resources/airavata-server.properties   |  2 ++
 .../airavata/gfac/impl/GFacEngineImpl.java      |  4 +---
 .../impl/task/AdvancedSCPDataStageTask.java     | 21 ++++++++------------
 6 files changed, 18 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/fdcf2c96/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 b47a939..783353e 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
@@ -35,7 +35,7 @@ public class ServerSettings extends ApplicationSettings {
     private static final String DEFAULT_USER = "default.registry.user";
     private static final String DEFAULT_USER_PASSWORD = "default.registry.password";
     private static final String DEFAULT_USER_GATEWAY = "default.registry.gateway";
-    private static final String OUTPUT_LOCATION = "out.location";
+    private static final String LOCAL_DATA_DIR = "local.data.dir";
 
     private static final String SERVER_CONTEXT_ROOT = "server.context-root";
     public static final String IP = "ip";
@@ -369,7 +369,7 @@ public class ServerSettings extends ApplicationSettings {
         return Integer.valueOf(getSetting(Constants.IN_MEMORY_CACHE_SIZE));
     }
 
-    public static String getOutputLocation() {
-        return getSetting(OUTPUT_LOCATION, System.getProperty("java.io.tmpdir"));
+    public static String getLocalDataLocation() {
+        return getSetting(LOCAL_DATA_DIR, System.getProperty("java.io.tmpdir"));
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdcf2c96/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 d45e3d9..34648a3 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -48,7 +48,8 @@ default.registry.user=admin
 default.registry.password=admin
 default.registry.password.hash.method=SHA
 default.registry.gateway=php_reference_gateway
-output.location=/var/www/portal/experimentData/
+# 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/
 
 #ip=127.0.0.1
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdcf2c96/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties
b/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties
index 197d4e4..1f3afd6 100644
--- a/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties
+++ b/modules/credential-store/credential-store-service/src/test/resources/airavata-server.properties
@@ -47,6 +47,8 @@ default.registry.user=admin
 default.registry.password=admin
 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/
 
 #ip=127.0.0.1
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdcf2c96/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
b/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
index 580f598..c9710d6 100644
--- a/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
+++ b/modules/credential-store/credential-store-webapp/src/main/resources/airavata-server.properties
@@ -47,6 +47,8 @@ default.registry.user=admin
 default.registry.password=admin
 default.registry.password.hash.method=SHA
 default.registry.gateway=default
+# 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/
 
 #ip=127.0.0.1
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdcf2c96/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
index b97915c..d66d58d 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
@@ -32,7 +32,6 @@ import org.apache.airavata.gfac.core.context.ProcessContext;
 import org.apache.airavata.gfac.core.context.TaskContext;
 import org.apache.airavata.gfac.core.task.JobSubmissionTask;
 import org.apache.airavata.gfac.core.task.Task;
-import org.apache.airavata.gfac.core.task.TaskException;
 import org.apache.airavata.gfac.impl.task.SSHEnvironmentSetupTask;
 import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionInterface;
 import org.apache.airavata.model.appcatalog.computeresource.JobSubmissionProtocol;
@@ -63,7 +62,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.File;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Date;
@@ -105,7 +103,7 @@ public class GFacEngineImpl implements GFacEngine {
 			processContext.setRemoteCluster(Factory.getRemoteCluster(processContext.getJobSubmissionProtocol(),
 					processContext.getComputeResourceId(), processContext.getResourceJobManager()));
 
-			String inputPath = ServerSettings.getOutputLocation();
+			String inputPath = ServerSettings.getLocalDataLocation();
 			if (inputPath != null) {
 				processContext.setLocalWorkingDir((inputPath.endsWith("/") ? inputPath : inputPath +
"/") +
 						processContext.getProcessId());

http://git-wip-us.apache.org/repos/asf/airavata/blob/fdcf2c96/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
index 4046d36..1f05941 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/AdvancedSCPDataStageTask.java
@@ -27,7 +27,6 @@ import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.common.utils.ThriftUtils;
 import org.apache.airavata.credential.store.credential.Credential;
-import org.apache.airavata.credential.store.credential.impl.password.PasswordCredential;
 import org.apache.airavata.credential.store.credential.impl.ssh.SSHCredential;
 import org.apache.airavata.credential.store.store.CredentialReader;
 import org.apache.airavata.credential.store.store.CredentialStoreException;
@@ -103,16 +102,16 @@ public class AdvancedSCPDataStageTask implements Task{
             URI sourceURI = new URI(subTaskModel.getSource());
             URI destinationURI = new URI(subTaskModel.getDestination());
 
-            File tempOutputDir = getLocalDir(taskContext);
-            if (!tempOutputDir.exists()) {
-                if (!tempOutputDir.mkdirs()) {
+            File templocalDataDir = getLocalDataDir(taskContext);
+            if (!templocalDataDir.exists()) {
+                if (!templocalDataDir.mkdirs()) {
                     // failed to create temp output location
                 }
             }
 
             String fileName = sourceURI.getPath().substring(sourceURI.getPath().lastIndexOf(File.separator)
+ 1,
                     sourceURI.getPath().length());
-            String filePath = tempOutputDir + File.separator + fileName;
+            String filePath = templocalDataDir + File.separator + fileName;
 
             ServerInfo serverInfo = new ServerInfo(userName, hostName, DEFAULT_SSH_PORT);
             Session sshSession = Factory.getSSHSession(authenticationInfo, serverInfo);
@@ -214,14 +213,10 @@ public class AdvancedSCPDataStageTask implements Task{
 		SSHUtils.scpTo(filePath, destinationURI.getPath(), sshSession);
 	}
 
-	private File getLocalDir(TaskContext taskContext) {
-		if (inputPath == null) {
-			return new File(ServerSettings.getOutputLocation() + taskContext.getParentProcessContext()
-					.getProcessId());
-		} else {
-			inputPath = (inputPath.endsWith(File.separator) ? inputPath : inputPath + File.separator);
-			return new File(inputPath + taskContext.getParentProcessContext().getProcessId());
-		}
+	private File getLocalDataDir(TaskContext taskContext) {
+		String outputPath = ServerSettings.getLocalDataLocation();
+		outputPath = (outputPath.endsWith(File.separator) ? outputPath : outputPath + File.separator);
+		return new File(outputPath + taskContext.getParentProcessContext() .getProcessId());
 	}
 
 	@Override


Mime
View raw message