airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msme...@apache.org
Subject [1/2] airavata git commit: fixed simple experiment run [AIRAVATA-1473]
Date Tue, 11 Nov 2014 15:18:05 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 97b384b06 -> 5413e6718


fixed simple experiment run [AIRAVATA-1473]

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

Branch: refs/heads/master
Commit: febd0c40d6445d364d42fb13884075906e44507a
Parents: 47e8214
Author: msmemon <shahbaz.memon@gmail.com>
Authored: Tue Nov 11 16:12:48 2014 +0100
Committer: msmemon <shahbaz.memon@gmail.com>
Committed: Tue Nov 11 16:12:48 2014 +0100

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  | 22 ++++--
 .../tools/RegisterSampleApplications.java       |  9 ++-
 .../server/src/main/assembly/bin-assembly.xml   | 25 ++++---
 .../gfac/bes/provider/impl/BESProvider.java     | 16 ++---
 .../bes/security/UNICORESecurityContext.java    |  6 +-
 .../gfac/bes/utils/DataTransferrer.java         | 53 +++++++++++++-
 .../airavata/gfac/bes/utils/JSDLUtils.java      |  6 +-
 .../gfac/bes/utils/UASDataStagingProcessor.java | 73 +++++++++++---------
 .../registry/jpa/impl/ExperimentRegistry.java   |  7 +-
 9 files changed, 148 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/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 2845bc6..e0b47bb 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
@@ -42,6 +42,8 @@ import org.slf4j.LoggerFactory;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Random;
+import java.util.UUID;
 
 public class CreateLaunchExperiment {
 
@@ -53,7 +55,7 @@ public class CreateLaunchExperiment {
     private static final String DEFAULT_GATEWAY = "default.registry.gateway";
     private static Airavata.Client airavataClient;
 
-    private static String echoAppId = "Echo_6281480a-9887-4a0f-8311-59bbaf738e54";
+    private static String echoAppId = "Echo_70892623-ef16-4efb-a9f0-b12a2861e27a";
     private static String wrfAppId = "WRF_5f097c9c-7066-49ec-aed7-4e39607b3adc";
     private static String amberAppId = "Amber_89906be6-5678-49a6-9d04-a0604fbdef2e";
 
@@ -179,7 +181,7 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setAiravataAutoSchedule(false);
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
-                        simpleExperiment.setUserConfigurationData(userConfigurationData);
+                        
                         return client.createExperiment(simpleExperiment);
                     }
                 }
