-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modular Acls: ETL Support #97
Merged
Merged
Commits on Jun 28, 2017
-
- Added all files / code required to support the ACL ETL process. - Added documentation where appropriate ETL Table Definitions (Creation / Management of Tables): - configuration/etl/etl_tables.d/acls/*.json ETL SQL Files ( Initial Population of Tables ) - configuration/etl/etl_sql.d/acls/xdmod/*.sql ETL Pipelines: - configuration/etl/etl.d/acls-xdmod-import.json - responsible for the import / population of acl tables. - configuration/etl/etl.d/acls-xdmod-management.json - responsible for the creation / management of the acl tables. bash scripts: - bin/acl-xdmod-import - provides users with a wrapper around the acls-xdmod-import pipeline. - bin/acl-xdmod-management - provides users with a wrapper around the acls-xdmod-management pipeline. xdmod-setup Menu Items: - Acl Setup: XDMoD - gathers information from the user and calls bin/acl-xdmod-import reports any errors encountered. - Acl Import: XDMoD - gathers information from the user and calls bin/acl-xdmod-management reports any errors encountered. Documentation: - Each SQL statement is documented as to it's purpose and when it should be executed. - Added overview documentation for the tables being added - Added documentation that explains the new xdmod-setup Menu Items.
Configuration menu - View commit details
-
Copy full SHA for d451aa5 - Browse repository at this point
Copy the full SHA d451aa5View commit details
Commits on Jun 29, 2017
-
Initial Commit of Acl Configuration Tool
- This tool transforms information stored in human readable configuration files ( roles.json and datawarehouse.json ) into a database representation that can be referenced by the system at run time. - It provides the ability to perform basic validation of the configuration files that it uses. Communicating to the user when an invalid file has been found. - It also provides a 'dryrun' option which allows a user to see which records will be added to their database without actually inserting them. - Added a help option that displays the general usage of acl-config along with the various options both short and long with a brief description of each. - Added a function to Packager.php that will create a directory (modules.d) / file ( <module_name>.json ) that contains information from a modules build.json file. This enables information from build.json to outlive the Packaging process and to signal that a particular module is installed. New Helper Class: Roles - This class's sole purpose for being is to expose various private portions of the abstract class aRole that are needed for consistent use of Config ( i.e. the 'extend' functionality ). - Also provides a 'module' aware version of 'getConfig' that will only retrieve the values from a particular 'modules' files instead of the amalgamated whole. Placeholder json file for new modules config category - Need at least an empty json document for our merging config file system to work properly. This one is for modules.d. Adding modules.json to be included when xdmod is packaged - Added modules.json to the list of files to be included when the module 'xdmod' is packaged. Cleaning Up acls-xdmod-management ETL Pipeline - Removed statistics_hierarchy as it doesn't exist anymore. - Removed second instance of module_versions as it doesn't need to be processed twice. Adding 'type' to the set of sections processed for roles - We also want to retrieve information on type as this has been added to ccr-private-xdmod/conf.d/modules/xsede/configuration/roles.json Rework the way in which the data gathered - Reworked the way in which data is gathered for both roles and datawarehouse. It should now be guaranteed that the information in each '$module' section is information that only pertains to that module, not the merged whole. Make sure xdmod ( default module ) is processed first - Since it's imperative that the default module be processed before other 3rd party modules. To that end the algorithm for processing a module was extracted into its own function. Now we can test for the existence of default module, processing it first / removing it from the results which can be processed as normal. Adding the acl-* scripts in the bin directory - added acl-config and acl-xdmod-management to the files list for rpm builds. Added a warning to not modify the auto-generated file. - Added a warning to the auto-generated file so that users know not to modify the file. Or at least if they do that it's at their own risk. - Added a conditional to acl-config to strip the newly added warning message from the modules data. Updated installed_on -> packaged_on - Updated per conversation with @jtpalmer Updated createModuleFile to use CCR\Json - swapped out file_put_contents for \CCR\Json::saveFile as we get pretty printing and error handling this way. Removed processModuleFiles as it is no longer needed - the purpose of processModuleFiles was to process module specific templates, allowing the injection of information contained within build.json ( module name, version etc. ) into data that would then be consumed by some sort of etl process. Now that we're generating files for each module (modules.d/<module>.json) this feature is no longer required. Adding a new configuration directory / file - Added a configuration directory / file set and the corresponding section to utilize it in acl-config. This new section is hierarchies.json/hierarchies.d. The contents of which will be processed into the 'hierarchies' table. - There are some accompanying changes in ccr-private xdmod to roles to support acl_hierarchies records. *** ( changes inadvertently squashed into this commit ) - Removed the json data files that are no longer needed ( etl/etl_data.d/acls/xdmod/*.json ). - Removed PackagerTemplatingTest.php as the function is no longer being used / has been removed. *** NOTES: These changes were added after going through which acl tables were populated via which configuration files: - modules.json - modules - module_versions - datawarehouse.json - realms - group_bys - statistics - *acl_group_bys ( via being referenced when processing roles.json) - roles.json - acls - tabs - acl_tabs - *acl_group_bys ( utilizing information from datawarehouse.json ) The following tables are populated via sql scripts on install / upgrade and via the system thereafter ( i.e. we have no concept of these tables being modified via a config file ). - user_acls - user_acl_group_by_parameters ( UserRoleParameters ) This left the following tables that needed to be populated: - hiearchies - acl_types - acl_hierarchies Of these three, two can be handled by incorporating some additional data into the roles.json file (as they're related to acls, acl_types and acl_hierarchies). This leaves hiearchies, which we now populate via: - configuration/hierarchies.[d|json] So net change for a module writer is some additional information in roles.json and one new file ( if their module has any hierarchies it utilizes ). acl-* script changes - re-added acl-import due to needing to populate two tables via sql script: - user_acls - user_acl_group_by_parameters - ultimately re-wrote acl-import / acl-xdmod-management to be based off of the bash3boilerplate project. This provides some nice logging, arg parsing, error handling functionality that we don't have to maintain / think about. - b3bp file main.sh kept in a new dir bin/deps - ripped out the duplicated code in acl-import / acl-xdmod-management and placed it in a 'parent' script called 'acl-etl' located in bin/deps - fixed syntax error in acl-config: missing semi - removed unused sql: update_module_version.sql Modified acl-import ETL pipeline - no longer using the structured file imports but we do have a few sql files. - modified the defaults to reflect no longer using StructuredFileInstor but instead using the ExecuteSql. - Removed all actions that are no longer being used which leaves: - user_acls.sql - user_acl_group_by_parameters.sql Added a DatabaseMigration from 6.6.0 to 7.0.0 - This migration executes acl-xdmod-management, acl-import and acl-config in the to ensure that the database tables are setup / populated correctly. Added a new AclConfig Setup Item / Removed unused - Added a new SetupItem that handles executing the acl-config script. This new item was appended to the end of the DatabaseSetup section. - Removed a DatabaseMigration that is no longer used. Acl Documentation Update - Updated the Acl documentation to bring it up to date. Changed the order in which the Acl steps run - AclConfig is responsible for populating the definition tables and as such needs to be executed *before* AclImport which populates some of the relation tables. Updates per code review comments by @smgallo - Changed '-r|--dryrun' to '-t|--dryrun'. - Code format cleanup to surround string concat operations with spaces. - removed empty comment in acls-import.json - Updated 'boolean' column declarations to utilize 'tinyint(1)' Updating acl-config linker require - Replacing with the standard linker path used in the other php scripts in this directory. This is so that it is replaced with the appropriate value during the install process. Ensure verifyJsonSyntax checks for existence - Before trying to read either the config file or config dir, ensure the file / dir exists then proceed with the required operations. Updated acl scripts - removed bash script deps directory as it is no longer needed - add acl-etl which serves as a basic wrapper script for running sections - update acl-[import|xdmod-management] to be php scripts instead of bash. They now call acl-etl with their respective sections. - Simplified the logic in Acl[Config|Import].php Fixing up issues with acl-config - Just making the script more robust / taking care of a few things like missing global includes. relaxing the memory_limit for etl_verseer - Ran into memory exceptions while testing the acls-import / acls-xdmod-management sections. removing the ini_set('memory_limit') - Steve is looking at introducing a fix for the underlying memory jump problem in EtlLock.php. This won't need to be here once that goes in. Updating the DatabaseMigration for 660to770 - Updated to use the new style scripts - Updated the order in which the tables are populated ( i.e. the order the scripts are executed.) Updating DatabaseMigration name - Migration doesn't work when it's not named correctly. Updated the comment stripping for ExecuteSql - Per conversation with @smgallo, removing c-style comments so that we don't accidentally strip query hints. Updates to 660To700 Database Migration - Updated the name so that it's actually executed during xdmod-upgrade - Updated the logging levels so that users will actually see the logging when appropriate - added an abnormal exit if the script encounters an error so that the process can be attempted again after the issue is resolved. Updates to acl-config and roles.json - Added a section to acl-config that ensures that the public user is present in the system. - Updated roles.json with the additional information required for the acl population process. Updating the acl-import / xdmod-acl-management scripts per @jpwhite4 review comments: - Changing the convenience scripts acl-import / xdmod-acl-management to simple bash scripts. - Updated the calling of the convenience scripts so that they no longer provide additional arguments as none are needed. Removing unused TestHelper function - The only test that utilized this function is no longer present. Removing Public User Code - Having a database representation of Public User needs code changes to operate correctly. The removed code will be re-added to acl_xduser. Adding acl specific changes to the xdmod-setup expect script - Adding the lines required to handle the updated Database section of xdmod-setup. re-added jobs_*.json - jobs_hpc.json had the XdcdbJobRecordIngestor section removed as the specified db (tgcdbmirror) is not currently available in open xdmod installs. Updates to jobs_* pipelines - renamed jobs_hpc to jobs_common - renamed the xdcdb-jobs pipline -> jobs-common - removed the files that the xsede specific actions utilized as they are no longer needed here. Updating the default section name - need to update the pipeline defaults so that it references jobs-common as opposed to xdcdb-jobs.
Configuration menu - View commit details
-
Copy full SHA for eae7356 - Browse repository at this point
Copy the full SHA eae7356View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.