question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parse environmental variables in configuration yaml file

See original GitHub issue

I would like to be able to use environmental variables in the configuration yaml file (see also here).

My use case: I am using dask on a cluster where nodes are assigned upon login, and the fast temporary storage will change depending on the particular node one is logged in. It is always identified as $TMPDIR.

Would it be possible to use a special syntax e.g. temporary-directory: (($TMPDIR)), so that dask parses the environmental variable each time a cluster/worker is started?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ig248commented, Jan 29, 2020

@jbusecke Dask already provides a function that can handle expansion of environmental variables in dask.config.expand_environment_variables(...)

It is used in some modules, e.g. here - but is not currently applied to all config. This could be a useful addition!

0reactions
jbuseckecommented, Jan 29, 2020

Thank you very much. I got swamped at work this week, but will hopefully have some time to give this a try in the next days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python YAML configuration with environment variables parsing
Load a YAML configuration file and resolve any environment variables Note: ... Python YAML configuration with environment variables parsing.
Read more >
How to replace environment variable value in yaml file to be ...
You can do it through yaml.add_implicit_resolver and yaml.add_constructor . In the code below, you are defining a resolver that will match on ${ ......
Read more >
How to use a YAML file or environment variables to populate ...
In most cases, we suggest using a config variables YAML file. YAML files make variables more visible, easily editable, and allow for modularization...
Read more >
Python YAML configuration with environment variables parsing
Parsing a YAML file that may contain environment variables for sensitive data. Example of a YAML configuration with environment variables:
Read more >
Use environment variables in the configuration - Elastic
Each variable reference is replaced at startup by the value of the environment variable. The replacement is case-sensitive and occurs before the YAML...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found