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.

Add documentation for setting environment variables (e.g. for installing extra packages)

See original GitHub issue

I could be wrong, but this seems like a fairly important detail in some deployments. Creating custom OS images with Packer is obviously better but that’s a fairly high bar for a lot of users, probably. I found that this is currently supported with the following caveats:

  1. It cannot be configured in cloudprovider.yaml or environment variables on the client (i.e. DASK_CLOUDPROVIDER__GCP__ENV_VARS would be ignored)
  2. If passed directly in code, it must be quoted. For example, GCPCluster(..., env_vars=dict(EXTRA_CONDA_PACKAGES="numba xarray")) will not work because the render code (here) does not quote values and since the docker run statement built is already being yaml-escaped via single quotes, the values must be double quoted. The variables must be passed like this: EXTRA_CONDA_PACKAGES="\"numba xarray\"", not EXTRA_CONDA_PACKAGES="'numba xarray'".

Documentation for new users on this would be very helpful. Allowing the env_vars to come from cloudprovider.yaml would also be nice.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
jacobtomlinsoncommented, Nov 19, 2020

Have you used mamba much yet?

A little, it seems nice. I think the performance increases here will help things, but my worry is about reproducibility. The times I’ve tried to dump out a conda environment and recreate it recently have failed because packages go missing from anaconda.org. Especially when developing on nighly builds.

Thing conversation reminds me of this meme.

It works on my machine docker meme

0reactions
eric-czechcommented, Nov 18, 2020

Things like Python, Conda, Git, Bash, etc. All of these are necessary tools in order to do your craft. I personally feel like Docker has joined that list in the last few years and learning it is part of the cost of doing business. However, I also feel like as a community we should be making this list smaller, not larger.

Nicely put. Smaller would be great but maybe the need for tools with layered complexity (e.g. numpy -> dask -> xarray) is inevitable to meet the maximum sophistication of a larger number of users. I always imagine that scientists collect at the ends of those spectrums though – I wonder how true that is.

Projects like repo2docker exist to try and create a simple bridge from conda to docker. Perhaps we should also create something like repo2machine which continues to the level that packer does.

Oh interesting, had not seen that before. I like the caching metaphor. It still surprises me a bit that installation of compiled packages via conda can’t be made to be faster than the download and execution of an entire containerized OS image that contains all those same packages. Have you used mamba much yet? I have not at all, but I’m curious if you see that as likely to close the gap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Topics in Packaging — Spack Tutorial documentation
Set environment variables in dependent packages at build-time¶. Dependencies can set environment variables that are required when their dependents build. For ...
Read more >
Environment variables in Compose | Docker Documentation
You can set default values for environment variables using a .env file, which Compose automatically looks for in project directory (parent folder of...
Read more >
Custom options and environment — Dataiku DSS 11 ...
The options for pip, virtualenv, R and conda can be found in the relevant documentation. ... You can apply regular pip, virtualenv or...
Read more >
Introduction to environment variables - CircleCI
Use environment variables to set up various configuration options, and keep your ... delete the current variable, and add it again with the...
Read more >
Use environment variables in solutions - Power Apps
Select Settings > General and enable the setting to Automatically create environment variables when adding data sources. Add a New data ...
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