'mlflow static_prefix url in set_tracking_uri is not working

I am starting mlflow with below command

mlflow server --static_prefix=/myprefix --backend-store-uri postgresql://psql_user_name:psql_password@localhost/mlflow_db --default-artifact-root s3://my-mlflow-bucket/ --host 0.0.0.0 -p 8000

everything worked fine and I can see mlflow UI when I open url http://localhost:8000/myprefix but when I use mlflow.set_tracking_uri() i have to give url path as "http://localhost:8000/"

why cant we use full url , which has static prefix "http://localhost:8000/myprefix" ?

if i use full url ,I am getting request to api endpoint fail and api is experiments/list error 404 !=200 is there any way to add url with static prefix in set_tracking_uri



Solution 1:[1]

FYI it appears via https://github.com/mlflow/mlflow/issues/4484#issue-925407532 that this isn't supported. The --static-prefix flag only impacts the UI (e.g. all paths under /ajax-api/2.0) while the REST API is under /api and is not impacted by --static-prefix.

It looks like the way around this is to used some sort of load balancer / frontend that can do path rewrites (an example w/ nginx is given in that issue)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John Allard