mlflow / mlflow

Open source platform for the machine learning lifecycle
https://mlflow.org
Apache License 2.0
18.44k stars 4.17k forks source link

[SETUP-BUG] #12585

Open MohamedKHALILRouissi opened 3 months ago

MohamedKHALILRouissi commented 3 months ago

System information

Code to reproduce issue

yarn build serve -s build -l 3000

Describe the problem

hello i have successfully isolated the component of mlflow ui and mlflow api into 2 separated container and 1 pg database for data persistent , after running the dockerfile mlflow ui using the simple way copy all the folder of mlflow/server/js to the container and run yarn install & yarn start , this cause the container to consume 3.9 gb of memory and at booting the cpu exceed 450% for long duration , so i decided to work with the optimized build production , after building the ui using the yarn build , i have also installed serve as global package , and executed server -s build -l 3000 ( when running the command am at this folder mlflow/server/js , the ui doesn't show any thing it blank white page

image

i need help how to run the ui using the build instead of yarn start and thanks ,

Other info / logs

No response

WeichenXu123 commented 3 months ago

so i decided to work with the optimized build production , after building the ui using the yarn build , i have also installed serve as global package , and executed server -s build -l 3000

I guess the modified process causes the issue. @daniellok-db do you have some ideas ?

MohamedKHALILRouissi commented 2 months ago

another issue image

MohamedKHALILRouissi commented 2 months ago

logs image

daniellok-db commented 2 months ago

If you want to do this, I think you'll probably need to set up a lightweight server that defines some proxies.

Requests for /static-files/* should be proxied to the build folder (or you can just rename build to static-files and serve from mlflow/server/js instead)

You'll have to proxy the following routes to wherever you're serving the actual mlflow server, otherwise the HTTP requests that the frontend sends to fetch data will fail:

https://github.com/mlflow/mlflow/blob/399cef1e03008497cc1c47ca67636ca78f05f604/mlflow/server/js/src/setupProxy.js#L10

MohamedKHALILRouissi commented 2 months ago

image image image

daniellok-db commented 2 months ago

did you set up the proxies? this won't work with just serve -s build

MohamedKHALILRouissi commented 2 months ago

can you please further explain the proxy functionality ?

MohamedKHALILRouissi commented 2 months ago

renamed the folder to static-files and nothing happen

daniellok-db commented 2 months ago

A few important points:

  1. The site is built assuming that the files are hosted in a directory called static-files. So if your website is hosted at 192.168.1.121:3000, then 192.168.1.121:3000/static-files/ should correspond to the folder mlflow/server/js/build/. You can see how the MLflow Flask server is set up to serve the frontend here: https://github.com/mlflow/mlflow/blob/1ae83e4e4b733e7cb16c5b486c7f1157df5541d6/mlflow/server/__init__.py#L128-L133 You'll need to set up something similar.
  2. Your backend and frontend are not deployed in the same server, but the UI will be making requests to your frontend server. In order to make this work, your frontend server needs to redirect requests from 192.168.1.121:3000/ajax-api/* to <backend server address>/ajax-api/*. Please see the following for all routes you need to redirect. https://github.com/mlflow/mlflow/blob/399cef1e03008497cc1c47ca67636ca78f05f604/mlflow/server/js/src/setupProxy.js#L13-L33 You can also do this in your lightweight Flask app (or whatever web framework you want to use).
github-actions[bot] commented 2 months ago

@mlflow/mlflow-team Please assign a maintainer and start triaging this issue.