Running MLFlow on GCP VM

Shadab Hussain :

I have installed mlflow on GCP VM instance, now I want to access mlflow UI with external IP. I tried setting up a firewall rule and opening the default port for mlflow, but not able to access it. Can someone give step by step process for just running mlflow on VM instance?

Serhii Rohoza :

I've decided to check on my test VM and run mlflow server on GCE VM. Have a look at my steps below:

  1. create VM instance based on Ubuntu Linux 18.04 LTS
  2. install MLflow:

    $ sudo apt update
    $ sudo apt upgrade
    $ cd ~
    $ git clone https://github.com/mlflow/mlflow
    $ cd mlflow
    $ sudo apt install python3-pip
    $ pip3 install mlflow
    $ python3 setup.py build
    $ sudo python3 setup.py install
    $ mlflow --version
    mlflow, version 1.7.1.dev0
    
  3. run mlflow server on internal IP of VM instance (default 127.0.0.1):

    $ ifconfig 
    ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1460
    inet 10.XXX.15.XXX  netmask 255.255.255.255  broadcast 0.0.0.0
    ...
    
    $ mlflow server --host 10.XXX.15.XXX
    [2020-03-09 15:05:50 +0000] [8631] [INFO] Starting gunicorn 20.0.4
    [2020-03-09 15:05:50 +0000] [8631] [INFO] Listening at: http://10.128.15.211:5000 (8631)
    [2020-03-09 15:05:50 +0000] [8631] [INFO] Using worker: sync
    [2020-03-09 15:05:50 +0000] [8634] [INFO] Booting worker with pid: 8634
    [2020-03-09 15:05:51 +0000] [8635] [INFO] Booting worker with pid: 8635
    [2020-03-09 15:05:51 +0000] [8636] [INFO] Booting worker with pid: 8636
    [2020-03-09 15:05:51 +0000] [8638] [INFO] Booting worker with pid: 8638
    
  4. check from VM instance (from second connection):

    $ curl -I http://10.XXX.15.XXX:5000
    HTTP/1.1 200 OK
    Server: gunicorn/20.0.4
    Date: Mon, 09 Mar 2020 15:06:08 GMT
    Connection: close
    Content-Length: 853
    Content-Type: text/html; charset=utf-8
    Last-Modified: Mon, 09 Mar 2020 14:57:11 GMT
    Cache-Control: public, max-age=43200
    Expires: Tue, 10 Mar 2020 03:06:08 GMT
    ETag: "1583765831.3202355-853-3764264575"
    
  5. set network tag mlflow-server

  6. create firewall rule to allow access on port 5000

    $ gcloud compute --project=test-prj firewall-rules create mlflow-server --direction=INGRESS --priority=999 --network=default --action=ALLOW --rules=tcp:5000 --source-ranges=0.0.0.0/0 --target-tags=mlflow-server
    
  7. check from on-premises Linux machine nmap -Pn 35.225.XXX.XXX

    Starting Nmap 7.80 ( https://nmap.org ) at 2020-03-09 16:20 CET
    Nmap scan report for 74.123.225.35.bc.googleusercontent.com (35.225.XXX.XXX)
    Host is up (0.20s latency).
    Not shown: 993 filtered ports
    PORT     STATE  SERVICE
    ...
    5000/tcp open   upnp
    ...
    
  8. go to web browser http://35.225.XXX.XXX:5000/

mlflow

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=198306&siteId=1