mlrun.config#
Configuration system.
Configuration can be in either a configuration file specified by MLRUN_CONFIG_FILE environment variable or by environment variables.
Environment variables are in the format "MLRUN_HTTPDB__PORT=8080". This will be mapped to config.httpdb.port. Values should be in JSON format.
- class mlrun.config.Config(cfg=None)[source]#
Bases:
object
- property dbpath#
- static decode_base64_config_and_load_to_object(attribute_path: str, expected_type=<class 'dict'>)[source]#
decodes and loads the config attribute to expected type
- Parameters:
attribute_path -- the path in the default_config e.g. preemptible_nodes.node_selector
expected_type -- the object type valid values are : dict, list etc...
- Returns:
the expected type instance
- force_api_gateway_ssl_redirect()[source]#
Get the default value for the ssl_redirect configuration. In Iguazio we always want to redirect to HTTPS, in other cases we don't. :return: True if we should redirect to HTTPS, False otherwise.
- static get_default_function_pod_requirement_resources(requirement: str, with_gpu: bool = True)[source]#
- Parameters:
requirement -- kubernetes requirement resource one of the following : requests, limits
with_gpu -- whether to return requirement resources with nvidia.com/gpu field (e.g. you cannot specify GPU requests without specifying GPU limits) https://kubernetes.io/docs/tasks/manage-gpus/scheduling-gpus/
- Returns:
a dict containing the defaults resources (cpu, memory, nvidia.com/gpu)
- get_model_monitoring_file_target_path(project: str = '', kind: str = '', target: str = 'online', artifact_path: str | None = None, function_name: str | None = None, **kwargs) str [source]#
Get the full path from the configuration based on the provided project and kind.
- Parameters:
project -- Project name.
kind -- Kind of target path (e.g. events, log_stream, endpoints, etc.)
target -- Can be either online or offline. If the target is online, then we try to get a specific path for the provided kind. If it doesn't exist, use the default path. If the target path is offline and the offline path is already a full path in the configuration, then the result will be that path as-is. If the offline path is a relative path, then the result will be based on the project artifact path and the offline relative path. If project artifact path wasn't provided, then we use MLRun artifact path instead.
artifact_path -- Optional artifact path that will be used as a relative path. If not provided, the relative artifact path will be taken from the global MLRun artifact path.
function_name -- Application name, None for model_monitoring_stream.
- Returns:
Full configured path for the provided kind.
- get_s3_storage_options() dict[str, Any] [source]#
Generate storage options dictionary as required for handling S3 path in fsspec. The model monitoring stream graph uses this method for generating the storage options for S3 parquet target path. :return: A storage options dictionary in which each key-value pair represents a particular configuration, such as endpoint_url or aws access key.
- property version#