You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2016/03/31 23:24:13 UTC

airavata git commit: Initial implementation for AIRAVATA-1945

Repository: airavata
Updated Branches:
  refs/heads/develop 27e93a0f2 -> e5ae01e02


Initial implementation for AIRAVATA-1945


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

Branch: refs/heads/develop
Commit: e5ae01e020897c5f0e044895d624e9f95c4ef987
Parents: 27e93a0
Author: Suresh Marru <sm...@apache.org>
Authored: Thu Mar 31 17:24:05 2016 -0400
Committer: Suresh Marru <sm...@apache.org>
Committed: Thu Mar 31 17:24:05 2016 -0400

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/impl/Factory.java  | 24 +++++++-
 .../airavata/gfac/impl/GFacEngineImpl.java      |  4 +-
 .../core/utils/OrchestratorUtils.java           | 17 ++++++
 .../cpi/impl/SimpleOrchestratorImpl.java        |  8 ++-
 .../catalog/model/ProcessResourceSchedule.java  | 30 ++++++++++
 .../catalog/model/UserConfigurationData.java    | 30 ++++++++++
 .../ProcessResourceScheduleResource.java        | 30 ++++++++++
 .../UserConfigurationDataResource.java          | 60 +++++++++++++++-----
 .../experiment/catalog/resources/Utils.java     |  6 ++
 .../utils/ThriftDataModelConversion.java        |  9 +++
 .../src/main/resources/expcatalog-derby.sql     |  3 +
 .../src/main/resources/expcatalog-mysql.sql     |  3 +
 12 files changed, 201 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
index ddc744f..723eb37 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
@@ -67,6 +67,7 @@ import org.apache.airavata.model.appcatalog.computeresource.*;
 import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
 import org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference;
 import org.apache.airavata.model.data.movement.DataMovementProtocol;
+import org.apache.airavata.model.process.ProcessModel;
 import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
 import org.apache.airavata.registry.cpi.AppCatalog;
 import org.apache.airavata.registry.cpi.AppCatalogException;
