Search code examples
pythonmachine-learningdevopsmlrun

MLRun - Can't access html pages locally. Error: MLRunAccessDeniedError('Unauthorized path')


I followed tutorial to learn mlrun and ran mlrun containers locally by mlrun compose.yaml.

https://docs.mlrun.org/en/latest/tutorial/01-mlrun-basics.html

The only difference that I did from tutorial is that set environment at beginning.

import mlrun
mlrun.set_environment("http://localhost:8080", artifact_path="./")

But I got 403 error (message: MLRunAccessDeniedError('Unauthorized path')) when see confusion-matrix.html and other html pages, but it is okay to see parquet file.

Parquet content is displayed

403 on html page

Tried to change the file permissions to 755 but still get 403.


Solution

  • I had similar issue and I solved it, see these possibilities:

    1. In case of external IDE

    • I used config file mlrun-nonprod.env with setting MLRUN_DBPATH (it is reference to MLRun API, for local installation, it is typically http://localhost:8080).
    • I used this code in python, see

    import mlrun

    mlrun.set_env_from_file("mlrun-nonprod.env")
    project = mlrun.get_or_create_project(project_name, context='./', user_project=False)

    BTW: You can also manually test this MLRun API, try to call http://localhost:8080/api/v1/projects and you will get list of all projects in MLRun.

    2. In case of jupyter (part of MLRun compose)

    • I used compose.with-jupyter.yaml see link
    • This jupyter notebook is preconfigured, you can directly create/get project, see

    import mlrun

    project = mlrun.get_or_create_project(project_name, context='./', user_project=False)