Sign inSign up

evk02/mlflow

By evk02

•Updated over 3 years ago

Up-to-date MLFlow image with Helm chart and instructions for Terraform

Image
1

10K+

evk02/mlflow repository overview

⁠dockerhub-mlflow

Docker image of MLFlow for DockerHub and Helm chart use.

You can find this image on DockerHub under https://hub.docker.com/r/evk02/mlflow⁠

NOTE: starting v1.29.1, the image and the recommended Helm chart supports the "Scenario 5: MLflow Tracking Server enabled with proxied artifact storage access", see https://www.mlflow.org/docs/latest/tracking.html⁠

⁠Helm chart

This Docker image is recommended to be used with Helm chart https://github.com/zoltan-fedor/helm-mlflow⁠

⁠Install into Kubernetes with Helm chart

You will need a MySQL database with a user for MLFlow and S3 or S3-compatible storage (like MinIO) for MLFlow to use.

Then create a values.yaml file:

# these are the custom values for the MLFlow Helm chart
# for options see https://github.com/cetic/helm-mlflow
image:
  repository: evk02/mlflow
  tag: 1.23.1
  pullPolicy: IfNotPresent

# connection to the MySQL
db:
  default:
    enabled: false
  type: mysql  # type of the db connection, can be postresql or mysql
  host: mysql_host
  port: 3306
  user: mlflow
  password: MyPassword
  database: mlflow

artifacts_destination: "s3://datalake/mlflow/artifacts"

# innrease the MLFlow UI timeout
gunicorn_opts: "-t360"

minio:
  enabled: false
  # url: http://minio-service.kubeflow.svc.cluster.local:9000
  # accesskey: minio
  # secretkey: MySecretKey

# we only need the service available within the cluster, so we use ClusterIP option
# see https://github.com/cetic/helm-mlflow#configure-the-chart
service:
  type: ClusterIP
  port: 80

Then setup the Helm repo and install the Helm package with the above values.yaml file:

$ helm repo add cetic https://cetic.github.io/helm-charts
$ helm repo update
# install the chart named as 'mlflow' into the namespace 'mlflow': 
$ helm install -f values.yaml mlflow cetic/mlflow -n mlflow

⁠Install into Kubernetes with Helm chart and Terraform

Just like above, you will need a MySQL db and S3/MinIO storage. Also you will need to create the same values.yaml file as above.

Then in Terraform you can add MLFlow as a component such as:

resource helm_release mlflow {
  name       = "mlflow"
  namespace  = "mlflow"
  create_namespace = true

  repository       = "https://cetic.github.io/helm-charts"
  chart            = "mlflow"
  # version          = "1.5.1"  # see https://github.com/cetic/helm-mlflow/releases or https://github.com/cetic/helm-charts/tree/gh-pages/mlflow

  # for options see https://github.com/cetic/helm-mlflow
  set {
    name = "image.repository"
    value = "evk02/mlflow"  # see https://hub.docker.com/r/evk02/mlflow
  }
  set {
    name = "image.tag"
    value = "1.23.1"  # MLFlow application version, see https://hub.docker.com/r/evk02/mlflow
  }

  values = [
    file("${path.module}/values.yaml")
  ]
}

⁠Upgrade

When after a version upgrade the MLFlow container errors out, then check out the logs. Frequently new versions require a database schema upgrade, so you need to call the new version with the db upgrade SQLAlchemy command while pointing to the MySQL instance:

$ kubectl run -n mlflow  -i --tty --rm mlflow-upgrade --image=evk02/mlflow:1.29.2 --restart=Never \
-- sh -c 'mlflow db upgrade [db uri]'

Tag summary

Content type

Image

Digest

sha256:0b3a630b5…

Size

673.8 MB

Last updated

over 3 years ago

docker pull evk02/mlflow