Install gcloud and gsutil command-line tools.
MLFlow uses a database in order to store logged parameters, and metrics. This repository assumes that you are going to use a serverless PostgreSQL database that is running on GCP. If you would like to use this repository, you need to create a new serverles PostgreSQL instance on GCP. Please follow these steps:
- Create a serverless PostgreSQL instance on GCP,
- Create a new user:
Users -> ADD USER ACCOUNT
, and save its password to GCP Secret Manager, - Create a new database:
Databases -> CREATE DATABASE
,
MLFlow needs a large storage to store your artifacts. So you need to create a GCS Bucket for MLFlow:
Next, you need create 2 files in order to set some environment variables. Please create these files:
.envs/.gcp
.envs/.tracking-server
There is already example of how these files should look like in .envs
directory:
.envs/.gcp-example
.envs/.tracking-server-example
After everything is ready you can call:
make deploy IMAGE_TAG=<docker-image-tag>
As IMAGE_TAG
, you can specify anything you like. A docker image will be built and pushed to GCP Docker Registery,
and the given IMAGE_TAG
will be its tag.
Since this setup doesn't use expernal IP, you need ssh tunneling in order to view the web API.
- Check VM Instances, to see if your VM was created,
- Run
gcloud compute ssh <vm-instance-name> --zone <vm-instance-zone> --tunnel-through-iap -- -N -L 610 0:localhost:6100
- Check
http://localhost:6100
if your MLFlow instance is running. - Run
python ./examples/connecting-to-tracking-server.py
to see if everything is working.
Happy experimentation! :)