@@ -203,18 +205,24 @@ public class CreateLaunchExperiment {
     
     public static String createEchoExperimentForFSD(Airavata.Client client) throws TException
{
         try {
+        	// these are template variables and do not need to have values, as it is a data
model.
             List<DataObjectType> exInputs = new ArrayList<DataObjectType>();
             DataObjectType input = new DataObjectType();
             input.setKey("Input_to_Echo");
             input.setType(DataType.STRING);
             input.setValue("Echoed_Output=Hello World");
             exInputs.add(input);
+            DataObjectType i2 = new DataObjectType();
+            i2.setKey("Input_to_Echo1");
+            i2.setType(DataType.URI);
+            i2.setValue("http://shrib.com/22QmrrX4");
+            exInputs.add(i2);
 
             List<DataObjectType> exOut = new ArrayList<DataObjectType>();
             DataObjectType output = new DataObjectType();
-            output.setKey("echo_output");
+            output.setKey("Echoed_Output");
             output.setType(DataType.STRING);
-            output.setValue("");
+            output.setValue("22QmrrX4");
             exOut.add(output);
             
             
@@ -235,7 +243,13 @@ public class CreateLaunchExperiment {
                         userConfigurationData.setAiravataAutoSchedule(false);
                         userConfigurationData.setOverrideManualScheduledParams(false);
                         userConfigurationData.setComputationalResourceScheduling(scheduling);
+                        
+                        // set output directory 
+                        AdvancedOutputDataHandling dataHandling = new AdvancedOutputDataHandling();
+                        dataHandling.setOutputDataDir("/tmp/airavata/output/"+UUID.randomUUID().toString()+"/");
+                        userConfigurationData.setAdvanceOutputDataHandling(dataHandling);
                         simpleExperiment.setUserConfigurationData(userConfigurationData);
+                        
                         return client.createExperiment(simpleExperiment);
                     }
                 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index bd4023b..1e4b591 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -531,12 +531,17 @@ public class RegisterSampleApplications {
 
             InputDataObjectType input1 = RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo",
"Hello World",
                     DataType.STRING, null, false, "A test string to Echo", null);
+            
+            InputDataObjectType input2 = RegisterSampleApplicationsUtils.createAppInput("Input_to_Echo1",
"http://shrib.com/22QmrrX4",
+                    DataType.URI, null, false, "A test uri to Echo", null);
 
+            
             List<InputDataObjectType> applicationInputs = new ArrayList<InputDataObjectType>();
             applicationInputs.add(input1);
+            applicationInputs.add(input2);
 
             OutputDataObjectType output1 = RegisterSampleApplicationsUtils.createAppOutput("Echoed_Output",
-                    "", DataType.STRING);
+                    "22QmrrX4", DataType.STRING);
 
             List<OutputDataObjectType> applicationOutputs = new ArrayList<OutputDataObjectType>();
             applicationOutputs.add(output1);
@@ -1036,7 +1041,7 @@ public class RegisterSampleApplications {
             //Register Echo
             String echoAppDeployId = airavataClient.registerApplicationDeployment(
                     RegisterSampleApplicationsUtils.createApplicationDeployment(echoModuleId,
fsdResourceId,
-                            "/bin/date", ApplicationParallelismType.SERIAL, echoDescription));
+                            "/bin/echo", ApplicationParallelismType.SERIAL, echoDescription));
             System.out.println("Echo on FSD deployment Id " + echoAppDeployId);
 
         } catch (TException e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/modules/distribution/server/src/main/assembly/bin-assembly.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/server/src/main/assembly/bin-assembly.xml b/modules/distribution/server/src/main/assembly/bin-assembly.xml
index 32cb5e7..6ab1d13 100644
--- a/modules/distribution/server/src/main/assembly/bin-assembly.xml
+++ b/modules/distribution/server/src/main/assembly/bin-assembly.xml
@@ -17,13 +17,13 @@
         <!ELEMENT formats (format)*>
         <!ELEMENT format (#PCDATA)>
         <!ELEMENT fileSets (fileSet)*>
-        <!ELEMENT fileSet (directory|outputDirectory|includes)*>
+        <!ELEMENT fileSet (directory|outputDirectory|fileMode|includes)*>
         <!ELEMENT directory (#PCDATA)>
         <!ELEMENT outputDirectory (#PCDATA)>
         <!ELEMENT includes (include)*>
         <!ELEMENT include (#PCDATA)>
         <!ELEMENT dependencySets (dependencySet)*>
-        <!ELEMENT dependencySet (outputDirectory|includes)*>
+        <!ELEMENT dependencySet (outputDirectory|outputFileNameMapping|includes)*>
         ]>
 <assembly>
 	<id>bin</id>
@@ -159,8 +159,7 @@
 	<dependencySets>
 		<dependencySet>
 			<outputDirectory>lib</outputDirectory>
-			<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}
-			</outputFileNameMapping>
+			<outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
 			<includes>
 				<include>org.apache.derby:derby:jar</include>
 				<include>org.apache.derby:derbytools:jar</include>
@@ -280,16 +279,17 @@
 				<include>pl.edu.icm.saml:samly2</include>
 				<include>org.apache.ws.security:wss4j</include>
 				<include>org.json:json</include>
-				<include>org.apache.cxf:cxf-rt-databinding-xmlbeans</include>
-				<include>org.apache.cxf:cxf-api</include>
+				<!-- CXF deps start -->
 				<include>org.codehaus.woodstox:woodstox-core-asl</include>
 				<include>org.codehaus.woodstox:stax2-api</include>
+				<include>org.apache.cxf:cxf-rt-databinding-xmlbeans</include>
+				<include>org.apache.cxf:cxf-api</include>
 				<include>org.apache.ws.xmlschema:xmlschema-core</include>
+				<include>org.apache.cxf:cxf-api</include>
+				<include>org.apache.cxf:cxf-rt-databinding-xmlbeans</include>
 				<include>org.apache.cxf:cxf-rt-core</include>
-				<include>com.sun.xml.bind:jaxb-impl</include>
 				<include>org.apache.cxf:cxf-rt-frontend-jaxws</include>
-				<include>xml-resolver:xml-resolver</include>
-				<include>asm:asm</include>
+				<include>org.apache.cxf:cxf-rt-frontend-simple</include>
 				<include>org.apache.cxf:cxf-rt-bindings-soap</include>
 				<include>org.apache.cxf:cxf-rt-databinding-jaxb</include>
 				<include>org.apache.cxf:cxf-rt-bindings-xml</include>
@@ -298,8 +298,13 @@
 				<include>org.apache.cxf:cxf-rt-ws-policy</include>
 				<include>org.apache.cxf:cxf-rt-transports-http</include>
 				<include>org.apache.cxf:cxf-rt-features-clustering</include>
-				<include>org.apache.neethi:neethi</include>
 				<include>org.apache.cxf:cxf-rt-frontend-jaxws</include>
+				<include>org.apache.cxf:cxf-bundle</include>
+				<!-- // CXF deps end -->
+				<include>com.sun.xml.bind:jaxb-impl</include>
+				<include>org.apache.neethi:neethi:3.0.2</include>
+				<include>xml-resolver:xml-resolver</include>
+				<include>asm:asm</include>
 				<include>xml-resolver:xml-resolver</include>
 				<include>org.eclipse.jetty:jetty-servlet</include>
 				<include>org.eclipse.jetty:jetty-security</include>

http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/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 7ed038a..044ffa2 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
@@ -187,17 +187,17 @@ public class BESProvider extends AbstractProvider implements GFacProvider,
 						.toString();
 			}
 			log.info("JobID: " + jobId);
-			jobDetails.setJobID(activityEpr.toString());
-			jobDetails.setJobDescription(activityEpr.toString());
+			jobDetails.setJobID(jobId);
+			jobDetails.setJobDescription(jobId);
 
 			jobExecutionContext.setJobDetails(jobDetails);
 			try {
 			log.info(formatStatusMessage(activityEpr.getAddress()
 					.getStringValue(), factory.getActivityStatus(activityEpr)
 					.toString()));
-
+			
 			jobExecutionContext.getNotifier().publish(new UnicoreJobIDEvent(jobId));
-			GFacUtils.saveJobStatus(jobExecutionContext, details,JobState.SUBMITTED);
+//			GFacUtils.saveJobStatus(jobExecutionContext, details,JobState.SUBMITTED);
 
 			factory.getActivityStatus(activityEpr);
 			log.info(formatStatusMessage(activityEpr.getAddress()
@@ -215,8 +215,8 @@ public class BESProvider extends AbstractProvider implements GFacProvider,
 					JobState applicationJobStatus = getApplicationJobStatus(activityStatus);
 					String jobStatusMessage = "Status of job " + jobId + "is "
 							+ applicationJobStatus;
-					GFacUtils.updateJobStatus(jobExecutionContext, jobDetails,
-							applicationJobStatus);
+					//TODO: properly use GFacUtils..
+//					GFacUtils.updateJobStatus(jobExecutionContext, jobDetails,	applicationJobStatus);
 
 					jobExecutionContext.getNotifier().publish(
 							new StatusChangeEvent(jobStatusMessage));
@@ -272,8 +272,8 @@ public class BESProvider extends AbstractProvider implements GFacProvider,
 						+ applicationJobStatus;
 				jobExecutionContext.getNotifier().publish(
 						new StatusChangeEvent(jobStatusMessage));
-				GFacUtils.updateJobStatus(jobExecutionContext, jobDetails,
-						applicationJobStatus);
+				//TODO: properly use GFacUtils..
+//				GFacUtils.updateJobStatus(jobExecutionContext, jobDetails, applicationJobStatus);
 				throw new GFacProviderException(
 						jobExecutionContext.getExperimentID() + "Job Canceled");
 			}

http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/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 7285c2c..d5e2b9f 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
@@ -44,7 +44,7 @@ public class UNICORESecurityContext extends X509SecurityContext {
 		try{
 			X509Credential cred = getX509Credentials();
 			secProperties = new DefaultClientConfiguration(dcValidator, cred);
-//			setExtraSettings();
+			setExtraSettings();
 		}
 		catch (Exception e) {
 			throw new GFacException(e.getMessage(), e); 
@@ -103,8 +103,8 @@ public class UNICORESecurityContext extends X509SecurityContext {
 			p = new Properties();
 		}
 		
-		p.setProperty("http.connection.timeout", "300000");
-		p.setProperty("http.socket.timeout", "300000");
+		p.setProperty("http.connection.timeout", "5000");
+		p.setProperty("http.socket.timeout", "5000");
 		
 		secProperties.setExtraSettings(p);
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/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 f811f97..79fbae4 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
@@ -26,7 +26,9 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.airavata.commons.gfac.type.ActualParameter;
@@ -39,6 +41,7 @@ import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
 import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
 import org.apache.airavata.schemas.gfac.StringArrayType;
 import org.apache.airavata.schemas.gfac.StringParameterType;
+import org.apache.airavata.schemas.gfac.URIArrayType;
 import org.apache.airavata.schemas.gfac.URIParameterType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -119,7 +122,8 @@ public class DataTransferrer {
 				String localFileName = null;
 				//TODO: why analysis.tar? it wont scale to other gateways..
 				if(stringPrm == null || stringPrm.isEmpty()){
-					localFileName = "analysis-results.tar";
+					continue; 
+//					localFileName = "analysis-results.tar";
 				}else{
 					localFileName = stringPrm.substring(stringPrm.lastIndexOf("/")+1);
 				}
@@ -199,16 +203,59 @@ public class DataTransferrer {
 			throw new GFacProviderException(e.getLocalizedMessage(),e);
 		}
 		String stderrLocation = downloadLocation+File.separator+stderrFileName;
-		FileDownloader f2 = new FileDownloader(stderrFileName,stderrLocation, Mode.overwrite);
+//		FileDownloader f2 = new FileDownloader(stderrFileName,stderrLocation, Mode.overwrite);
 		try {
-			f2.perform(storageClient);
+			f1.setFrom(stderrFileName);
+			f1.setTo(stderrLocation);
+			f1.perform(storageClient);
 			String stderror = readFile(stderrLocation);
 			appDesc.setStandardError(stderror);
 		} catch (Exception e) {
 			throw new GFacProviderException(e.getLocalizedMessage(),e);
 		}
+		
+		if(UASDataStagingProcessor.isUnicoreEndpoint(jobContext)) {
+			String scriptExitCodeFName = "UNICORE_SCRIPT_EXIT_CODE";
+			f1.setFrom(scriptExitCodeFName);
+			f1.setTo(downloadLocation+File.separator+scriptExitCodeFName);
+			
+		}
+	}
+	
+	public List<String> extractOutStringParams(JobExecutionContext context) {
+		
+		Map<String, Object> outputParams = context.getOutMessageContext()
+				.getParameters();
+		
+		List<String> outPrmsList = new ArrayList<String>();
+		
+		for (String paramKey : outputParams.keySet()) {
+
+			ActualParameter outParam = (ActualParameter) outputParams
+					.get(paramKey);
+
+			String paramDataType = outParam.getType().getType().toString();
+
+			if ("String".equals(paramDataType)) {
+				String strPrm = ((StringParameterType) outParam.getType())
+						.getValue();
+				outPrmsList.add(strPrm);
+			}
+
+			else if (("StringArray").equals(paramDataType)) {
+				String[] uriArray = ((URIArrayType) outParam.getType())
+						.getValueArray();
+				for (String u : uriArray) {
+					outPrmsList.add(u);					
+				}
+
+			}
+		}
+		
+		return outPrmsList;
 	}
 
+	
 	private String readFile(String localFile) throws IOException {
 		BufferedReader instream = new BufferedReader(new FileReader(localFile));
 		StringBuffer buff = new StringBuffer();

http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/JSDLUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/JSDLUtils.java
b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/JSDLUtils.java
index d2474f0..e7dc672 100644
--- a/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/JSDLUtils.java
+++ b/modules/gfac/gfac-bes/src/main/java/org/apache/airavata/gfac/bes/utils/JSDLUtils.java
@@ -122,10 +122,12 @@ public class JSDLUtils
 		SourceTargetType target = newDS.addNewTarget();
 
 		try {
-			uri = (uri == null) ? null : URIUtils.encodeAll(uri);
+			if (uri != null) { 
+				URIUtils.encodeAll(uri);
+				target.setURI(uri);
+			}
 		} catch (URIException e) {
 		}
-		target.setURI(uri);
 		newDS.setFileName(file);
 		if (fileSystem != null && !fileSystem.equals("Work")) {  //$NON-NLS-1$
 			newDS.setFilesystemName(fileSystem);

http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/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 6ab7ed0..76624cc 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
@@ -22,6 +22,8 @@
 package org.apache.airavata.gfac.bes.utils;
 
 import java.io.File;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.airavata.commons.gfac.type.ActualParameter;
@@ -48,17 +50,19 @@ public class UASDataStagingProcessor {
 		if (context.getInMessageContext().getParameters().size() > 0) {
 			buildDataStagingFromInputContext(context, value, smsUrl, appDepType);
 		}
-		MessageContext outMessage = new MessageContext();
-		ActualParameter a1 = new ActualParameter();
-		a1.getType().changeType(StringParameterType.type);
-		((StringParameterType)a1.getType()).setValue("analysis-results.tar");
-		outMessage.addParameter("o1", a1);
-		context.setOutMessageContext(outMessage);
-		
+//		MessageContext outMessage = new MessageContext();
+//		ActualParameter a1 = new ActualParameter();
+//		a1.getType().changeType(StringParameterType.type);
+//		((StringParameterType)a1.getType()).setValue("analysis-results.tar");
+//		outMessage.addParameter("o1", a1);
+//		context.setOutMessageContext(outMessage);
+		
+		// now download for string typed outputs are to be done 
 		if (context.getOutMessageContext().getParameters().size() > 0) {
 			buildFromOutputContext(context, value, smsUrl, appDepType);
 		}
-		createStdOutURIs(value, appDepType, smsUrl, isUnicoreEndpoint(context));
+		//TODO need a review for us3 gateway..
+//		createStdOutURIs(value, appDepType, smsUrl, isUnicoreEndpoint(context));
 	}
 	
 	private static void createInURISMSElement(JobDefinitionType value,
@@ -85,7 +89,16 @@ public class UASDataStagingProcessor {
 			HpcApplicationDeploymentType appDepType, String smsUrl,
 			boolean isUnicore) throws Exception {
 
+		// no need to use smsUrl for output location, because output location is activity's working
directory 
 		
+		if(isUnicore) {
+			String scriptExitCodeFName = "UNICORE_SCRIPT_EXIT_CODE";
+			String scriptExitCode = smsUrl+"#/output/"+scriptExitCodeFName;
+			JSDLUtils.addDataStagingTargetElement(value, null,
+					scriptExitCodeFName, null);
+		}
+		
+		if(!isUnicore) {
 		String stdout = ApplicationProcessor.getApplicationStdOut(value, appDepType);
 		
 		String stderr = ApplicationProcessor.getApplicationStdErr(value, appDepType);
@@ -93,20 +106,16 @@ public class UASDataStagingProcessor {
 		String stdoutFileName = (stdout == null || stdout.equals("")) ? "stdout"
 				: stdout;
 		String stdoutURI = smsUrl+"#/output/"+stdoutFileName;
+		
 		JSDLUtils.addDataStagingTargetElement(value, null, stdoutFileName,
-				stdoutURI);
+				null);
 
 		String stderrFileName = (stdout == null || stderr.equals("")) ? "stderr"
 				: stderr;
 		String stderrURI = smsUrl+"#/output/"+stderrFileName;
-		JSDLUtils.addDataStagingTargetElement(value, null, stderrFileName,
-				stderrURI);
 		
-		if(isUnicore) {
-			String scriptExitCodeFName = "UNICORE_SCRIPT_EXIT_CODE";
-			String scriptExitCode = smsUrl+"#/output/"+scriptExitCodeFName;
-			JSDLUtils.addDataStagingTargetElement(value, null,
-					scriptExitCodeFName, scriptExitCode.toString());
+		JSDLUtils.addDataStagingTargetElement(value, null, stderrFileName,
+				null);
 		}
 
 	}
@@ -119,7 +128,7 @@ public class UASDataStagingProcessor {
 		
 		String finalSMSPath = smsUrl + "#/output/"+prmValue;
 		
-		JSDLUtils.addDataStagingTargetElement(value, null, prmValue,	finalSMSPath);
+		JSDLUtils.addDataStagingTargetElement(value, null, prmValue, null);
 	}
 
 	
@@ -159,22 +168,19 @@ public class UASDataStagingProcessor {
 				}
 
 			}
-			else if ("String".equals(paramDataType) || "StringArray".equals(paramDataType)) {
-				return value;
-			}
-			else if ("String".equals(paramDataType)) {
-				String stringPrm = ((StringParameterType) outParam
-						.getType()).getValue();
-				createOutStringElements(value, appDepType, smsUrl, stringPrm);
-			}
-
-			else if ("StringArray".equals(paramDataType)) {
-				String[] valueArray = ((StringArrayType) outParam.getType())
-						.getValueArray();
-				for (String v : valueArray) {
-					createOutStringElements(value, appDepType, smsUrl, v);
-				}
-			}
+//			else if ("String".equals(paramDataType)) {
+//				String stringPrm = ((StringParameterType) outParam
+//						.getType()).getValue();
+//				createOutStringElements(value, appDepType, smsUrl, stringPrm);
+//			}
+//
+//			else if ("StringArray".equals(paramDataType)) {
+//				String[] valueArray = ((StringArrayType) outParam.getType())
+//						.getValueArray();
+//				for (String v : valueArray) {
+//					createOutStringElements(value, appDepType, smsUrl, v);
+//				}
+//			}
 		}
 		
 		return value;
@@ -212,7 +218,6 @@ public class UASDataStagingProcessor {
 				ApplicationProcessor.addApplicationArgument(value, appDepType, stringPrm);
 			}
 		}
-		
 	}
 	
 	public static boolean isUnicoreEndpoint(JobExecutionContext context) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/febd0c40/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
index 03ca6fc..8e9ae58 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ExperimentRegistry.java
@@ -93,9 +93,10 @@ public class ExperimentRegistry {
 
             List<DataObjectType> experimentOutputs = experiment.getExperimentOutputs();
             if (experimentOutputs != null && !experimentOutputs.isEmpty()){
-                for (DataObjectType output : experimentOutputs){
-                    output.setValue("");
-                }
+            	//TODO: short change.
+//                for (DataObjectType output : experimentOutputs){
+//                    output.setValue("");
+//                }
                 addExpOutputs(experimentOutputs, experimentID);
             }
 


Mime
View raw message