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.

[runtime env] Can we avoid merging two runtime envs?

See original GitHub issue

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Description

In current design, the actor level runtime env can inherit job level runtime env, like: If the job level runtime env is:

{
   "py_modules": "s3://ab.zip",
    "pip": ["requests", "pendulum==2.1.2"],
    "env_vars":{
        "a":"b",
    }
}

and if the actor level runtime env is:

{
   "py_modules": "s3://cd.zip",
    "env_vars":{
        "c":"d",
    }
}

The final merged runtime env for actor is:

{
   "py_modules": "s3://cd.zip",
    "pip": ["requests", "pendulum==2.1.2"],
    "env_vars":{
        "a":"b",
        "c":"d",
    }
}

More details we can see https://github.com/ray-project/ray/blob/master/src/ray/core_worker/core_worker.cc#L1355 and https://github.com/ray-project/ray/blob/master/src/ray/core_worker/test/core_worker_test.cc#L937.

Do we have some reasons to support this logic? I think this logic is not clear and brings some complexity. Can we make it easier? Like:

  • If there is no runtime env option when we create actor, inherit the job level runtime env.
  • Otherwise, use the actor runtime env directly and don’t do the merging.
  • We also can give a new API to help users getting job level runtime env if needed.

Use case

No response

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:21 (21 by maintainers)

github_iconTop GitHub Comments

2reactions
rkooo567commented, Jan 19, 2022

I also prefer to follow the proposed logic. It seems to be unstraightforward some values are inherited when runtime envs are given to actors (with the current style, it is hard to know what is the exact runtime env when reading code). Maybe we can alternatively do

Actor.options(runtime_env=get_parent_runtime_env.update({"X": "Y"}))

? This seems a lot more explicit and less magic for user perspective.

1reaction
SongGuyangcommented, Jan 21, 2022

But if we do that, we will change the behavior of current runtime env API. So, it makes sense to create the RRC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment Dependencies — Ray 2.2.0
Runtime environments can be used on top of the prepared environment from the Ray Cluster launcher if it was used. For example, you...
Read more >
Handling runtime environment variables in create-react-apps
A new package called runtime-env-cra allows you to handle environment variables in quick and easy way with create-react-apps.
Read more >
Passing environment-dependent variables in webpack
I think NODE_ENV can be used to configure for (1) at build time but how do we configure for (2) at deployment, e.g....
Read more >
Environment variables in build environments - AWS CodeBuild
AWS CodeBuild provides several environment variables that you can use in your build commands: ... The identifier of the merge commit used for...
Read more >
Environments and deployments - GitLab Docs
Introduced in GitLab 11.10. You can configure environments to stop when a merge request is merged or closed. This stop trigger is automatically...
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