You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/10/02 13:54:10 UTC

[airavata] branch develop updated: Bug fix: Orchestrator to get resource token from GroupResourceProfile

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

machristie 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 bd04f0e  Bug fix: Orchestrator to get resource token from GroupResourceProfile
bd04f0e is described below

commit bd04f0efddb2f3be298885fe96d0bcc005dab112
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Oct 2 09:52:00 2018 -0400

    Bug fix: Orchestrator to get resource token from GroupResourceProfile
---
 .../server/OrchestratorServerHandler.java          | 39 ++++++++++------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index 03dd8ba..aac0717 100644
--- a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -34,9 +34,8 @@ import org.apache.airavata.messaging.core.*;
 import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
 import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
 import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
-import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
-import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
 import org.apache.airavata.model.appcatalog.groupresourceprofile.GroupComputeResourcePreference;
+import org.apache.airavata.model.appcatalog.groupresourceprofile.GroupResourceProfile;
 import org.apache.airavata.model.application.io.DataType;
 import org.apache.airavata.model.commons.ErrorModel;
 import org.apache.airavata.model.data.replica.DataProductModel;
@@ -149,11 +148,7 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
             }
 
 			UserConfigurationDataModel userConfigurationData = experiment.getUserConfigurationData();
-            ComputeResourcePreference computeResourcePreference = registryClient.getGatewayComputeResourcePreference
-							(gatewayId,
-							userConfigurationData.getComputationalResourceScheduling().getResourceHostId());
-            String token = computeResourcePreference.getResourceSpecificCredentialStoreToken();
-
+			String token = null;
 			final String groupResourceProfileId = userConfigurationData.getGroupResourceProfileId();
 			if (groupResourceProfileId == null) {
 				log.error("Experiment not configured with a Group Resource Profile: {}", experimentId);
@@ -166,14 +161,14 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
 				token = groupComputeResourcePreference.getResourceSpecificCredentialStoreToken();
 			}
             if (token == null || token.isEmpty()){
-                // try with gateway profile level token
-                GatewayResourceProfile gatewayProfile = registryClient.getGatewayResourceProfile(gatewayId);
-                token = gatewayProfile.getCredentialStoreToken();
+                // try with group resource profile level token
+				GroupResourceProfile groupResourceProfile = registryClient.getGroupResourceProfile(groupResourceProfileId);
+				token = groupResourceProfile.getDefaultCredentialStoreToken();
             }
             // still the token is empty, then we fail the experiment
             if (token == null || token.isEmpty()){
-                log.error("You have not configured credential store token at gateway profile or compute resource preference." +
-						" Please provide the correct token at gateway profile or compute resource preference.");
+                log.error("You have not configured credential store token at group resource profile or compute resource preference." +
+						" Please provide the correct token at group resource profile or compute resource preference.");
                 return false;
             }
             ExperimentType executionType = experiment.getExperimentType();
@@ -446,20 +441,22 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
 				return false;
 			default:
 				ExperimentModel experimentModel = registryClient.getExperiment(experimentId);
+				final UserConfigurationDataModel userConfigurationData = experimentModel.getUserConfigurationData();
+				final String groupResourceProfileId = userConfigurationData.getGroupResourceProfileId();
 
-                ComputeResourcePreference computeResourcePreference = registryClient.getGatewayComputeResourcePreference
-                        (gatewayId,
-                                experimentModel.getUserConfigurationData().getComputationalResourceScheduling().getResourceHostId());
-                String token = computeResourcePreference.getResourceSpecificCredentialStoreToken();
+				GroupComputeResourcePreference groupComputeResourcePreference = registryClient.getGroupComputeResourcePreference(
+						userConfigurationData.getComputationalResourceScheduling().getResourceHostId(),
+						groupResourceProfileId);
+                String token = groupComputeResourcePreference.getResourceSpecificCredentialStoreToken();
                 if (token == null || token.isEmpty()){
-                    // try with gateway profile level token
-                    GatewayResourceProfile gatewayProfile = registryClient.getGatewayResourceProfile(gatewayId);
-                    token = gatewayProfile.getCredentialStoreToken();
+                    // try with group resource profile level token
+					GroupResourceProfile groupResourceProfile = registryClient.getGroupResourceProfile(groupResourceProfileId);
+                    token = groupResourceProfile.getDefaultCredentialStoreToken();
                 }
                 // still the token is empty, then we fail the experiment
                 if (token == null || token.isEmpty()){
-                    log.error("You have not configured credential store token at gateway profile or compute resource preference." +
-                            " Please provide the correct token at gateway profile or compute resource preference.");
+                    log.error("You have not configured credential store token at group resource profile or compute resource preference." +
+                            " Please provide the correct token at group resource profile or compute resource preference.");
                     return false;
                 }