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.

[Bug] runtime_env doesn't honor env_vars first

See original GitHub issue

Search before asking

  • I searched the issues and found no similar issues.

Ray Component

Ray Clusters

What happened + What you expected to happen

I set both env_vars and pip in runtime_env, one of the pip install need to access the user-defined env during runtime, but looks like the env is not honored and pip install failed, with errors:

File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/util/client/server/proxier.py", line 234, in _create_runtime_env
    "Failed to create runtime_env for Ray client "
RuntimeError: Failed to create runtime_env for Ray client server: Failed to install conda environment /tmp/ray/session_2022-02-23_13-49-17_742804_6/runtime_resources/conda/bda0b0d51deac4d51a7063a37ecbbc2a53c9e840:
raise error
RuntimeError: java home not found, try setting JAVA_HOME

Versions / Dependencies

ray 1.9.0 python 3.7

Reproduction script

import ray,os
runtime_env = {
        "env_vars": {"JAVA_HOME": "/opt/tiger/jdk/jdk1.8"},
       "pip": ["pydoop==2.0.0",],
 }

ray.init("ray://head:port",runtime_env=runtime_env)
print(ray.cluster_resources())
#@ray.remote
#def f():
#  return os.environ.get("JAVA_HOME")

#print(ray.get(f.remote())) # this line works as expected, i.e., JAVA_HOME was set correctly


Anything else

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
grechawcommented, Feb 24, 2022

Is this an issue with pydoop installation? I verified that JAVA_HOME gets set correctly for both Ray 1.9 and 1.10… but what’s possible here is that it’s not set at the time that pip installs pydoop

0reactions
architkulkarnicommented, Mar 16, 2022

Closed by #22730

Read more comments on GitHub >

github_iconTop Results From Across the Web

Don't use environment variables for configuration | Hacker News
I've run into a spreadsheet bug where I got wrong results because of a CPU bug. Just because some global mutable state exists,...
Read more >
Problems with Environment Variables
Environment variable is not set. If the error message states that the environment variable is not set, IT MEANS PRECISELY THAT ! The...
Read more >
Setting environment variables on OS X - macos - Stack Overflow
Set environment variables here so they are available globally to all apps # (and Terminal), including those launched via Spotlight.
Read more >
Environment Variables - Remix
Environment variables are most useful at runtime on the server. ... You should not use them in production, so Remix doesn't load them...
Read more >
Spring Tips: Configuration
properties file. You can use a program argument or an environment variable to fill the spring.config.name property. export SPRING_CONFIG_NAME ...
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