airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [35/35] airavata git commit: AIRAVATA-2500 Added additional info field for SSH Account Provisioners
Date Tue, 19 Sep 2017 19:09:32 GMT
AIRAVATA-2500 Added additional info field for SSH Account Provisioners

This field is meant to contain additional information or instructions to
the user. First use case is to give user information on how to obtain a
cluster account when the SSHAccountProvisioner is not able to
automatically create the account.


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

Branch: refs/heads/AIRAVATA-2500
Commit: 71d33eafe2fadda66ecd33aeb2a8415f7f67bcb1
Parents: 31f3906
Author: Marcus Christie <machristie@apache.org>
Authored: Thu Sep 7 14:47:06 2017 -0400
Committer: Marcus Christie <machristie@apache.org>
Committed: Tue Sep 19 15:08:05 2017 -0400

----------------------------------------------------------------------
 .../app/catalog/impl/GwyResourceProfileImpl.java  |  2 ++
 .../catalog/model/ComputeResourcePreference.java  | 10 ++++++++++
 .../resources/ComputeHostPreferenceResource.java  | 18 +++++++++++++++---
 .../core/app/catalog/util/AppCatalogJPAUtils.java |  1 +
 .../catalog/util/AppCatalogThriftConversion.java  |  1 +
 .../src/main/resources/appcatalog-derby.sql       |  1 +
 .../src/main/resources/appcatalog-mysql.sql       |  1 +
 .../DeltaScripts/appCatalog_schema_delta.sql      |  1 +
 .../gateway_resource_profile_model.thrift         |  3 ++-
 9 files changed, 34 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
index 78a6f0f..aba25c7 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/GwyResourceProfileImpl.java
@@ -94,6 +94,7 @@ public class GwyResourceProfileImpl implements GwyResourceProfile {
                         Map<String,String> sshAccountProvisionerConfigurationsCopy
= new HashMap<>(preference.getSshAccountProvisionerConfig());
                         resource.setSshAccountProvisionerConfigurations(sshAccountProvisionerConfigurationsCopy);
                     }
+                    resource.setSshAccountProvisionerAdditionalInfo(preference.getSshAccountProvisionerAdditionalInfo());
                     resource.save();
                 }
             }
@@ -164,6 +165,7 @@ public class GwyResourceProfileImpl implements GwyResourceProfile {
                         Map<String,String> sshAccountProvisionerConfigurationsCopy
= new HashMap<>(preference.getSshAccountProvisionerConfig());
                         resource.setSshAccountProvisionerConfigurations(sshAccountProvisionerConfigurationsCopy);
                     }
+                    resource.setSshAccountProvisionerAdditionalInfo(preference.getSshAccountProvisionerAdditionalInfo());
                     resource.save();
                 }
             }

