ray.job_config.JobConfig#

class ray.job_config.JobConfig(jvm_options: List[str] | None = None, code_search_path: List[str] | None = None, runtime_env: dict | None = None, _client_job: bool = False, metadata: dict | None = None, ray_namespace: str | None = None, default_actor_lifetime: str = 'non_detached', _py_driver_sys_path: List[str] | None = None)[source]#

A class used to store the configurations of a job.

Examples

import ray
from ray.job_config import JobConfig

ray.init(job_config=JobConfig(default_actor_lifetime="non_detached"))
Parameters:
  • jvm_options – The jvm options for java workers of the job.

  • code_search_path – A list of directories or jar files that specify the search path for user code. This will be used as CLASSPATH in Java and PYTHONPATH in Python. See Ray cross-language programming for more details.

  • runtime_env – A runtime environment dictionary.

  • metadata – An opaque metadata dictionary.

  • ray_namespace – A namespace is a logical grouping of jobs and named actors.

  • default_actor_lifetime – The default value of actor lifetime, can be “detached” or “non_detached”. See actor lifetimes for more details.

Methods

from_json

Generates a JobConfig object from json.

set_default_actor_lifetime

Set the default actor lifetime, which can be "detached" or "non_detached".

set_metadata

Add key-value pair to the metadata dictionary.

set_py_logging_config

Set the logging configuration for the job.

set_ray_namespace

Set Ray namespace.

set_runtime_env

Modify the runtime_env of the JobConfig.

Attributes

jvm_options

The jvm options for java workers of the job.

code_search_path

A list of directories or jar files that specify the search path for user code.

metadata

An opaque metadata dictionary.

ray_namespace

A namespace is a logical grouping of jobs and named actors.