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] API refactor

See original GitHub issue

Search before asking

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

Description

1、Can we make the runtime env API strong-typed instead of a json or dict?

In python now, we provide runtime env API which is a dict. We need to do a lot validation logics here https://github.com/ray-project/ray/blob/master/python/ray/_private/runtime_env/validation.py. And If we support runtime env cross-language API, the validation code will be more complex and it couldn’t be reused in Java and C++. Can we make the runtime env API strong-typed instead of a json or dict? If we do, I think runtime env will be clearer and easy to maintain. Maybe the strong-typed API is like:

runtime_env = RuntimeEnvBuilder.set_env_vars({"a": "b"}).set_pip_packages(["requests", "pendulum==2.1.2"]).build()
ray.init(runtime_env=runtime_env)

The cross-language API is like:

java_runtime_env = RuntimeEnvBuilder.set_env_vars({"a": "b"}).set_jars(["s3://abc.jar"]).build()
ray.init(runtime_env=java_runtime_env)

2、Can we remove the code_search_path in Python, Java and C++? We can support this logic in runtime env:

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
architkulkarnicommented, Jan 18, 2022

Adding a prefix for language-specific options makes sense to me!

1reaction
edoakescommented, Jan 13, 2022

I don’t see a strong reason to veer from what we currently have. Making it more structured makes sense though. e.g., support both of the following:

runtime_env={"pip": ["requests"]}
runtime_env = ray.runtime_env.RuntimeEnv(pip=["requests"])
Read more comments on GitHub >

github_iconTop Results From Across the Web

[runtime env] pip-based runtime env refactor #21952 - GitHub
Use coroutine to setup py_modules and working_dir , so that they can be executed in parallel with virtualenv creation. Support change pip ...
Read more >
Runtime environments in AWS Mainframe Modernization
Learn to create, update, and delete AWS Mainframe Modernization runtime environments for both the Blu Age and Micro Focus runtime engines.
Read more >
Refactoring application code to microservices - IBM
Applying a microservices architecture involves repackaging your application structure, refactoring code, and refactoring data.
Read more >
Why You May Want Runtime Config for Your SPA's Frontend
For example, when your backend server retrieves its database connection string from an environment variable, that's runtime config.
Read more >
Modern Django — Part 1: Project Refactor and Meeting the ...
We will then create a set of environment variables to hold secret ... Understanding Django's Settings API is the first step to shedding ......
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