http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
index 20f55d4..67402f4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/ComputeResourcePreference.java
@@ -62,6 +62,8 @@ public class ComputeResourcePreference {
     private Timestamp reservationEndTime;
     @Column(name = "SSH_ACCOUNT_PROVISIONER")
     private String sshAccountProvisioner;
+    @Column(name = "SSH_ACCOUNT_PROVISIONER_ADDITIONAL_INFO")
+    private String sshAccountProvisionerAdditionalInfo;
 
 
     @ManyToOne(cascade= CascadeType.MERGE)
@@ -227,4 +229,12 @@ public class ComputeResourcePreference {
     public void setSshAccountProvisionerConfigurations(Collection<SSHAccountProvisionerConfiguration>
sshAccountProvisionerConfigurations) {
         this.sshAccountProvisionerConfigurations = sshAccountProvisionerConfigurations;
     }
+
+    public String getSshAccountProvisionerAdditionalInfo() {
+        return sshAccountProvisionerAdditionalInfo;
+    }
+
+    public void setSshAccountProvisionerAdditionalInfo(String sshAccountProvisionerAdditionalInfo)
{
+        this.sshAccountProvisionerAdditionalInfo = sshAccountProvisionerAdditionalInfo;
+    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
index 1320025..7203009 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/ComputeHostPreferenceResource.java
@@ -55,6 +55,7 @@ public class ComputeHostPreferenceResource extends AppCatAbstractResource
{
     private Timestamp reservationEndTime;
     private String sshAccountProvisioner;
     private Map<String,String> sshAccountProvisionerConfigurations;
+    private String sshAccountProvisionerAdditionalInfo;
 
     private GatewayProfileResource gatewayProfile;
     private ComputeResourceResource computeHostResource;
@@ -215,6 +216,14 @@ public class ComputeHostPreferenceResource extends AppCatAbstractResource
{
         this.sshAccountProvisionerConfigurations = sshAccountProvisionerConfigurations;
     }
 
+    public String getSshAccountProvisionerAdditionalInfo() {
+        return sshAccountProvisionerAdditionalInfo;
+    }
+
+    public void setSshAccountProvisionerAdditionalInfo(String sshAccountProvisionerAdditionalInfo)
{
+        this.sshAccountProvisionerAdditionalInfo = sshAccountProvisionerAdditionalInfo;
+    }
+
     @Override
     public void remove(Object identifier) throws AppCatalogException {
         HashMap<String, String> ids;
@@ -456,6 +465,7 @@ public class ComputeHostPreferenceResource extends AppCatAbstractResource
{
                 } else {
                     existingPreference.setSshAccountProvisionerConfigurations(null);
                 }
+                existingPreference.setSshAccountProvisionerAdditionalInfo(sshAccountProvisionerAdditionalInfo);
                 em.merge(existingPreference);
             } else {
                 ComputeResourcePreference resourcePreference = new ComputeResourcePreference();
@@ -476,15 +486,17 @@ public class ComputeHostPreferenceResource extends AppCatAbstractResource
{
                 resourcePreference.setReservation(reservation);
                 resourcePreference.setReservationStartTime(reservationStartTime);
                 resourcePreference.setReservationEndTime(reservationEndTime);
-                existingPreference.setSshAccountProvisioner(sshAccountProvisioner);
+                resourcePreference.setSshAccountProvisioner(sshAccountProvisioner);
                 if (sshAccountProvisionerConfigurations != null && !sshAccountProvisionerConfigurations.isEmpty()){
                     List<SSHAccountProvisionerConfiguration> configurations = new ArrayList<>();
                     for (String sshAccountProvisionerConfigName : sshAccountProvisionerConfigurations.keySet())
{
                         String value = sshAccountProvisionerConfigurations.get(sshAccountProvisionerConfigName);
-                        configurations.add(new SSHAccountProvisionerConfiguration(sshAccountProvisionerConfigName,
value, existingPreference));
+                        configurations.add(new SSHAccountProvisionerConfiguration(sshAccountProvisionerConfigName,
value, resourcePreference));
                     }
-                    existingPreference.setSshAccountProvisionerConfigurations(configurations);
+                    resourcePreference.setSshAccountProvisionerConfigurations(configurations);
                 }
+                resourcePreference.setSshAccountProvisionerAdditionalInfo(sshAccountProvisionerAdditionalInfo);
+
                 em.persist(resourcePreference);
             }
             em.getTransaction().commit();

http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
index f794078..c41e8a2 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogJPAUtils.java
@@ -965,6 +965,7 @@ public class AppCatalogJPAUtils {
                 }
                 resource.setSshAccountProvisionerConfigurations(sshAccountProvisionerConfigurations);
             }
+            resource.setSshAccountProvisionerAdditionalInfo(o.getSshAccountProvisionerAdditionalInfo());
         }
         return resource;
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
index 1a85454..09258a2 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
@@ -880,6 +880,7 @@ public class AppCatalogThriftConversion {
             Map<String, String> sshAccountProvisionerConfigCopy = new HashMap<>(resource.getSshAccountProvisionerConfigurations());
             preference.setSshAccountProvisionerConfig(sshAccountProvisionerConfigCopy);
         }
+        preference.setSshAccountProvisionerAdditionalInfo(resource.getSshAccountProvisionerAdditionalInfo());
         return preference;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
index df4ebb1..c57549e 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-derby.sql
@@ -357,6 +357,7 @@ CREATE TABLE COMPUTE_RESOURCE_PREFERENCE
         RESERVATION_START_TIME timestamp,
         RESERVATION_END_TIME timestamp,
         SSH_ACCOUNT_PROVISIONER VARCHAR(255),
+        SSH_ACCOUNT_PROVISIONER_ADDITIONAL_INFO VARCHAR(1000),
         PRIMARY KEY(GATEWAY_ID,RESOURCE_ID),
         FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE,
         FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY_PROFILE(GATEWAY_ID) ON DELETE CASCADE

http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
index 54886b1..6c07499 100644
--- a/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/appcatalog-mysql.sql
@@ -356,6 +356,7 @@ CREATE TABLE COMPUTE_RESOURCE_PREFERENCE
         RESERVATION_START_TIME timestamp,
         RESERVATION_END_TIME timestamp,
         SSH_ACCOUNT_PROVISIONER VARCHAR(255),
+        SSH_ACCOUNT_PROVISIONER_ADDITIONAL_INFO VARCHAR(1000),
         PRIMARY KEY(GATEWAY_ID,RESOURCE_ID),
         FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE,
         FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY_PROFILE(GATEWAY_ID) ON DELETE CASCADE

http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
----------------------------------------------------------------------
diff --git a/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
b/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
index bf31b6b..36fc66b 100644
--- a/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
+++ b/modules/registry/release-migration-scripts/0.18-0.19/DeltaScripts/appCatalog_schema_delta.sql
@@ -19,6 +19,7 @@
 --
 
 alter table COMPUTE_RESOURCE_PREFERENCE add SSH_ACCOUNT_PROVISIONER VARCHAR(255);
+alter table COMPUTE_RESOURCE_PREFERENCE add SSH_ACCOUNT_PROVISIONER_ADDITIONAL_INFO VARCHAR(1000);
 
 CREATE TABLE SSH_ACCOUNT_PROVISIONER_CONFIG
 (

http://git-wip-us.apache.org/repos/asf/airavata/blob/71d33eaf/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift
b/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift
index 87ca433..7280850 100644
--- a/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift
+++ b/thrift-interface-descriptions/data-models/resource-catalog-models/gateway_resource_profile_model.thrift
@@ -77,7 +77,8 @@ struct ComputeResourcePreference {
     13: optional i64 reservationStartTime,
     14: optional i64 reservationEndTime,
     15: optional string sshAccountProvisioner,
-    16: optional map<string, string> sshAccountProvisionerConfig
+    16: optional map<string, string> sshAccountProvisionerConfig,
+    17: optional string sshAccountProvisionerAdditionalInfo
 }
 
 struct StoragePreference {


Mime
View raw message