Hi,
I’m working on an interactive app for marimo and I almost have it working.
marimo seems to have good support for being proxied - marimo edit --help
shows these flags:
--proxy TEXT Address of reverse proxy.
...
--base-url TEXT Base URL for the server. Should start with a /.
[default: ""]
Here is the relevant bit of my script.sh.erb
:
#!/usr/bin/env bash
module purge
# TODO parameterize python module
module load fhPython uv
# Output debug info
module list
# TODO parameterize path to edit
mkdir -p ${HOME}/.marimo-notebooks
# TODO use a token
uvx --python $(which python) marimo edit --proxy \
openondemand.fredhutch.org:443 --no-token --headless \
--host 0.0.0.0 --port ${port} \
--base-url /rnode/$(hostname)/${port} ${HOME}/.marimo-notebooks
marimo spits out (in output.log
):
Create or edit notebooks in your browser 📝
➜ URL: https://openondemand.fredhutch.org/rnode/gizmoj14/60263
So it seems like it totally understands proxying. Unfortunately when I go to that link, I get this:
That doesn’t actually look like an HTML page; it’s how the browser I use renders JSON files.
If I go to the browser’s dev tools I can see that a request to https://openondemand.fredhutch.org/rnode/gizmoj14/60263/
returned a 404. The response header also included a content type of application/json
which is maybe why my browser is treating it as a json page.
Also, the response Server header is “uvicorn”, which is the server that marimo uses, so I have the empty satisfaction that at least I am talking to marimo even if I am not seeing what I want.
If I go directly to the node/port, with the base URL added in, I get what I expect/want, the marimo editing page:
http://gizmoj14:60263/rnode/gizmoj14/60263/
So while it seems like marimo knows how to be proxied, something isn’t working right.
What is going on and how can I troubleshoot this?
Thanks,
Dan