Support WASI-HTTP 0.3 services in the Wasmtime runtime

オープン
#196 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust, wasm

調査の方向性

Start with drivers/wasmtime/driver/src/main.rs, especially the built-in WASI linking at lines 547–559, and review the Wasmtime 49 WASI-HTTP 0.3 host integration and typed Service::handle reference. Then trace the driver's networking and snapshot-restoration paths to determine how an HTTP listener and per-instance resources fit the runtime. Done means a forwarded-port request reaches the async handler, streams a correct response, works after snapshot restore, and existing command and library examples still pass.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Request

Support serving a standard wasi:http/[email protected] component with the Wasmtime runtime, including after restoring a Hyperlight snapshot.

The application should implement the standard HTTP handler rather than provide its own TCP server or a custom JSON request/response ABI. The runtime should handle the HTTP host interfaces and request dispatch.

Current behavior

The Wasmtime driver already supports WASI commands, library components, and asynchronous WASI 0.3 exports. The calculator example demonstrates both directions of calls:

However, the driver's built-in WASI interfaces explicitly exclude wasi:http, and its Cargo dependencies do not include wasmtime-wasi-http. Supporting asynchronous component exports does not by itself provide an HTTP host.

For WASI-HTTP 0.3, the relevant export is wasi:http/handler.handle, not the 0.2 incoming-handler interface:

handle: async func(request: request) -> result<response, error-code>;

These request/response resources and their body streams/futures need the standard host implementation rather than an application-defined JSON callback.

Proposed direction

  • Use the compatible wasmtime-wasi-http 0.3 implementation alongside the driver's existing Wasmtime dependency.
  • Provide the HTTP context/resource table and link the standard HTTP imports.
  • Add an explicit, documented serving path that dispatches network requests to the component's asynchronous handler and streams the response back.
  • Prefer a runtime-owned HTTP listener reachable through the existing Hyperlight port-forwarding/network mechanism, keeping Wasmtime resources and streams local to the guest-side Wasmtime embedder.
  • Keep tooling simple: a small component example and a normal hluk invocation, without making users register every HTTP import or write a custom host.
  • Preserve existing WASI command and library execution.

The precise serving API should fit the existing runtime design; this is not a proposal to implement HTTP through the calculator's JSON ABI.

Validation

  • A minimal WASI-HTTP 0.3 component serves a GET request through a forwarded port.
  • Method, path/query, headers, status, and a POST body round-trip correctly.
  • Response body streaming works without buffering the complete body first.
  • Client disconnects and component errors terminate cleanly without leaking tasks or resources.
  • Serving works after restoring a compatible snapshot, including independent restored instances.
  • Existing command, calculator, and asynchronous export examples still work.

References

Wasmtime currently marks its 0.3 HTTP implementation experimental and unstable. Compatibility should be pinned and tested explicitly rather than presented as production-ready.

主要言語
Rust
スター
72
フォーク
14
平均マージ
15時間 29分
マージ済み PR(30日)
40

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hyperlight-dev/hyperlight-unikraft のほかの issue

hyperlight-dev/hyperlight-unikraft の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。