Entrypoint string specification and validation
Right now the entrypoint strings are '#'-delimited (Wasm file and method): https://github.com/containerd/runwasi/pull/102. In https://github.com/containerd/runwasi/pull/219 there was some discussion about specifying this particular entrypoint string format and semantics well, so it would be documented for users and other projects could potentially support this.
In particular, we need to write validation code and tests. For example, #219 listed these test cases:
-
foo#bar -
#bar -
foo#bar#bar -
foo -
#foo#bar -
foo# -
foo#bar; -- %
also related to #194
👍
More discussion happened here: https://cloud-native.slack.com/archives/C04LTPB6Z0V/p1693606484029809
Pulling out the relevant differences from the slack thread:
- wasmtime shim expects entrypoint to be a main.wasm#foo or main.wat#foo
- wasmedge , lunatic expect entrypoint to be main.wasm (I am not sure if .wat is supported)
- wws shim expect a app binary. (e.g. hello.js)
- slight and spin don't expect anything from entrypoint because they look for framework specific manifest files on root directory (e.g. spin.toml)
wws shim expect a app binary. (e.g. hello.js)
wws behaves as slight and spin. It may use a specific manifest too (if present) and scans for functions defined at any level beneath the root directory, mapping that subpath at the appropriate place in the HTTP server.