Skip to content

MLflow Webhook

laktory.models.resources.databricks.MLflowWebhook ¤

Bases: BaseModel, PulumiResource, TerraformResource

MLflow Model

ATTRIBUTE DESCRIPTION
events

The list of events that will trigger execution of Databricks job or POSTing to an URL, for example, MODEL_VERSION_CREATED, MODEL_VERSION_TRANSITIONED_STAGE, TRANSITION_REQUEST_CREATED, etc. Refer to the (Webhooks API documentation)[https://docs.databricks.com/dev-tools/api/latest/mlflow.html#operation/create-registry-webhook] for a full list of supported events.

TYPE: list[str]

description

Optional description of the MLflow webhook.

TYPE: str

http_url_spec

URL Specifications

TYPE: MlflowWebhookHttpUrlSpec

job_spec

Job Specifications

TYPE: MlflowWebhookJobSpec

model_name

Name of MLflow model for which webhook will be created. If the model name is not specified, a registry-wide webhook is created that listens for the specified events across all versions of all registered models.

TYPE: str

status

Optional status of webhook. Default is ACTIVE

TYPE: Literal['ACTIVE', 'TEST_MODE', 'DISABLED']

Examples:

from laktory import models

mlwebhook = models.resources.databricks.MLflowWebhook(
    events=["TRANSITION_REQUEST_CREATED"],
    description="Databricks Job webhook trigger",
    status="ACTIVE",
    job_spec={
        "job_id": "some_id",
        "workspace_url": "some_url",
        "access_token": "some_token",
    },
)

--

laktory.models.resources.databricks.mlflowwebhook.MlflowWebhookHttpUrlSpec ¤

Bases: BaseModel

MLflow webhook URL Specifications

ATTRIBUTE DESCRIPTION
url

External HTTPS URL called on event trigger (by using a POST request). Structure of payload depends on the event type, refer to documentation for more details.

TYPE: str

authorization

Value of the authorization header that should be sent in the request sent by the wehbook. It should be of the form <auth type> <credentials>, e.g. Bearer <access_token>. If set to an empty string, no authorization header will be included in the request.

TYPE: str

enable_ssl_verification

Enable/disable SSL certificate validation. Default is true. For self-signed certificates, this field must be false AND the destination server must disable certificate validation as well. For security purposes, it is encouraged to perform secret validation with the HMAC-encoded portion of the payload and acknowledge the risk associated with disabling hostname validation whereby it becomes more likely that requests can be maliciously routed to an unintended host.

TYPE: bool

secret

Shared secret required for HMAC encoding payload. The HMAC-encoded payload will be sent in the header as X-Databricks-Signature: encoded_payload.

TYPE: str

--

laktory.models.resources.databricks.mlflowwebhook.MlflowWebhookJobSpec ¤

Bases: BaseModel

MLflow webhook Job Specifications

ATTRIBUTE DESCRIPTION
access_token

The personal access token used to authorize webhook's job runs.

TYPE: str

job_id

ID of the Databricks job that the webhook runs.

TYPE: str

workspace_url

URL of the workspace containing the job that this webhook runs. If not specified, the job’s workspace URL is assumed to be the same as the workspace where the webhook is created.

TYPE: str