mlrun.common.schemas.common#

class mlrun.common.schemas.common.ImageBuilder(*, functionSourceCode: str | None = None, codeEntryType: str | None = None, codeEntryAttributes: str | None = None, source: str | None = None, code_origin: str | None = None, origin_filename: str | None = None, image: str | None = None, base_image: str | None = None, commands: list | None = None, extra: str | None = None, extra_args: dict | None = None, builder_env: dict | None = None, secret: str | None = None, registry: str | None = None, load_source_on_run: bool | None = None, with_mlrun: bool | None = None, auto_build: bool | None = None, build_pod: str | None = None, requirements: list | None = None, source_code_target_dir: str | None = None, **extra_data: Any)[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

class Config[source]#

Bases: object

extra = 'allow'#
auto_build: bool | None#
base_image: str | None#
build_pod: str | None#
builder_env: dict | None#
codeEntryAttributes: str | None#
codeEntryType: str | None#
code_origin: str | None#
commands: list | None#
extra: str | None#
extra_args: dict | None#
functionSourceCode: str | None#
image: str | None#
load_source_on_run: bool | None#
origin_filename: str | None#
registry: str | None#
requirements: list | None#
secret: str | None#
source: str | None#
source_code_target_dir: str | None#
with_mlrun: bool | None#
class mlrun.common.schemas.common.LabelsModel(*, labels: str | dict[str, Optional[str]] | list[str] | None = None)[source]#

Bases: BaseModel

This class accepts either a dictionary, a list, or a string for filtering by labels.

Parameters:

labels --

  • If a dictionary is provided, it should be in the format {'label_name': 'value'}. The values can also be None, which will result in the format 'label_name' (without a value). This will be converted to a list of strings in the format 'label_name=value'.

  • If a list is provided, all items must be strings. Each string can either be a simple label name (e.g., 'label1') or a key-value pair in the format 'label=value'.

  • If a string is provided, it should be a comma-separated list of labels (e.g., 'label1,label2').

  • If no labels are specified, the default is an empty list.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

labels: str | dict[str, Optional[str]] | list[str] | None#
classmethod validate(labels) list[str][source]#