[runtime env] API refactor
See original GitHub issueSearch 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:
- In python, we can reuse the
py_modules
field. https://github.com/ray-project/ray/pull/21504/files#diff-ff7ace6af03d75dc9d8e031310da8f3994c5f71c8f3b29b587c0d841b63e1a1fR73 - In Java, we can add a new field
jars
like https://github.com/ray-project/ray/pull/21504/files#diff-ff7ace6af03d75dc9d8e031310da8f3994c5f71c8f3b29b587c0d841b63e1a1fR95. - In C++, we can add a new field
dynamic_library
like https://github.com/ray-project/ray/pull/21504/files#diff-ff7ace6af03d75dc9d8e031310da8f3994c5f71c8f3b29b587c0d841b63e1a1fR110.
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:
- Created 2 years ago
- Reactions:1
- Comments:15 (13 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding a prefix for language-specific options makes sense to me!
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: