man-group / notebooker

Productionise & schedule your Jupyter Notebooks as easily as you wrote them.
GNU Affero General Public License v3.0
848 stars 80 forks source link

Enable me to run on kubernetes behind reverse proxy #120

Open MarcSkovMadsen opened 1 year ago

MarcSkovMadsen commented 1 year ago

I would like to tryout notebooker deployed on kubernetes.

For quick exploration purposes I just run the command

mkdir -p /home/jovyan/shared/.analytics-workspace/.mongodb;conda install -y -c anaconda mongodb=6.0.2;mongod --dbpath /home/jovyan/shared/.analytics-workspace/.mongodb &pip install notebooker;python -m ipykernel install --user --name=notebooker_kernel;notebooker-cli --mongo-host localhost:27017 start-webapp --port 11828

inside my one docker container.

The container runs and deployes fine.

But I cannot deploy to "/" as this path serves other purposes. I need to deploy to /some-subpath. So when I got to

https://domain/some-subpath

I see

image

I.e. I get a 404 not found

[2022-10-12 11:58:38] "GET /mt-uk-mongodb-notebooker HTTP/1.1" 404 331 0.001099

With other frameworks I deploy like Panel, Streamlit, Dash, Fast Api and Flask I can specify some --prefix to the server application.

But it seems not available with notebooker? Could you add it?

jonbannister commented 1 year ago

Thank you for the detailed requests! If you are able to try a manual installation from a branch, I would love to hear if the changes on support-url-prefix have (or, will have) solved your problem.

Cheers Jon

MarcSkovMadsen commented 1 year ago

It does not work. Though some things seem improved.

command = (
    "mkdir -p /home/jovyan/shared/.analytics-workspace/.mongodb;"
    "conda install -y -c anaconda mongodb=6.0.2;"
    "mongod --dbpath /home/jovyan/shared/.analytics-workspace/.mongodb &"
    "pip install git+https://github.com/man-group/notebooker.git@support-url-prefix;"
    "python -m ipykernel install --user --name=notebooker_kernel;"
    "notebooker-cli --mongo-host localhost:27017 start-webapp --port 11828 --url-prefix /mt-uk-mongodb-notebooker"
)

image

10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/ HTTP/1.1" 200 5504 0.015893
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/node_modules/fomantic-ui/dist/semantic.css HTTP/1.1" 404 331 0.000997
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/node_modules/jquery/dist/jquery.min.js HTTP/1.1" 404 331 0.000806
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/node_modules/bootstrap-table/dist/themes/semantic/bootstrap-table-semantic.js HTTP/1.1" 404 331 0.000896
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/node_modules/datatables/media/js/jquery.dataTables.min.js HTTP/1.1" 404 331 0.002328
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/node_modules/fomantic-ui/dist/semantic.js HTTP/1.1" 404 331 0.000803
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/node_modules/datatables/media/css/jquery.dataTables.min.css HTTP/1.1" 404 331 0.000811
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/notebooker/iframe_loading.js HTTP/1.1" 200 709 0.002653
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/notebooker/one_click_notebooks.css HTTP/1.1" 200 1451 0.000920
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/notebooker/header.js HTTP/1.1" 200 3999 0.000880
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/notebooker/index.js HTTP/1.1" 200 1772 0.000896
10.86.104.39 - - [2022-10-12 16:02:24] "GET /mt-uk-mongodb-notebooker/notebooker/notebooker-icon-dark.png HTTP/1.1" 200 8963 0.001079
10.86.104.39 - - [2022-10-12 16:02:42] "GET /mt-uk-mongodb-notebooker/node_modules/fomantic-ui/dist/semantic.css HTTP/1.1" 404 331 0.001345
10.86.104.39 - - [2022-10-12 16:02:42] "GET /mt-uk-mongodb-notebooker/notebooker/one_click_notebooks.css HTTP/1.1" 304 154 0.001183
10.86.104.39 - - [2022-10-12 16:02:42] "GET /mt-uk-mongodb-notebooker/node_modules/datatables/media/css/jquery.dataTables.min.css HTTP/1.1" 404 331 0.000796
jonbannister commented 1 year ago

Aha this worked for me locally - you may need to run step 3 and 5 here since you are running a local manual version: https://notebooker.readthedocs.io/en/latest/setup.html#installing-and-running-notebooker-locally

jonbannister commented 1 year ago

Hey @MarcSkovMadsen, did you make any progress on this? Happy to merge in these changes if it has addressed your issue!