Skip to content

Added support for expanding environment variables in configuration files.#378

Open
gorkemmulayim wants to merge 6 commits into
prestodb:masterfrom
gorkemmulayim:master
Open

Added support for expanding environment variables in configuration files.#378
gorkemmulayim wants to merge 6 commits into
prestodb:masterfrom
gorkemmulayim:master

Conversation

@gorkemmulayim
Copy link
Copy Markdown
Contributor

@gorkemmulayim gorkemmulayim commented Feb 19, 2019

Closes #329

Added support for expanding environment variables in configuration files.

For example:

Given an example node.properties files

node.environment=${ENV}
node.data-dir=/var/lib/presto/data
node.launcher-log-file=/var/log/presto/launcher.log
node.server-log-file=/var/log/presto/server.log
catalog.config-dir=/etc/presto/catalog
plugin.dir=/usr/lib/presto/lib/plugin

application can now resolve variable defined by ${ENV} from environment variables.

  • Definitions of a variable are ${variableName} or $variableName. In addition to this, on Windows, %variableName% definition is supported as well.
  • In case of an invalid or non existing variable definition, variable is left unchanged.

Copy link
Copy Markdown
Contributor

@kokosing kokosing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of automation failures.

Comment thread tests/unit/test_config.py
config_file = os.path.join(DIR, 'resources', 'environment_variable.properties')
conf = config.get_conf_from_properties_file(config_file)
self.assertTrue(environment_variables.called)
self.assertEqual({'a': 'environment_variable_value'}, conf)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have an real test that is using actual environment variable, to see the configuration with expanded environment variables.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply. I will work on this as well as automation failures.

@kokosing
Copy link
Copy Markdown
Contributor

kokosing commented Mar 4, 2019

@rootG Please ping once you done with your changes.

@ddcprg
Copy link
Copy Markdown

ddcprg commented Sep 17, 2021

this PR seems quite old. Is anyone going to revive it? @kokosing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make worker configuration be different on each node

3 participants