You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2018/10/04 17:30:16 UTC

[airavata] branch develop updated: Removing gateway compute resource preference from task context

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new eeb7797  Removing gateway compute resource preference from task context
eeb7797 is described below

commit eeb77972b5bbe5146dad462f14eb61dd62e205b5
Author: Dimuthu Wannipurage <di...@datasprouts.com>
AuthorDate: Thu Oct 4 13:29:59 2018 -0400

    Removing gateway compute resource preference from task context
---
 .../apache/airavata/helix/impl/task/TaskContext.java  | 19 -------------------
 .../task/submission/DefaultJobSubmissionTask.java     |  2 +-
 2 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
index 2e3be1b..dfe758c 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/TaskContext.java
@@ -84,7 +84,6 @@ public class TaskContext {
     private UserResourceProfile userResourceProfile;
     private GroupResourceProfile groupResourceProfile;
 
-    private ComputeResourcePreference gatewayComputeResourcePreference;
     private StoragePreference gatewayStorageResourcePreference;
     private UserComputeResourcePreference userComputeResourcePreference;
     private UserStoragePreference userStoragePreference;
@@ -374,14 +373,6 @@ public class TaskContext {
         this.jobModel = jobModel;
     }
 
-    public ComputeResourcePreference getGatewayComputeResourcePreference() {
-        return gatewayComputeResourcePreference;
-    }
-
-    public void setGatewayComputeResourcePreference(ComputeResourcePreference gatewayComputeResourcePreference) {
-        this.gatewayComputeResourcePreference = gatewayComputeResourcePreference;
-    }
-
     public ProcessState getProcessState() {
         if(processModel.getProcessStatuses() != null && processModel.getProcessStatuses().size() > 0)
             return processModel.getProcessStatuses().get(0).getState();
@@ -572,10 +563,6 @@ public class TaskContext {
         return str != null && !str.trim().isEmpty();
     }
 
-    public String getUsageReportingGatewayId() {
-        return gatewayComputeResourcePreference.getUsageReportingGatewayId();
-    }
-
     public String getAllocationProjectNumber() {
         if (isUseUserCRPref() &&
                 userComputeResourcePreference != null &&
@@ -754,12 +741,6 @@ public class TaskContext {
 
             ctx.setGroupResourceProfile(registryClient.getGroupResourceProfile(processModel.getGroupResourceProfileId()));
 
-            ctx.setGatewayComputeResourcePreference(
-                    Optional.ofNullable(registryClient.getGatewayComputeResourcePreference(
-                            gatewayId,
-                            processModel.getComputeResourceId()))
-                            .orElseThrow(() -> new Exception("Invalid Gateway ComputeResource Preference")));
-
             ctx.setGatewayResourceProfile(
                     Optional.ofNullable(registryClient.getGatewayResourceProfile(gatewayId))
                             .orElseThrow(() -> new Exception("Invalid GatewayResourceProfile")));
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
index bb7546e..e06220e 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
@@ -190,7 +190,7 @@ public class DefaultJobSubmissionTask extends JobSubmissionTask {
                     String loadCommand = getComputeResourceDescription().getGatewayUsageModuleLoadCommand();
                     String usageExecutable = getComputeResourceDescription().getGatewayUsageExecutable();
                     ExperimentModel experiment = getRegistryServiceClient().getExperiment(getExperimentId());
-                    String username = experiment.getUserName() + "@" + getTaskContext().getGatewayComputeResourcePreference().getUsageReportingGatewayId();
+                    String username = experiment.getUserName() + "@" + getTaskContext().getGroupComputeResourcePreference().getUsageReportingGatewayId();
                     RawCommandInfo rawCommandInfo = new RawCommandInfo(loadCommand + " && " + usageExecutable + " -gateway_user " +  username  +
                             " -submit_time \"`date '+%F %T %:z'`\"  -jobid " + jobId );
                     adaptor.executeCommand(rawCommandInfo.getRawCommand(), null);