runwasi icon indicating copy to clipboard operation
runwasi copied to clipboard

Entrypoint string specification and validation

Open ipuustin opened this issue 2 years ago • 7 comments

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:

  1. foo#bar
  2. #bar
  3. foo#bar#bar
  4. foo
  5. #foo#bar
  6. foo#
  7. foo#bar; -- %

ipuustin avatar Aug 08 '23 09:08 ipuustin

also related to #194

jsturtevant avatar Aug 08 '23 15:08 jsturtevant

👍

utam0k avatar Aug 14 '23 12:08 utam0k

More discussion happened here: https://cloud-native.slack.com/archives/C04LTPB6Z0V/p1693606484029809

Mossaka avatar Sep 05 '23 02:09 Mossaka

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)

jsturtevant avatar Sep 18 '23 22:09 jsturtevant

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.

ereslibre avatar Sep 19 '23 06:09 ereslibre