Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to start a mlflow remote server? #40

Closed
HongHuangNeu opened this issue Jun 13, 2018 · 15 comments
Closed

How to start a mlflow remote server? #40

HongHuangNeu opened this issue Jun 13, 2018 · 15 comments
Milestone

Comments

@HongHuangNeu
Copy link

System information

  • python 2.7.5
  • MLflow installed from pip
  • MLflow version 0.1.0

Describe the problem

How to start a mlflow remote server? By default "mlflow ui" starts a mlflow server on 127.0.0.1:5000, which is hard coded in the code of the mlflow server. I cannot access the server from outside. Examples and documentations shows that server only runs in localhost. How could I configure mlflow server so that I can access the server remotely?

@Cs4r
Copy link

Cs4r commented Jun 13, 2018

I don't think this is a real issue.

However, here's one possible solution to your problem:

  1. Get a machine where to run mlflow (It can be your local machine or an EC2/GCloud/Azure instance)
  2. Run mlflow on the aforementioned machine
  3. Make the running machine accept Internet traffic to port 5000
  4. Get to know the public IP of the running machine
  5. Use the public IP to connect to the mlflow server e.g: 10.20.30.40:5000

If you want to expose a ml server running on your local machine, services like https://ngrok.com/ might help.

Bear in mind that exposing your local machine to the Internet involves taking some security risks.

@bohea
Copy link

bohea commented Jun 14, 2018

mlflow uses flask to build server
command 'server' equals flask app.run

according to flask's doc, flask app.run is:

a very simple builtin server, which is good enough for testing but probably not what you want to use in production

if you want a remote server, try some thing like uwsgi, gunicorn

@jeanineharb
Copy link

I set up my machine the same way as suggested by @Cs4r. However, when attempting to connect to the MLflow UI using the public IP, I get a 404 page.

screenshot from 2018-06-14 10-34-28

Any idea if this is a configuration problem or a bug? Thanks.

@Cs4r
Copy link

Cs4r commented Jun 14, 2018

It might be related to your machine's firewall configuration. I tested what I suggested above and worked fine on my home computer.

Bear in mind that your company might be imposing a strict firewall policy that you are not aware of.

I believe this doesn't have to do with mlflow.

@Sufod
Copy link

Sufod commented Jun 14, 2018

I'm encountering the same problem, the server is running and listening, but i can't get anything else than a 404 error...

I can see the requests on the server console.

Dockerfile is not functional either...

@jeanineharb
Copy link

Undoing the commit for #16 resolved the error locally. This is a known Flask-related issue: https://stackoverflow.com/questions/29375903/flask-app-only-returns-404s-regardless-of-how-it-is-run

In order to expose the service from a remote machine, my guess is that the host in server.app.run("0.0.0.0") should point to the machine's public IP, not 0.0.0.0.

@sanzgiri
Copy link

One way around this problem is to simply specify the public IP of the the remote mlflow server in cli.py in the call to server.app.run() e.g. server.app.run("xxx.yyy.zzz.www")

@mateiz
Copy link
Contributor

mateiz commented Jun 19, 2018

FYI this should be fixed in the master branch now. Try mlflow server --host 0.0.0.0. We plan to push a release to PyPI soon to have this in there by default (probably in the next 2-3 days).

@mateiz mateiz added this to the 0.2.0 milestone Jun 19, 2018
@nipunsadvilkar
Copy link

@mateiz : Is it released? I tried building from source code but couldn't get around with mlflow server --host 0.0.0.0. command

@mateiz
Copy link
Contributor

mateiz commented Jun 27, 2018

It should be in the code. Did you follow the instructions in https://github.com/databricks/mlflow/blob/master/CONTRIBUTING.rst for how to run mlflow from source? Maybe you have another one on your PATH.

@giordyb
Copy link

giordyb commented Jun 27, 2018

Hi,

I'm having a similar issue: I have installed mlflow with pip pointing at the source (pip3.6 install git+https://github.com/databricks/mlflow.git) and I can run the tracking server with "mlflow server -h myip -p 5000".
Data is being recorded in the mlruns folder so it looks like the rest api is actually working.
Unfortunately when I try to access the web interface I also get a 404.
I also tried to run "mlflow ui-h myip -p 5000" but there is no difference.
any ideas?

@mateiz
Copy link
Contributor

mateiz commented Jun 27, 2018

Ah, I'm not sure the web UI works when you install it that way. I believe you have to run the JS part of the web UI manually with npm as described at https://github.com/databricks/mlflow/blob/master/CONTRIBUTING.rst. We just published a 0.2.0 release btw so that will have the updated server and working UI if you just pip install mlflow.

@giordyb
Copy link

giordyb commented Jun 27, 2018

thanks, updating to 0.2.0 did the trick!

@andrewmchen
Copy link
Contributor

Fixed with mlflow server --host 0.0.0.0 in release 0.2.0.

juntai-zheng pushed a commit that referenced this issue Dec 19, 2019
Add Javadocs for MLflow 1.1 release
@wedesoft
Copy link

wedesoft commented Nov 2, 2022

I had to allow access to the port to get it working with the host option.

sudo iptables -I INPUT -p tcp -m tcp --dport 5000 -j ACCEPT
poetry run mlflow ui --host 0.0.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests