Skip to content

feat(lab12): Spin WASM /time endpoint with perf and wasmtime bonus#1409

Open
markovav-official wants to merge 18 commits into
inno-devops-labs:mainfrom
markovav-official:feature/lab12
Open

feat(lab12): Spin WASM /time endpoint with perf and wasmtime bonus#1409
markovav-official wants to merge 18 commits into
inno-devops-labs:mainfrom
markovav-official:feature/lab12

Conversation

@markovav-official

Copy link
Copy Markdown

Goal

Build a Moscow-time /time HTTP endpoint as a Spin/TinyGo WASM component, benchmark it against the Lab 6 Docker image, and compare Spin's wasi-http model with a standalone wasmtime run module.

Changes

  • Add wasm/ — Spin Go SDK component (spin.toml, main.go, go.mod) serving JSON at GET /time
  • Add wasm-cli/ — bonus standalone WASI module (CGI-style) runnable under wasmtime run
  • Add submissions/lab12.md with design answers (a–j) and perf table
  • Add submissions/attachments/lab12/ — build logs, curl output, hyperfine JSON, cold-start samples
  • Add cloud/scripts/lab12-vm-*.sh — VM toolchain setup and benchmark scripts

Testing

  • University VM: spin build → 354 KB main.wasm; spin up + curl /time → valid Moscow JSON
  • Bonus: tinygo build -target=wasiwasmtime run --env REQUEST_METHOD=GET --env PATH_INFO=/time → same JSON
  • Perf vs Lab 6 Docker (quicknotes:lab6): 3.8 MB vs 354 KB; warm p50 7.1 ms vs 9.4 ms; cold p50 1.4 s vs 12.9 s (constrained 1.8 GiB VM)
  • Bonus cold: wasmtime run ~12 ms per invocation

Checklist

  • Title is a clear sentence (≤ 70 chars)
  • Commits are signed (git log --show-signature)
  • submissions/lab12.md updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant