RANGER-5554: Refactor Ranger Admin bootstrap to use runtime XML config only#920
RANGER-5554: Refactor Ranger Admin bootstrap to use runtime XML config only#920kumaab wants to merge 10 commits into
Conversation
…using ENV var - tested across all flavors
| # valid values for RANGER_DB_TYPE: mysql/postgres/oracle | ||
| ~~~ | ||
|
|
||
| - The Ranger Admin container uses `scripts/admin/ranger-admin-site.xml` for all database flavors. The file defaults to PostgreSQL and includes commented MySQL and Oracle blocks; uncomment the matching block and comment the other database flavor settings before starting the stack. |
There was a problem hiding this comment.
Instead of requiring the deployer to update ranger-admin-site.xml, consider having multiple ranger-admin-site.xml files, one for each DB flavor, and copy the appropriate one to conf/ranger-admin-site.xml during initialization of the container.
| import re | ||
| import xml.etree.ElementTree as ET | ||
|
|
||
| DEFAULT_RANGER_ADMIN_SITE_CANDIDATES = ( |
There was a problem hiding this comment.
Instead of programmatically updating ranger-admin-site.xml, consider having multiple ranger-admin-site.xml files, one for each DB flavor, and copy the appropriate one to conf/ranger-admin-site.xml during initialization of the container. With this approach, this file will no more be required.
| configure_logging() | ||
|
|
||
| bootstrap = UserPasswordBootstrap(DEFAULT_BASE_URL) | ||
| return bootstrap.run( |
There was a problem hiding this comment.
Built-in accounts like admin, rangerusersync, rangertagsync are created during database schedma initialization, right? Without admin account already in place, this script wouldn't work - due to failure in line 84. What is the purpose of this script?
| import logging | ||
| import os | ||
|
|
||
|
|
There was a problem hiding this comment.
I suggest replacing this file (log_config.py) with addition of following line at the begining of create_ranger_services.py:
logging.basicConfig(level=logging.INFO,
format="%(asctime)s %(levelname)-6s %(message)s",
handlers=(logging.StreamHandler(), logging.FileHandler('create_ranger_services.log')))
What changes were proposed in this pull request?
Refactors the ranger-admin Docker bootstrap flow to use runtime
XMLconfiguration and environment variables instead of the legacy installer path (setup.sh,install.properties, and related setup scripts).Key changes:
ranger-admin-site.xmlXMLconfig handling, password bootstrap, and loggingdocker compose, eliminates hardcoded passwords in.xmlfile.UserPasswordBootstrapand DB specific classes indba.pyfor maintainability and readability.ranger-admin-install-postgres/mysql/oracle.propertiesranger.shto prepare runtime config, wait for DB readiness, seed initial passwords, and bootstrap servicesHow was this patch tested?
Pending