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 dask_kfp_image#

See kfp_image property docstring for why we’re defining this property

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 :param attribute_path: the path in the default_config e.g. preemptible_nodes.node_selector :param expected_type: the object type valid values are : dict, list etc… :return: the expected type instance

dump_yaml(stream=None)[source]#
classmethod from_dict(dict_)[source]#
static get_build_args()[source]#
get_default_function_node_selector() dict[source]#
static get_default_function_pod_requirement_resources(requirement: str, with_gpu: bool = True)[source]#
Parameters
Returns

a dict containing the defaults resources (cpu, memory, nvidia.com/gpu)

get_default_function_pod_resources(with_gpu_requests=False, with_gpu_limits=False)[source]#
get_default_function_security_context() dict[source]#
static get_hub_url()[source]#
static get_parsed_igz_version() Optional[semver.VersionInfo][source]#
get_preemptible_node_selector() dict[source]#
get_preemptible_tolerations() list[source]#
static get_security_context_enrichment_group_id(user_unix_id: int) int[source]#
static get_storage_auto_mount_params()[source]#
get_v3io_access_key()[source]#
static get_valid_function_priority_class_names()[source]#
property iguazio_api_url#

we want to be able to run with old versions of the service who runs the API (which doesn’t configure this value) so we’re doing best effort to try and resolve it from other configurations TODO: Remove this hack when 0.6.x is old enough

is_api_running_on_k8s()[source]#
is_nuclio_detected()[source]#
static is_pip_ca_configured()[source]#
is_preemption_nodes_configured()[source]#
static is_running_on_iguazio() bool[source]#
property kfp_image#

When this configuration is not set we want to set it to mlrun/mlrun, but we need to use the enrich_image method. The problem is that the mlrun.utils.helpers module is importing the config (this) module, so we must import the module inside this function (and not on initialization), and then calculate this property value here.

static reload()[source]#
resolve_chief_api_url() str[source]#
resolve_kfp_url(namespace=None)[source]#
resolve_runs_monitoring_missing_runtime_resources_debouncing_interval()[source]#
static resolve_ui_url()[source]#
to_dict()[source]#
update(cfg, skip_errors=False)[source]#
use_nuclio_mock(force_mock=None)[source]#
verify_security_context_enrichment_mode_is_allowed()[source]#
property version#
mlrun.config.is_running_as_api()[source]#
mlrun.config.read_env(env=None, prefix='MLRUN_')[source]#

Read configuration from environment