Skip to content

lopezco/mlflow-server-docker

Repository files navigation

MLflow Server with Docker

The default artifact storage is configured to use be the folder mlruns.

Setup

For the users' database, please create it following the instructions here or here. Then put the generated .htpasswd file into the config/ folder.

In a nutshell

  1. Install apache2-utils

    sudo apt-get install apache2-utils
  2. Create at least one user

    sudo htpasswd ./.htpasswd user1

Run the service

  1. Build

    docker-compose build
  2. Run. Use -d for detached mode (the terminal is not blocked)

    docker-compose up [-d]

Track experiments using mlflow client

Setup

  1. Install mlflow

    pip install mlflow
  2. Set environment variables:

    Manually:

    # Login information
    export MLFLOW_TRACKING_USERNAME=fill  # Username
    export MLFLOW_TRACKING_PASSWORD=fill  # Password
    # Server information
    export MLFLOW_TRACKING_URI=fill  # Password

    Or in Python. You can copy the previous code snippet into a .env file without the export command and use the dotenv package to load it (pip install python-dotenv).

    • Install required library

      pip install python-dotenv
    • .env file

      # Login information
      MLFLOW_TRACKING_USERNAME=fill  # Username
      MLFLOW_TRACKING_PASSWORD=fill  # Password
      # Server information
      MLFLOW_TRACKING_URI=fill  # Password
    • Python code to load the .env file

      from dotenv import load_dotenv
      load_dotenv(dotenv_path='./.env')
  3. Set the tracking URL

    import mlflow
    import os
    mlflow.set_tracking_uri(os.environ['MLFLOW_TRACKING_URI'])

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published