Skip to main content

Machine Learning Orchestration

Project description

Overview

The dbnd-mlflow plugin allows storing mlflow metrics to DBND tracker together with duplicating them to the mlflow store.

Install

pip install dbnd-mlflow
# or
pip install databand[mlflow]

Config

[core]
# Databand store url should be defined
databand_url=http://localhost:8081

[mlflow_tracking]
# Enable tracking to Databand store
databand_tracking=True

# Optionally, define a URI for mlflow store, 
# mlflow.get_tracking_uri() is used by default
; duplicate_tracking_to=http://mlflow-store/

Run example

dbnd run mlflow_tracking_integration_check

# or set configs manually
dbnd run mlflow_tracking_integration_check --set-config mlflow_tracking.databand_tracking=True

Explanation

mlflow_tracking_integration_check code

from dbnd import task
from mlflow import start_run, end_run
from mlflow import log_metric, log_param

@task
def mlflow_tracking_integration_check():
    start_run()
    # params
    log_param("param1", randint(0, 100))
    log_param("param2", randint(0, 100))
    # metrics
    log_metric("foo1", random())
    log_metric("foo2", random())
    end_run()

Execution flow:

  1. Run dbnd run mlflow_tracking_integration_check --set-config mlflow.tracking.databand_tracking=True
  2. dbnd creates a new dbnd context
  3. dbnd_on_pre_init_context hook from dbnd_mlflow is triggered
    • a new uri is computed to be used by mlflow, e.g.:
      • dbnd://localhost:8081?duplicate_tracking_to=http%253A%252F%252Fmlflow-store%253A80%252F
    • the new uri is set to be used with mlflow.set_tracking_uri()
  4. mlflow_tracking_integration_check task starts:
    1. mlflow.start_run()
      1. mlflow reads entry_points for each installed package and finds:
        • "dbnd = dbnd_mlflow.tracking_store:get_dbnd_store",
        • "dbnd+s = dbnd_mlflow.tracking_store:get_dbnd_store",
        • "databand = dbnd_mlflow.tracking_store:get_dbnd_store",
        • "databand+s = dbnd_mlflow.tracking_store:get_dbnd_store",
      2. mlflow creates TrackingStoreClient using the new uri
      3. uri schema instructs to use dbnd_mlflow.tracking_store:get_dbnd_store
        • get_dbnd_store creates dbnd TrackingAPIClient
        • get_dbnd_store creates mlflow tracking store to duplicate tracking to
        • get_dbnd_store returns DatabandStore instance
    2. log_param()/log_metric()
      • calls to DatabandStore
        • calls to TrackingAPIClient
        • calls to mlflow tracking store to duplicate tracking to
    3. mlflow.end_run()
  5. mlflow_tracking_integration_check ends
  6. dbnd_on_exit_context hook from dbnd_mlflow is triggered
    • restore original mlflow tracking uri

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbnd-mlflow-0.24.24.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbnd_mlflow-0.24.24-py2.py3-none-any.whl (10.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file dbnd-mlflow-0.24.24.tar.gz.

File metadata

  • Download URL: dbnd-mlflow-0.24.24.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.3

File hashes

Hashes for dbnd-mlflow-0.24.24.tar.gz
Algorithm Hash digest
SHA256 1c403d56a7fb00f40bb2eaa9fd39799eef5499dc3a76f430166d39234bb05a08
MD5 9fea83f27af7d86d93065ca59441c6a0
BLAKE2b-256 070d66c073c47e18ec2acd93a0983c9874efeaf98e78c586b3471a469065e364

See more details on using hashes here.

File details

Details for the file dbnd_mlflow-0.24.24-py2.py3-none-any.whl.

File metadata

  • Download URL: dbnd_mlflow-0.24.24-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.3

File hashes

Hashes for dbnd_mlflow-0.24.24-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f6104b7c78b2fd4b604fd9781259e73dabf014bb9c8b445d55d79423a5636e5a
MD5 91d111a489e2fe552c045973962a4b1b
BLAKE2b-256 00d5c756770d12ebf00d2682dc906c164a728d44a31710d077f8f79d4da1fb3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page