airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msme...@apache.org
Subject airavata git commit: no access denial errors; output data staging is using task details
Date Thu, 11 Jun 2015 14:55:25 GMT
Repository: airavata
Updated Branches:
  refs/heads/airavata-0.15-release-branch dce8796bf -> 2b1e125c8


no access denial errors; output data staging is using task details

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

Branch: refs/heads/airavata-0.15-release-branch
Commit: 2b1e125c8885a1b71267e1cf6e9c5e0a42683a2b
Parents: dce8796
Author: msmemon <shahbaz.memon@gmail.com>
Authored: Thu Jun 11 16:55:10 2015 +0200
Committer: msmemon <shahbaz.memon@gmail.com>
Committed: Thu Jun 11 16:55:10 2015 +0200

----------------------------------------------------------------------
 .../gfac/bes/provider/impl/BESProvider.java     |  7 +-
 .../bes/security/UNICORESecurityContext.java    |  5 +-
 .../gfac/bes/utils/DataTransferrer.java         | 68 ++++++++++++++------
 .../gfac/bes/utils/UASDataStagingProcessor.java | 12 +++-
 .../airavata/gfac/bes/utils/URIUtils.java       |  3 +-
 5 files changed, 67 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1e125c/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
index 299e6ef..40baa22 100644
--- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
+++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/provider/impl/BESProvider.java
@@ -132,14 +132,17 @@ public class BESProvider extends AbstractProvider implements GFacProvider,
             }
             CreateActivityDocument cad = CreateActivityDocument.Factory.newInstance();
             JobDefinitionDocument jobDefDoc = JobDefinitionDocument.Factory.newInstance();
-
+            
             // create storage
             StorageCreator storageCreator = new StorageCreator(secProperties, factoryUrl,
5, null);
             sc = storageCreator.createStorage();
 
             JobDefinitionType jobDefinition = JSDLGenerator.buildJSDLInstance(jobExecutionContext,
sc.getUrl()).getJobDefinition();
             cad.addNewCreateActivity().addNewActivityDocument().setJobDefinition(jobDefinition);
-            log.info("JSDL" + jobDefDoc.toString());
+            
+            log.debug("Submitted JSDL: " + jobDefDoc.getJobDefinition().getJobDescription());
+            
+            
 
             // upload files if any
             DataTransferrer dt = new DataTransferrer(jobExecutionContext, sc);

