Skip to content

daniel-code/mlflow-service

Repository files navigation

mlflow-service

Launch mlflow service via docker

using remote artifacts, MinIO

Setup

  1. modify .env from .env.example

     # postgres
     POSTGRES_USER=
     POSTGRES_PASSWORD=
     POSTGRES_DB=mlflow
     
     # mlflow
     BUCKET_NAME=mlflow
     
     # MinIO
     MINIO_ROOT_USER=
     MINIO_ROOT_PASSWORD=
     MINIO_VOLUMES=/mnt/data
     
     # project
     MLFLOW_S3_ENDPOINT_URL=http://localhost:9000
     ## usually same as `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD`
     AWS_ACCESS_KEY_ID=
     AWS_SECRET_ACCESS_KEY=
  2. [Optional] Create Self-signed certificates and HTTPS request

    1. Create Self-signed certificates
      cd nginx/ssl
      sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out public.crt
      
    2. Modify service config file in nginx/conf.d
  3. Launch Service

    docker-compose up -d
    
  4. [Optional] Create Another Assess Keys or Users of MinIO creat_access_key.png

  5. Add Environment Variables add the following environment variables to your application.

    # project
    MLFLOW_S3_ENDPOINT_URL=http://localhost:9000
    ## usually same as `MINIO_ROOT_USER` and `MINIO_ROOT_PASSWORD`
    AWS_ACCESS_KEY_ID=
    AWS_SECRET_ACCESS_KEY=
  6. Log to mlflow log_metric.py