deislabs / wagi

Write HTTP handlers in WebAssembly with a minimal amount of work
Apache License 2.0
889 stars 45 forks source link

Dynamically changing the set of served modules #187

Closed charliermarsh closed 2 years ago

charliermarsh commented 2 years ago

(Extremely cool project!)

I'd like to run a Wagi server, but update the set of served modules / endpoints over time, without restarting the server. Is that possible under the current design?

For example, semantically, I could imagine a modules.toml like:

[[module]]
route = "/(.*)"
module = "dir/$1"

...where you 404 if the requested module doesn't exist, read the module from disk the first time you receive a request on that route, etc.

Alternatively, I could image updating modules.toml and having the server react to that update (or even read it on every request, though I assume that'd be prohibitively slow).

(AFAIU the current design reads the modules from disk on startup and creates the router map, so wondering if this is out of scope right now.)

itowlson commented 2 years ago

This isn't something we support at the moment, and I doubt it's likely to happen, at least as written. While I can't speak for the current Deis Labs team, it looks like this repo has been pretty quiet since the original authors and maintainers left Microsoft. And it would require significant design work around what happens in the Bindle case, which is envisaged to be the primary deployment scenario for workloads other than local dev. Sorry I can't give you a more positive response; and of course I'm happy to discuss further.

charliermarsh commented 2 years ago

No worries at all. Figured it was worth asking before I tried it myself. Appreciate the response!