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', _disable_job_level_lineage_reconstruction: bool = False, _py_driver_sys_path: List[str] | None = None)[source]#

Bases: object

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 (List[str] | None) – The jvm options for java workers of the job.

  • code_search_path (List[str] | None) – 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 (dict | None) – A runtime environment dictionary.

  • _client_job (bool) – Whether this job was submitted via Ray Client.

  • metadata (dict | None) – An opaque metadata dictionary.

  • ray_namespace (str | None) – A namespace is a logical grouping of jobs and named actors.

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

  • _disable_job_level_lineage_reconstruction (bool) – Whether to turn off Ray Core lineage reconstruction for this job, leaving the application responsible for reconstructing its own lost objects. When True, the job’s workers never pin object lineage. When False, the cluster-level lineage_pinning_enabled system config applies. Defaults to False. This config is currently experimental.

  • _py_driver_sys_path (List[str] | None) – A list of directories that specify the search path for python workers.

Methods

ensure_logging_config

Set logging config from a dict or LoggingConfig if not already configured.

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.

metadata

An opaque metadata dictionary.

ray_namespace

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