yr.Config#
- class yr.Config(function_id: str = '', cpp_function_id: str = '', cpp_auto_function_name: str = '', function_name: str = '', server_address: str = '', ds_address: str = '', is_driver: bool = True, log_level: str | int = '', invoke_timeout: int = 900, local_mode: bool = False, code_dir: str = '', connection_nums: int = 100, recycle_time: int = 2, in_cluster: bool | None = None, job_id: str = '', tls_config: ~yr.config.UserTLSConfig | None = None, auto: bool = False, deployment_config: ~yr.config.DeploymentConfig | None = None, rt_server_address: str = '', log_dir: str = './', env_file: str = '', log_file_size_max: int = 0, log_file_num_max: int = 0, log_flush_interval: int = 5, runtime_id: str = 'driver', max_task_instance_num: int = -1, load_paths: list = <factory>, rpc_timeout: int = 1800, enable_mtls: bool | None = None, enable_tls: bool | None = None, private_key_path: str = '', certificate_file_path: str = '', verify_file_path: str = '', private_key_paaswd: str = '', http_ioc_threads_num: int = 400, server_name: str = '', ns: str = '', tenant_id: str = '', enable_metrics: bool = True, custom_envs: ~typing.Dict[str, str] = <factory>, master_addr_list: list = <factory>, working_dir: str = '', enable_ds_encrypt: bool = False, ds_public_key_path: str = '', runtime_public_key_path: str = '', runtime_private_key_path: str = '', num_cpus: int | None = None, runtime_env: ~typing.Dict[str, ~typing.Any] | None = None, log_to_driver: bool = False, dedup_logs: bool = True, auth_token: str = '')[source]#
Bases:
objectYR API config.
Attributes
Auto start distribute-executor when yr.init, and auto stop distribute-executor when yr.finalize.
Client certificate file path.
The code directory path that must be configured at runtime initialization.
Http client connection nums.
Use default function for cpp.
Cpp function id which you deploy, get default by env YR_CPP_FUNCID.
If
True, deduplicates logs that appear redundantly across multiple processes, default True.When auto=True needed, use to define deployment detail.
DataSystem address, get default by env YR_DS_ADDRESS.
The path of worker public key for data system tls authentication, if enable_ds_encrypt is true and the ds_public_key_path is empty, an exception will be thrown.
Whether to enable data system TLS authentication.
Whether to enable metric collection.
Whether to enable client two-way authentication, default is
False.Path to environment variable file (.env format) to load at startup.
Function id which you deploy, get default by env YRFUNCID.
Function name which need in runtime.
HTTP link worker thread.
False.Http client read timeout(sec), default is
900.Only
Falsewhen initialize in runtime, default isTrue.Auto generated by init.
Run code in local, default is
False.Log directory, specifies the path where log files will be stored.
Max number for log file, default is
0(If the default value is0, it will eventually be set to20).Max size for log file, default is
0(If the default value is0, it will eventually be set to40).Interval for log flush, default is
5.YR api log level have
ERROR/WARNING/INFO/DEBUG, default isWARNING.If
True, the output from all of the job processes on all nodes will be directed to the driver, default isFalse.The maximum number of instances of stateless function.
Namespace, used to organize and isolate configurations or resources.
Client private key encryption password.
Client private key file path.
Instance recycle period(sec).
The timeout used for RPC.
Runtime server, keep default in driver.
Runtime id, keep default in driver.
The path of client private key for data system tls authentication.
The path of client public key for data system tls authentication.
System cluster address, get default by env YR_SERVER_ADDRESS.
Server name, used to identify and connect to a specific server instance.
For out cluster https ssl.
Server certificate file path.
Specify the user code or the local path location that it depends on, absolute path, and ensure that it exists on all nodes in the cluster.
Code loading path.
Used to set custom environment variables for the runtime.
Function master address list.
Methods