http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1e125c/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/UNICORESecurityContext.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/UNICORESecurityContext.java
b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/UNICORESecurityContext.java
index f2ec94e..e82beeb 100644
--- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/UNICORESecurityContext.java
+++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/security/UNICORESecurityContext.java
@@ -89,14 +89,13 @@ public class UNICORESecurityContext extends X509SecurityContext {
 			boolean genCert = userData.isGenerateCert();
 				if(genCert) {
 					String userDN = userData.getUserDN();
-					if (userDN == null && "".equals(userDN)){
-						log.warn("Cannot generate cert, falling back to container configured MyProxy credentials");
+					if (userDN == null || "".equals(userDN)){
+						log.warn("Cannot generate cert, falling back to GFAC configured MyProxy credentials");
 						return getDefaultConfiguration(enableMessageLogging);
 					}
 					else {
 						log.info("Generating X.509 certificate for: "+userDN);
 						try {
-							
 							String caCertPath = ServerSettings.getSetting(BESConstants.PROP_CA_CERT_PATH, "");
 							String caKeyPath = ServerSettings.getSetting(BESConstants.PROP_CA_KEY_PATH, "");
 							String caKeyPass = ServerSettings.getSetting(BESConstants.PROP_CA_KEY_PASS, "");

http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1e125c/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/DataTransferrer.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/DataTransferrer.java
b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/DataTransferrer.java
index d70e4b1..d94cb20 100644
--- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/DataTransferrer.java
+++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/DataTransferrer.java
@@ -95,26 +95,56 @@ public class DataTransferrer {
 			file.mkdirs();	
 		}
 
-		Map<String, Object> output = jobContext.getOutMessageContext().getParameters();
-        Set<String> keys = output.keySet();
-        
-		for (String outPrm : keys) {
-			OutputDataObjectType actualParameter = (OutputDataObjectType) output.get(outPrm);
-				if (DataType.STDERR == actualParameter.getType()) continue;
-				if (DataType.STDOUT == actualParameter.getType()) continue;
-				
-				String value = actualParameter.getValue();
-				FileDownloader fileDownloader = new FileDownloader(value,downloadLocation, Mode.overwrite);
-				try {
-					fileDownloader.perform(storageClient);
-					String outputPath = downloadLocation + File.separator + value.substring(value.lastIndexOf('/')+1);
-					actualParameter.setValue(outputPath);
-					actualParameter.setType(DataType.URI);
-					jobContext.addOutputFile(outputPath);
-				} catch (Exception e) {
-					throw new GFacProviderException(e.getLocalizedMessage(),e);
+//		Map<String, Object> output = jobContext.getOutMessageContext().getParameters();
+//        Set<String> keys = output.keySet();
+//        
+//		for (String outPrm : keys) {
+//			OutputDataObjectType actualParameter = (OutputDataObjectType) output.get(outPrm);
+//				if (DataType.STDERR == actualParameter.getType() ||
+//					DataType.STDOUT == actualParameter.getType() ||
+//					DataType.URI == actualParameter.getType())  {
+//					continue;
+//				}
+//				
+//				String value = actualParameter.getValue();
+//				FileDownloader fileDownloader = new FileDownloader(value,downloadLocation, Mode.overwrite);
+//				try {
+//					fileDownloader.perform(storageClient);
+//					String outputPath = downloadLocation + File.separator + value.substring(value.lastIndexOf('/')+1);
+//					actualParameter.setValue(outputPath);
+//					actualParameter.setType(DataType.URI);
+//					jobContext.addOutputFile(outputPath);
+//				} catch (Exception e) {
+//					throw new GFacProviderException(e.getLocalizedMessage(),e);
+//				}
+//		}
+		
+		List<OutputDataObjectType> applicationOutputs = jobContext.getTaskData().getApplicationOutputs();
+		 if (applicationOutputs != null && !applicationOutputs.isEmpty()){
+            for (OutputDataObjectType output : applicationOutputs){
+				if("".equals(output.getValue()) || output.getValue() == null) {
+					continue;
 				}
-		}
+
+	           	if(output.getType().equals(DataType.STRING)) {
+					String value = output.getValue();
+					FileDownloader fileDownloader = new FileDownloader(value,downloadLocation, Mode.overwrite);
+					try {
+						fileDownloader.perform(storageClient);
+						String outputPath = downloadLocation + File.separator + value;
+						jobContext.addOutputFile(outputPath);
+					} catch (Exception e) {
+						throw new GFacProviderException(e.getLocalizedMessage(),e);
+					}
+	           	}
+            }
+		 }
+		
+
+		
+		
+		
+		
 		downloadStdOuts();
 	}
 	

http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1e125c/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/UASDataStagingProcessor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/UASDataStagingProcessor.java
b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/UASDataStagingProcessor.java
index 09c6e11..5de9593 100644
--- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/UASDataStagingProcessor.java
+++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/UASDataStagingProcessor.java
@@ -113,9 +113,13 @@ public class UASDataStagingProcessor {
 		List<OutputDataObjectType> applicationOutputs = context.getTaskData().getApplicationOutputs();
 		 if (applicationOutputs != null && !applicationOutputs.isEmpty()){
              for (OutputDataObjectType output : applicationOutputs){
-            	 if(output.getType().equals(DataType.URI) && !output.getValue().startsWith("file:"))
{
+ 				if("".equals(output.getValue()) || output.getValue() == null) {
+					continue;
+				}
+
+            	if(output.getType().equals(DataType.URI)) {
             		 createOutURIElement(value, output.getValue());
-            	 }
+            	}
              }
 		 }
 		return value;
@@ -128,8 +132,10 @@ public class UASDataStagingProcessor {
 		
 		if (applicationInputs != null && !applicationInputs.isEmpty()){
 			for (InputDataObjectType input : applicationInputs){
+				if("".equals(input.getValue()) || input.getValue() == null) {
+					continue;
+				}
 				if(input.getType().equals(DataType.URI)){
-					//TODO: set the in sms url
 					createInURISMSElement(value, smsUrl, input.getValue());
 				}
 				else if(input.getType().equals(DataType.STRING)){

http://git-wip-us.apache.org/repos/asf/airavata/blob/2b1e125c/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/URIUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/URIUtils.java
b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/URIUtils.java
index fbc91da..b385368 100644
--- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/URIUtils.java
+++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/URIUtils.java
@@ -106,7 +106,8 @@ public class URIUtils {
 		fragment = URIUtil.encode(fragment, URI.allowed_fragment);
 		return beforeFragment+fragment;
 	}
-    public static java.net.URI createGsiftpURI(String host, String localPath) throws URISyntaxException
{
+    
+	public static java.net.URI createGsiftpURI(String host, String localPath) throws URISyntaxException
{
         StringBuffer buf = new StringBuffer();
         if (!host.startsWith("gsiftp://"))
             buf.append("gsiftp://");


Mime
View raw message