Lab 12: a quicknotes endpoint as a wasm component on spin#1332
Open
Dekart-hub wants to merge 3 commits into
Open
Lab 12: a quicknotes endpoint as a wasm component on spin#1332Dekart-hub wants to merge 3 commits into
Dekart-hub wants to merge 3 commits into
Conversation
Signed-off-by: Aleksandr <55945487+Dekart-hub@users.noreply.github.com>
Signed-off-by: Aleksandr <55945487+Dekart-hub@users.noreply.github.com>
Signed-off-by: Aleksandr <55945487+Dekart-hub@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Build one QuickNotes-style endpoint (Moscow time as JSON) as a WebAssembly component with the Spin Go SDK, measure it against the Lab 6 Docker container, and (bonus) rebuild the same logic as a standalone WASI CLI module under bare wasmtime to contrast the two execution models.
Changes
wasm/: the Spin component, scaffolded withspin new -t http-go(Spin 3.6.3, TinyGo 0.41.1, SDKspinframework/spin-go-sdk/v2 v2.2.1)main.go:spinhttp.Handlehandler returningunix,iso,hour_minuteand the timezone as JSON; Moscow viatime.FixedZonebecause TinyGo ships no tzdataspin.toml: route scoped to/time,allowed_outbound_hosts = [], scaffold'swasip1 -buildmode=c-sharedbuild command untouchedwasm-cli/(bonus): the same logic as a no-SDK WASI command module in the CGI/WAGI shape (request from env vars, headers plus JSON to stdout) forwasmtime runsubmissions/lab12.md: build and curl evidence, the full perf table, both execution models compared, design questions a-jTesting
spin buildproduces a 0.53 MBmain.wasm;spin upserves/timewith valid Moscow-time JSON (200,application/json, RFC3339 with +03:00); POST gets 405, unrouted paths get 404-buildmode=c-sharedfails the link (the scaffold has nofunc main), the Spin component under barewasmtime runexits silently as a reactor, andwasmtime serverefuses the core modulewasmtime run --env REQUEST_METHOD=GET --env PATH_INFO=/timeprints the same JSON; per-invocation p50 6.0 ms vs 0.59 ms from the warm Spin serverChecklist
git log --show-signature)