@@ -236,7 +237,7 @@ public abstract class Factory {
             AuthenticationInfo authentication = remoteCluster.getAuthentication();
             if (authentication instanceof SSHKeyAuthentication){
                 SSHKeyAuthentication sshKeyAuthentication = (SSHKeyAuthentication)authentication;
-                if (!sshKeyAuthentication.getUserName().equals(processContext.getComputeResourcePreference().getLoginUserName())){
+                if (!sshKeyAuthentication.getUserName().equals(getLoginUserName(processContext))){
                     JobManagerConfiguration jobManagerConfiguration = getJobManagerConfiguration(processContext.getResourceJobManager());
                     if (jobSubmissionProtocol == JobSubmissionProtocol.SSH ||
                             jobSubmissionProtocol == JobSubmissionProtocol.SSH_FORK) {
@@ -271,7 +272,7 @@ public abstract class Factory {
             AuthenticationInfo authentication = remoteCluster.getAuthentication();
             if (authentication instanceof SSHKeyAuthentication){
                 SSHKeyAuthentication sshKeyAuthentication = (SSHKeyAuthentication)authentication;
-                if (!sshKeyAuthentication.getUserName().equals(processContext.getComputeResourcePreference().getLoginUserName())){
+                if (!sshKeyAuthentication.getUserName().equals(getLoginUserName(processContext))){
                     JobManagerConfiguration jobManagerConfiguration = getJobManagerConfiguration(processContext.getResourceJobManager());
                     dataMovementProtocol = processContext.getDataMovementProtocol();
                     if (dataMovementProtocol == DataMovementProtocol.SCP) {
@@ -288,7 +289,7 @@ public abstract class Factory {
 	public static SSHKeyAuthentication getComputerResourceSSHKeyAuthentication(ProcessContext pc) throws GFacException {
         try {
             ComputeResourcePreference computeResourcePreference = pc.getComputeResourcePreference();
-            String loginUserName = computeResourcePreference.getLoginUserName();
+            String loginUserName = getLoginUserName(pc);
             String credentialStoreToken = computeResourcePreference.getResourceSpecificCredentialStoreToken();
             if (credentialStoreToken == null || credentialStoreToken.isEmpty()) {
                 credentialStoreToken = pc.getGatewayResourceProfile().getCredentialStoreToken();
@@ -313,6 +314,23 @@ public abstract class Factory {
         }
     }
 
+    public static String  getLoginUserName(ProcessContext processContext) throws GFacException {
+        try {
+            ProcessModel processModel = processContext.getProcessModel();
+            String loginUserName = null;
+            String overrideLoginUserName = processModel.getResourceSchedule().getOverrideLoginUserName();
+            if (overrideLoginUserName != null) {
+                loginUserName = overrideLoginUserName;
+            } else {
+                loginUserName = processContext.getComputeResourcePreference().getLoginUserName();
+            }
+
+            return loginUserName;
+        }  catch (Exception e) {
+            throw new GFacException("Couldn't fetch loginUserName", e);
+        }
+    }
+
     private static SSHKeyAuthentication getSshKeyAuthentication(String gatewayId,
                                                                 String loginUserName,
                                                                 String credentialStoreToken)

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/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 a4f101e..129103b 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
@@ -150,7 +150,7 @@ public class GFacEngineImpl implements GFacEngine {
             processContext.setApplicationInterfaceDescription(applicationInterface);
             String computeResourceId = processContext.getComputeResourceDescription().getComputeResourceId();
             String hostName = Factory.getDefaultAppCatalog().getComputeResource().getComputeResource(computeResourceId).getHostName();
-            ServerInfo serverInfo = new ServerInfo(processContext.getComputeResourcePreference().getLoginUserName(), hostName);
+            ServerInfo serverInfo = new ServerInfo(Factory.getLoginUserName(processContext), hostName);
             processContext.setServerInfo(serverInfo);
             List<OutputDataObjectType> applicationOutputs = applicationInterface.getApplicationOutputs();
             if (applicationOutputs != null && !applicationOutputs.isEmpty()) {
@@ -355,7 +355,7 @@ public class GFacEngineImpl implements GFacEngine {
                                         submodel.setType(DataStageType.OUPUT);
                                         submodel.setProcessOutput(output);
                                         URI source = new URI(processContext.getDataMovementProtocol().name(),
-                                                processContext.getComputeResourcePreference().getLoginUserName(),
+                                                Factory.getLoginUserName(processContext),
                                                 processContext.getComputeResourceDescription().getHostName(),
                                                 22,
                                                 processContext.getWorkingDir() + output.getValue(), null, null);

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
index 3aa8974..d38a860 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java
@@ -121,6 +121,23 @@ public class OrchestratorUtils {
         }
     }
 
+    public static String getLoginUserName(OrchestratorContext context, ProcessModel processModel, String gatewayId) throws RegistryException {
+        try {
+            String loginUserName = null;
+            String overrideLoginUserName = processModel.getResourceSchedule().getOverrideLoginUserName();
+            if (overrideLoginUserName != null) {
+                loginUserName = overrideLoginUserName;
+            } else {
+                GwyResourceProfile gatewayProfile = context.getRegistry().getAppCatalog().getGatewayProfile();
+                loginUserName = gatewayProfile.getComputeResourcePreference(gatewayId, processModel.getComputeResourceId()).getLoginUserName();
+            }
+            return loginUserName;
+        } catch (AppCatalogException e) {
+            logger.error("Error occurred while initializing app catalog", e);
+            throw new RegistryException("Error occurred while initializing app catalog", e);
+        }
+    }
+
     public static JobSubmissionInterface getPreferredJobSubmissionInterface(OrchestratorContext context, ProcessModel processModel, String gatewayId) throws RegistryException {
         try {
             String resourceHostId = processModel.getComputeResourceId();

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/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 15c8556..116b5f8 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
@@ -548,8 +548,9 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
         URI destination = null;
         try {
             DataMovementProtocol dataMovementProtocol = OrchestratorUtils.getPreferredDataMovementProtocol(orchestratorContext, processModel, gatewayId);
+            String loginUserName = OrchestratorUtils.getLoginUserName(orchestratorContext, processModel, gatewayId);
             destination = new URI(dataMovementProtocol.name(),
-                    computeResourcePreference.getLoginUserName(),
+                    loginUserName,
                     computeResource.getHostName(),
                     OrchestratorUtils.getDataMovementPort(orchestratorContext, processModel, gatewayId),
                     remoteOutputDir , null, null);
@@ -585,11 +586,12 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
             DataMovementProtocol dataMovementProtocol = OrchestratorUtils.getPreferredDataMovementProtocol(orchestratorContext, processModel, gatewayId);
             URI source = null;
             try {
+                String loginUserName = OrchestratorUtils.getLoginUserName(orchestratorContext, processModel, gatewayId);
                 if (processOutput != null) {
                     submodel.setType(DataStageType.OUPUT);
                     submodel.setProcessOutput(processOutput);
                     source = new URI(dataMovementProtocol.name(),
-                            computeResourcePreference.getLoginUserName(),
+                            loginUserName,
                             computeResource.getHostName(),
                             OrchestratorUtils.getDataMovementPort(orchestratorContext, processModel, gatewayId),
                             remoteOutputDir + processOutput.getValue(), null, null);
@@ -597,7 +599,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{
                     // archive
                     submodel.setType(DataStageType.ARCHIVE_OUTPUT);
                     source = new URI(dataMovementProtocol.name(),
-                            computeResourcePreference.getLoginUserName(),
+                            loginUserName,
                             computeResource.getHostName(),
                             OrchestratorUtils.getDataMovementPort(orchestratorContext, processModel, gatewayId),
                             remoteOutputDir, null, null);

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java
index b23c8d5..c836feb 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java
@@ -40,6 +40,9 @@ public class ProcessResourceSchedule {
     private Integer totalPhysicalMemory;
     private Process process;
     private String staticWorkingDir;
+    private String overrideLoginUserName;
+    private String overrideScratchLocation;
+    private String overrideAllocationProjectNumber;
 
     @Id
     @Column(name = "PROCESS_ID")
@@ -123,6 +126,33 @@ public class ProcessResourceSchedule {
         this.staticWorkingDir = staticWorkingDir;
     }
 
+    @Column(name = "OVERRIDE_LOGIN_USER_NAME")
+    public String getOverrideLoginUserName() {
+        return overrideLoginUserName;
+    }
+
+    public void setOverrideLoginUserName(String overrideLoginUserName) {
+        this.overrideLoginUserName = overrideLoginUserName;
+    }
+
+    @Column(name = "OVERRIDE_SCRATCH_LOCATION")
+    public String getOverrideScratchLocation() {
+        return overrideScratchLocation;
+    }
+
+    public void setOverrideScratchLocation(String overrideScratchLocation) {
+        this.overrideScratchLocation = overrideScratchLocation;
+    }
+
+    @Column(name = "OVERRIDE_ALLOCATION_PROJECT_NUMBER")
+    public String getOverrideAllocationProjectNumber() {
+        return overrideAllocationProjectNumber;
+    }
+
+    public void setOverrideAllocationProjectNumber(String overrideAllocationProjectNumber) {
+        this.overrideAllocationProjectNumber = overrideAllocationProjectNumber;
+    }
+
     //    @Override
 //    public boolean equals(Object o) {
 //        if (this == o) return true;

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
index 638dee9..efad5ce 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
@@ -45,6 +45,9 @@ public class UserConfigurationData {
     private Integer totalPhysicalMemory;
     private Experiment experiment;
     private String staticWorkingDir;
+    private String overrideLoginUserName;
+    private String overrideScratchLocation;
+    private String overrideAllocationProjectNumber;
     private String storageId;
     private String experimentDataDir;
 
@@ -184,6 +187,33 @@ public class UserConfigurationData {
         this.staticWorkingDir = staticWorkingDir;
     }
 
+    @Column(name = "OVERRIDE_LOGIN_USER_NAME")
+    public String getOverrideLoginUserName() {
+        return overrideLoginUserName;
+    }
+
+    public void setOverrideLoginUserName(String overrideLoginUserName) {
+        this.overrideLoginUserName = overrideLoginUserName;
+    }
+
+    @Column(name = "OVERRIDE_SCRATCH_LOCATION")
+    public String getOverrideScratchLocation() {
+        return overrideScratchLocation;
+    }
+
+    public void setOverrideScratchLocation(String overrideScratchLocation) {
+        this.overrideScratchLocation = overrideScratchLocation;
+    }
+
+    @Column(name = "OVERRIDE_ALLOCATION_PROJECT_NUMBER")
+    public String getOverrideAllocationProjectNumber() {
+        return overrideAllocationProjectNumber;
+    }
+
+    public void setOverrideAllocationProjectNumber(String overrideAllocationProjectNumber) {
+        this.overrideAllocationProjectNumber = overrideAllocationProjectNumber;
+    }
+
     @Column(name = "STORAGE_RESOURCE_ID")
     public String getStorageId() {
         return storageId;

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java
index 1fe0e23..cb40ac4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResourceScheduleResource.java
@@ -43,6 +43,9 @@ public class ProcessResourceScheduleResource extends AbstractExpCatResource {
     private Integer wallTimeLimit;
     private Integer totalPhysicalMemory;
     private String staticWorkingDir;
+    private String overrideLoginUserName;
+    private String overrideScratchLocation;
+    private String overrideAllocationProjectNumber;
 
     public String getProcessId() {
         return processId;
@@ -116,6 +119,30 @@ public class ProcessResourceScheduleResource extends AbstractExpCatResource {
         this.staticWorkingDir = staticWorkingDir;
     }
 
+    public String getOverrideLoginUserName() {
+        return overrideLoginUserName;
+    }
+
+    public void setOverrideLoginUserName(String overrideLoginUserName) {
+        this.overrideLoginUserName = overrideLoginUserName;
+    }
+
+    public String getOverrideScratchLocation() {
+        return overrideScratchLocation;
+    }
+
+    public void setOverrideScratchLocation(String overrideScratchLocation) {
+        this.overrideScratchLocation = overrideScratchLocation;
+    }
+
+    public String getOverrideAllocationProjectNumber() {
+        return overrideAllocationProjectNumber;
+    }
+
+    public void setOverrideAllocationProjectNumber(String overrideAllocationProjectNumber) {
+        this.overrideAllocationProjectNumber = overrideAllocationProjectNumber;
+    }
+
     public ExperimentCatResource create(ResourceType type) throws RegistryException {
         logger.error("Unsupported resource type for process resource scheduling data resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
@@ -172,6 +199,9 @@ public class ProcessResourceScheduleResource extends AbstractExpCatResource {
             processResourceSchedule.setWallTimeLimit(wallTimeLimit);
             processResourceSchedule.setTotalPhysicalMemory(totalPhysicalMemory);
             processResourceSchedule.setStaticWorkingDir(staticWorkingDir);
+            processResourceSchedule.setOverrideLoginUserName(overrideLoginUserName);
+            processResourceSchedule.setOverrideScratchLocation(overrideScratchLocation);
+            processResourceSchedule.setOverrideAllocationProjectNumber(overrideAllocationProjectNumber);
             if (existingSchedule == null){
                 em.persist(processResourceSchedule);
             }else {

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
index ebf29bd..c6516c4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
@@ -49,6 +49,9 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
     private Integer wallTimeLimit;
     private Integer totalPhysicalMemory;
     private String staticWorkingDir;
+    private String overrideLoginUserName;
+    private String overrideScratchLocation;
+    private String overrideAllocationProjectNumber;
     private String storageId;
     private String experimentDataDir;
 
@@ -180,6 +183,30 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
         this.staticWorkingDir = staticWorkingDir;
     }
 
+    public String getOverrideLoginUserName() {
+        return overrideLoginUserName;
+    }
+
+    public void setOverrideLoginUserName(String overrideLoginUserName) {
+        this.overrideLoginUserName = overrideLoginUserName;
+    }
+
+    public String getOverrideScratchLocation() {
+        return overrideScratchLocation;
+    }
+
+    public void setOverrideScratchLocation(String overrideScratchLocation) {
+        this.overrideScratchLocation = overrideScratchLocation;
+    }
+
+    public String getOverrideAllocationProjectNumber() {
+        return overrideAllocationProjectNumber;
+    }
+
+    public void setOverrideAllocationProjectNumber(String overrideAllocationProjectNumber) {
+        this.overrideAllocationProjectNumber = overrideAllocationProjectNumber;
+    }
+
     public String getExperimentDataDir() {
         return experimentDataDir;
     }
@@ -193,36 +220,36 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
         throw new UnsupportedOperationException();
     }
 
-    
+
     public void remove(ResourceType type, Object name) throws RegistryException {
         logger.error("Unsupported resource type for process resource scheduling data resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
-    
-    public ExperimentCatResource get(ResourceType type, Object name) throws RegistryException{
+
+    public ExperimentCatResource get(ResourceType type, Object name) throws RegistryException {
         logger.error("Unsupported resource type for process resource scheduling data resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
-    
-    public List<ExperimentCatResource> get(ResourceType type) throws RegistryException{
+
+    public List<ExperimentCatResource> get(ResourceType type) throws RegistryException {
         logger.error("Unsupported resource type for process resource scheduling data resource.", new UnsupportedOperationException());
         throw new UnsupportedOperationException();
     }
 
-    
-    public void save() throws RegistryException{
+
+    public void save() throws RegistryException {
         EntityManager em = null;
         try {
             em = ExpCatResourceUtils.getEntityManager();
             UserConfigurationData userConfigurationData;
-            if(experimentId == null){
+            if (experimentId == null) {
                 throw new RegistryException("Does not have the experiment id");
             }
             UserConfigurationData existingConf = em.find(UserConfigurationData.class, experimentId);
             if (em.isOpen()) {
-                if (em.getTransaction().isActive()){
+                if (em.getTransaction().isActive()) {
                     em.getTransaction().rollback();
                 }
                 em.close();
@@ -230,9 +257,9 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
 
             em = ExpCatResourceUtils.getEntityManager();
             em.getTransaction().begin();
-            if(existingConf == null){
+            if (existingConf == null) {
                 userConfigurationData = new UserConfigurationData();
-            }else {
+            } else {
                 userConfigurationData = existingConf;
             }
             userConfigurationData.setExperimentId(experimentId);
@@ -249,17 +276,20 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
             userConfigurationData.setQueueName(queueName);
             userConfigurationData.setWallTimeLimit(wallTimeLimit);
             userConfigurationData.setStaticWorkingDir(staticWorkingDir);
+            userConfigurationData.setOverrideLoginUserName(overrideLoginUserName);
+            userConfigurationData.setOverrideScratchLocation(overrideScratchLocation);
+            userConfigurationData.setOverrideAllocationProjectNumber(overrideAllocationProjectNumber);
             userConfigurationData.setTotalPhysicalMemory(totalPhysicalMemory);
             userConfigurationData.setStorageId(storageId);
             userConfigurationData.setExperimentDataDir(experimentDataDir);
-            if (existingConf == null){
+            if (existingConf == null) {
                 em.persist(userConfigurationData);
-            }else {
+            } else {
                 em.merge(userConfigurationData);
             }
             em.getTransaction().commit();
             if (em.isOpen()) {
-                if (em.getTransaction().isActive()){
+                if (em.getTransaction().isActive()) {
                     em.getTransaction().rollback();
                 }
                 em.close();
@@ -269,7 +299,7 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
             throw new RegistryException(e);
         } finally {
             if (em != null && em.isOpen()) {
-                if (em.getTransaction().isActive()){
+                if (em.getTransaction().isActive()) {
                     em.getTransaction().rollback();
                 }
                 em.close();

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
index 9dc2a07..340e020 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
@@ -513,6 +513,9 @@ public class Utils {
             configurationDataResource.setWallTimeLimit(o.getWallTimeLimit());
             configurationDataResource.setTotalPhysicalMemory(o.getTotalPhysicalMemory());
             configurationDataResource.setStaticWorkingDir(o.getStaticWorkingDir());
+            configurationDataResource.setOverrideLoginUserName(o.getOverrideLoginUserName());
+            configurationDataResource.setOverrideScratchLocation(o.getOverrideScratchLocation());
+            configurationDataResource.setOverrideAllocationProjectNumber(o.getOverrideAllocationProjectNumber());
             configurationDataResource.setStorageId(o.getStorageId());
             configurationDataResource.setExperimentDataDir(o.getExperimentDataDir());
         }
@@ -658,6 +661,9 @@ public class Utils {
             resourceScheduleResource.setWallTimeLimit(o.getWallTimeLimit());
             resourceScheduleResource.setTotalPhysicalMemory(o.getTotalPhysicalMemory());
             resourceScheduleResource.setStaticWorkingDir(o.getStaticWorkingDir());
+            resourceScheduleResource.setOverrideLoginUserName(o.getOverrideLoginUserName());
+            resourceScheduleResource.setOverrideScratchLocation(o.getOverrideScratchLocation());
+            resourceScheduleResource.setOverrideAllocationProjectNumber(o.getOverrideAllocationProjectNumber());
         }
         return resourceScheduleResource;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
index e39adc2..d6f92ff 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
@@ -515,6 +515,9 @@ public class ThriftDataModelConversion {
             resourceSchedulingModel.setWallTimeLimit(resource.getWallTimeLimit());
             resourceSchedulingModel.setTotalPhysicalMemory(resource.getTotalPhysicalMemory());
             resourceSchedulingModel.setStaticWorkingDir(resource.getStaticWorkingDir());
+            resourceSchedulingModel.setOverrideLoginUserName(resource.getOverrideLoginUserName());
+            resourceSchedulingModel.setOverrideScratchLocation(resource.getOverrideScratchLocation());
+            resourceSchedulingModel.setOverrideAllocationProjectNumber(resource.getOverrideAllocationProjectNumber());
             data.setComputationalResourceScheduling(resourceSchedulingModel);
 
             return data;
@@ -533,6 +536,9 @@ public class ThriftDataModelConversion {
             resourceSchedulingModel.setWallTimeLimit(resource.getWallTimeLimit());
             resourceSchedulingModel.setTotalPhysicalMemory(resource.getTotalPhysicalMemory());
             resourceSchedulingModel.setStaticWorkingDir(resource.getStaticWorkingDir());
+            resourceSchedulingModel.setOverrideLoginUserName(resource.getOverrideLoginUserName());
+            resourceSchedulingModel.setOverrideScratchLocation(resource.getOverrideScratchLocation());
+            resourceSchedulingModel.setOverrideAllocationProjectNumber(resource.getOverrideAllocationProjectNumber());
             return resourceSchedulingModel;
         }
         return null;
@@ -549,6 +555,9 @@ public class ThriftDataModelConversion {
             resourceSchedulingModel.setWallTimeLimit(resource.getWallTimeLimit());
             resourceSchedulingModel.setTotalPhysicalMemory(resource.getTotalPhysicalMemory());
             resourceSchedulingModel.setStaticWorkingDir(resource.getStaticWorkingDir());
+            resourceSchedulingModel.setOverrideLoginUserName(resource.getOverrideLoginUserName());
+            resourceSchedulingModel.setOverrideScratchLocation(resource.getOverrideScratchLocation());
+            resourceSchedulingModel.setOverrideAllocationProjectNumber(resource.getOverrideAllocationProjectNumber());
             return resourceSchedulingModel;
         }
         return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
index ded83b0..a00dacf 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
@@ -160,6 +160,9 @@ CREATE TABLE USER_CONFIGURATION_DATA (
   WALL_TIME_LIMIT INT,
   TOTAL_PHYSICAL_MEMORY INT,
   STATIC_WORKING_DIR varchar(255),
+  OVERRIDE_LOGIN_USER_NAME varchar(255),
+  OVERRIDE_SCRATCH_LOCATION varchar(255),
+  OVERRIDE_ALLOCATION_PROJECT_NUMBER varchar(255),
   STORAGE_RESOURCE_ID varchar(255),
   EXPERIMENT_DATA_DIR VARCHAR (512),
   PRIMARY KEY (EXPERIMENT_ID),

http://git-wip-us.apache.org/repos/asf/airavata/blob/e5ae01e0/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
index 04c7cee..252e940 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
@@ -161,6 +161,9 @@ CREATE TABLE USER_CONFIGURATION_DATA (
   WALL_TIME_LIMIT int(11),
   TOTAL_PHYSICAL_MEMORY int(11),
   STATIC_WORKING_DIR varchar(255),
+  OVERRIDE_LOGIN_USER_NAME varchar(255),
+  OVERRIDE_SCRATCH_LOCATION varchar(255),
+  OVERRIDE_ALLOCATION_PROJECT_NUMBER varchar(255),
   STORAGE_RESOURCE_ID varchar(255),
   EXPERIMENT_DATA_DIR VARCHAR (512),
   PRIMARY KEY (EXPERIMENT_ID),