You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airavata.apache.org by GitBox <gi...@apache.org> on 2020/06/17 11:03:59 UTC

[GitHub] [airavata] vivekshresta opened a new pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

vivekshresta opened a new pull request #255:
URL: https://github.com/apache/airavata/pull/255


   This is the first cut as part of EPIC: https://issues.apache.org/jira/browse/AIRAVATA-3315. Any newly created UserStorageQuota entry for an existing StoragePreference has the value 0. 0 in the backend would mean the admin does not want any quotas/limitations for his users.
   
   When this is the case, the frontend, instead of displaying the value 0, displays "N/A" letting know the client that there are no storage restrictions in the Gateway.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airavata] vivekshresta commented on pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

Posted by GitBox <gi...@apache.org>.
vivekshresta commented on pull request #255:
URL: https://github.com/apache/airavata/pull/255#issuecomment-664742094


   > Looks good @vivekshresta
   
   Hi @machristie , 
   Can you please merge this PR. Reaching out to you since I do not have the necessary permissions yet to merge the changes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airavata] machristie commented on a change in pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

Posted by GitBox <gi...@apache.org>.
machristie commented on a change in pull request #255:
URL: https://github.com/apache/airavata/pull/255#discussion_r441634972



##########
File path: modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
##########
@@ -24,3 +24,18 @@ use app_catalog;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_START_TIME;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_END_TIME;
+
+-- AIRAVATA-3343: Add UserStorageQuota entry to StoragePreferences table
+SET @AddUserStorageQuota = (SELECT IF(

Review comment:
       This is good, but I think it would be more readable to use the `ALTER TABLE <table name> ADD COLUMN IF NOT EXISTS` instead. I know that won't work for ide-integration since it relies on a MySQL container, but I plan to update that soon. But these release-migration-scripts we only run against MariaDB databases where IF NOT EXISTS is supported.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airavata] vivekshresta commented on a change in pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

Posted by GitBox <gi...@apache.org>.
vivekshresta commented on a change in pull request #255:
URL: https://github.com/apache/airavata/pull/255#discussion_r442577364



##########
File path: modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
##########
@@ -24,3 +24,18 @@ use app_catalog;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_START_TIME;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_END_TIME;
+
+-- AIRAVATA-3343: Add UserStorageQuota entry to StoragePreferences table
+SET @AddUserStorageQuota = (SELECT IF(

Review comment:
       Now I understand! Thank you for letting me know.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airavata] vivekshresta commented on pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

Posted by GitBox <gi...@apache.org>.
vivekshresta commented on pull request #255:
URL: https://github.com/apache/airavata/pull/255#issuecomment-658293329


   Hi @machristie ,
   
   As discussed, I'm merging all my changes to a feature branch(AIRAVATA-3315-storage-quotas). Please let me know if you want me to change anything else.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airavata] vivekshresta commented on a change in pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

Posted by GitBox <gi...@apache.org>.
vivekshresta commented on a change in pull request #255:
URL: https://github.com/apache/airavata/pull/255#discussion_r441915178



##########
File path: modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
##########
@@ -24,3 +24,18 @@ use app_catalog;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_START_TIME;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_END_TIME;
+
+-- AIRAVATA-3343: Add UserStorageQuota entry to StoragePreferences table
+SET @AddUserStorageQuota = (SELECT IF(

Review comment:
       Thanks for reviewing my code. I agree that the query isn't very readable, but sadly, as you've pointed out, unlike mariadb, mysql does not have the 'IF NOT EXISTS' syntax. 
   
   Changing this query to a more readable MariaDB syntax throws an Error during docker-compose. One thing I can do is, write the new query and comment it, and once the migration is successful, I can remove the current complex query and uncomment the new one. Or the other approach I can think of is, remove the complex query and add a commented 'alter table STORAGE_PREFERENCE IF NOT EXISTS' query which can be uncommented when the migration is successfully merged. Please let me know if there's any better approach.
   
   'But these release-migration-scripts we only run against MariaDB databases where IF NOT EXISTS is supported.' - Do you mean to say in the future, these migration-scripts will only be run against MariaDB?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airavata] machristie merged pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

Posted by GitBox <gi...@apache.org>.
machristie merged pull request #255:
URL: https://github.com/apache/airavata/pull/255


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airavata] machristie commented on pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

Posted by GitBox <gi...@apache.org>.
machristie commented on pull request #255:
URL: https://github.com/apache/airavata/pull/255#issuecomment-660702731


   Looks good @vivekshresta 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airavata] machristie commented on a change in pull request #255: Changes to accommodate UserStorageQuota in StoragePreferences

Posted by GitBox <gi...@apache.org>.
machristie commented on a change in pull request #255:
URL: https://github.com/apache/airavata/pull/255#discussion_r442489604



##########
File path: modules/registry/release-migration-scripts/next/DeltaScripts/appCatalog_schema_delta.sql
##########
@@ -24,3 +24,18 @@ use app_catalog;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_START_TIME;
 alter table GROUP_COMPUTE_RESOURCE_PREFERENCE drop column IF EXISTS RESERVATION_END_TIME;
+
+-- AIRAVATA-3343: Add UserStorageQuota entry to StoragePreferences table
+SET @AddUserStorageQuota = (SELECT IF(

Review comment:
       So we have migration scripts for production MariaDB databases, thats what release-migration-scripts is. Then there are migration scripts in ide-integration, the 0*-migrations.sql scripts are.  So yes, in the 0*-migrations.sql script, IF NOT EXISTS won't work as you point out, but we can use IF NOT EXISTS in release-migration-scripts.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org