Git Product home page Git Product logo

mlflow-tracking-server's Introduction

MLFLow Tracking Server Based on Docker and AWS S3

Build Status Code Score

This repo provides a docker image of MLFLow Tracking Server which is based on sqlite, an internal file system for metadata (e.g. parameters, metrics) and an AWS S3 Bucket for files and artifacts.

Architecture

Prerequisites

Before you start the MLFlow Tracking Server, you must create an AWS S3 Bucket and the corresponding credentials.

  1. AWS Account
  2. AWS CLI
  3. Create a new AWS S3 Bucket
  4. Add a new AWS User to to the system
  5. Assign the following policy to the user:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "s3:ListAllMyBuckets",
                "s3:HeadBucket"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::<_AWS_BUCKET_NAME_>",
                "arn:aws:s3:::<_AWS_BUCKET_NAME_>/*"
            ]
        }
    ]
}

Run the MLFlow Tracking Server

$ docker run \
    --rm \
    --name mlflow-tracking-server \
    -p 5000:5000 \
    -e PORT=5000 \
    -e FILE_DIR=/mlflow \
    -e AWS_BUCKET=<YOUR_AWS_BUCKET> \
    -e AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY_ID> \
    -e AWS_SECRET_ACCESS_KEY=<YOUR_AWS_SECRET_ACCESS_KEY> \
    foxrider/mlflow-tracking-server:0.2.0

Access to http://127.0.0.1:5000

Environment Variables for the MLFlow Tracking Server

Required

Key Description
FILE_DIR Directory for artifacts and metadata (e.g. parameters, metrics)
AWS_BUCKET Name of AWS S3 Bucket that will contain the artifacts
AWS_ACCESS_KEY_ID AWS-Access-Key that you have created in the Prerequisite section
AWS_SECRET_ACCESS_KEY AWS-Secret-Access-Key that you have created in the Prerequisite section

Optional

Key Description Default
PORT Value for listen directive 5000

Test the MLFlow Tracking Server

Prerequisite

  1. Install the AWS CLI
  2. Add the AWS credentials to the client. You can either set the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY on your client or use the AWS CLI command aws configure.

Simple Python Script

See this link

Contribution

Pull requests are welcome :)

Project Initiator

Florian Muchow

Buy Me A Coffee

Contributors

Thanks to all the contributors

mlflow-tracking-server's People

Contributors

ekzhang avatar flmu avatar rblaine95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mlflow-tracking-server's Issues

No module named 'boto3'

When trying to access artifacts/data in S3 storage, I get the following error:

[2019-09-27 11:56:02 +0000] [46] [INFO] Starting gunicorn 19.9.0
[2019-09-27 11:56:02 +0000] [46] [INFO] Listening at: http://0.0.0.0:5000 (46)
[2019-09-27 11:56:02 +0000] [46] [INFO] Using worker: sync
[2019-09-27 11:56:02 +0000] [49] [INFO] Booting worker with pid: 49
[2019-09-27 11:56:02 +0000] [50] [INFO] Booting worker with pid: 50
[2019-09-27 11:56:02 +0000] [82] [INFO] Booting worker with pid: 82
[2019-09-27 11:56:03 +0000] [114] [INFO] Booting worker with pid: 114
/usr/local/lib/python3.7/site-packages/jinja2/utils.py:485: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import MutableMapping
/usr/local/lib/python3.7/site-packages/jinja2/runtime.py:318: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping
2019/09/27 11:56:42 ERROR mlflow.server: Exception on /ajax-api/2.0/preview/mlflow/artifacts/list [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.7/site-packages/mlflow/server/handlers.py", line 101, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/mlflow/server/handlers.py", line 352, in _list_artifacts
    artifact_entities = _get_artifact_repo(run).list_artifacts(path)
  File "/usr/local/lib/python3.7/site-packages/mlflow/store/s3_artifact_repo.py", line 65, in list_artifacts
    s3_client = self._get_s3_client()
  File "/usr/local/lib/python3.7/site-packages/mlflow/store/s3_artifact_repo.py", line 27, in _get_s3_client
    import boto3
ModuleNotFoundError: No module named 'boto3'

This can be fixed by running pip install boto3

Error when mlflow tries to write to /mlflow folder

I'm trying to use your image and use the tracking server when I run models from a notebook run through a server spinned by jupyterhub, which runs in a different docker container (I start both with docker-compose). However, although mlflow works correctly and I can see my model runs in the UI, I get an error message when mlflow tries to write the artifact to the /mlflow folder:

PermissionError: [Errno 13] Permission denied: '/mlflow'

Do you have any idea of how I can get the two containers to play nicely with each other? (sorry if the question is dumb, I'm a complete docker newbie).

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.