Code Monkey home page Code Monkey logo

mlflow-docker-compose's Introduction

MLflow On-Premise Deployment using Docker Compose

Easily deploy an MLflow tracking server with 1 command.

MinIO S3 is used as the artifact store and MySQL server is used as the backend store.

How to run

  1. Clone (download) this repository

    git clone https://github.com/sachua/mlflow-docker-compose.git
  2. cd into the mlflow-docker-compose directory

  3. Build and run the containers with docker-compose

    docker-compose up -d --build
  4. Access MLflow UI with http://localhost:5000

  5. Access MinIO UI with http://localhost:9000

Containerization

The MLflow tracking server is composed of 4 docker containers:

  • MLflow server
  • MinIO object storage server
  • MySQL database server

Example

  1. Install conda

  2. Install MLflow with extra dependencies, including scikit-learn

    pip install mlflow boto3
  3. Set environmental variables

    export MLFLOW_TRACKING_URI=http://localhost:5000
    export MLFLOW_S3_ENDPOINT_URL=http://localhost:9000
  4. Set MinIO credentials

    cat <<EOF > ~/.aws/credentials
    [default]
    aws_access_key_id=minio
    aws_secret_access_key=minio123
    EOF
  5. Train a sample MLflow model

    mlflow run https://github.com/sachua/mlflow-example.git -P alpha=0.42
  6. Serve the model (replace ${MODEL_ID} with your model's ID)

    export MODEL_ID=0ced24069348417fbbcb2cd41a7d2f07 # Replace this with your model's ID
    mlflow models serve -m runs:/${MODEL_ID}/model -p 1234 --env-manager conda
  7. You can check the input with this command

    curl -X POST -H "Content-Type:application/json" --data '{"dataframe_split":{"columns":["fixed acidity", "volatile acidity", "citric acid", "residual sugar", "chlorides", "free sulfur dioxide", "total sulfur dioxide", "density", "pH", "sulphates", "alcohol"],"data":[[6.2, 0.66, 0.48, 1.2, 0.029, 29, 75, 0.98, 3.33, 0.39, 12.8]]}}' http://127.0.0.1:1234/invocations

mlflow-docker-compose's People

Contributors

sachua avatar renovate[bot] avatar mathematicalmichael avatar renovate-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.