purple-motherboard-17377
09/16/2025, 5:04 PMelegant-florist-94385
09/16/2025, 7:34 PMpurple-motherboard-17377
09/17/2025, 2:19 PMelegant-florist-94385
09/17/2025, 3:30 PMpex_binary(layout="loose") which will generate the pex as a directory full of files.
single python file as the entrypoint (which cant be from inside a pex)Why can't it be inside a pex? It seems like almost exactly what you want is
pex_binary(entry_point="entrypoint.py") which will create a pex with that file, all the local source code it depends on, and all the 3rd party dependencies it needs.
You can use execution_mode="venv" to make pex install a venv from the 3rd party dependencies on first run, if you need the 3rd party deps available separately.purple-motherboard-17377
09/18/2025, 10:03 AMCMD [ "marimo", "run", "app.py", "--host", "0.0.0.0", "-p", "8080" ]
Essentailly its spinning up a web server to host an app, I don't know if it is possible/ how to do this within a pexpurple-motherboard-17377
09/18/2025, 11:17 AMpurple-motherboard-17377
09/18/2025, 11:17 AMelegant-florist-94385
09/18/2025, 11:17 AMfastapi app before. Normally run (as a shell command) with CMD [ "fastapi", "dev", "main.py" ] , I was able to run it as a python command like uvicorn.run(app, host=host, port=port) , put this in a python script, and then my entrypoint was standard python code, so it worked with pex. I'm not familiar with marimo, but perhaps it supports something similar?
If it does not, you may be able to use PEX options to configure either the build process or the install process (into the dockerfile) to give you a standard-looking venv so you can do something like
CMD [ "path/to/venv/bin/marimo", "run", "app.py", "--host", "0.0.0.0", "-p", "8080" ]purple-motherboard-17377
09/18/2025, 11:18 AMpurple-motherboard-17377
09/18/2025, 11:19 AMelegant-florist-94385
09/18/2025, 11:25 AMpants dependencies --transitive /path/to/my/entrypoint | grep src/ to find first party sources and pants dependencies --transitive /path/to/my/entrypoint | grep 3rdparty/ to find 3rd party requirements (depending on how your repo is organized), but I think that will get painful pretty quickly.purple-motherboard-17377
09/18/2025, 1:35 PM