Skip to content
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

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

gorkemmulayim
Copy link
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
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.

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
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
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
Contributor

kokosing commented Mar 4, 2019

@rootG Please ping once you done with your changes.

@ddcprg
Copy link

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