Explore direct gateway-to-fiber routing without an extra proxy hop

未关闭
#8 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
kubernetes, rust

调研方向

Start by tracing the current request path through Kourier, fiber-router, and Fiberd, then identify the supported routing and lifecycle hooks available in the project’s gateway setup. Compare the listed approaches against the two-proxy baseline for cold and warm latency, throughput, resources, failure handling, and operational complexity. Prototype the smallest supported integration and demonstrate the actual traffic path; done means recording a recommendation with its limitations, including whether the existing proxy hop should remain.

由索引模型根据 Issue 内容生成。

描述

a-human-needed a-needs-info
Problem

The current Fiberd integration sends every application request through two HTTP proxies:

Client → Kourier gateway → Lampyr fiber-router → application fiber

This also applies when the request uses a warm, reusable fiber. fiber-router selects the revision, acquires or reuses a fiber through Fiberd's public Clone/Release protocol, then proxies the application request and response. Fiberd itself is not in the HTTP data path.

Important distinction: reuse already exists

A Lampyr Service can opt into fiber reuse in its manifest:

execution:
  mode: reuse
  idleTimeout: 30s

Fresh-per-request remains the default. In reuse mode, fiber-router reuses fibers for that revision between requests and releases idle fibers after the configured timeout. This avoids creating a new fiber for every warm request; it does not bypass fiber-router or Kourier. Every application request still traverses both HTTP proxies.

This issue is specifically about whether application traffic can skip the extra fiber-router proxy hop while preserving the existing activation, authorization, isolation, and lifecycle behavior. It is not a request to add the reuse manifest option; that option is already implemented.

Related: Lampyr's remaining Knative dependencies are a separate question. The routing decision and the Knative installation decision are related, but neither automatically settles the other.

Possible solutions
1. Keep the current path; treat reuse as the warm-request optimization
Client → Kourier → fiber-router → existing reusable fiber

This requires no new routing or endpoint-publication machinery. Reuse already avoids a fresh fiber creation for eligible warm requests, while fiber-router retains control over capacity, revision selection, request completion, streams, WebSockets, and idle cleanup.

Trade-off: the extra HTTP proxy hop remains. Measure its actual latency/resource cost against the operational and correctness cost of alternatives before taking on a more complex design.

2. Bypass fiber-router for warm reusable fibers
Cold / no published endpoint: Client → Kourier → fiber-router → fiber
Warm / published endpoint:   Client → Kourier ───────────────→ fiber

Keep fiber-router responsible for activation and lifecycle, but publish healthy reusable-fiber endpoints to the gateway and let the gateway route warm traffic directly. Return traffic to the activation path when an endpoint is unavailable or draining.

This is primarily applicable to reuse mode; fresh-per-request requests still need per-request acquisition and completion tracking. Investigate whether stock Kourier and its supported configuration can route to per-fiber endpoints, how endpoint publication/readiness and internal Service addresses would work, and whether any required hooks are actually supported without upstream patches.

Trade-offs: can remove a proxy hop on warm traffic, but adds endpoint publication, asynchronous route propagation, stale-endpoint handling, and draining. It also needs reliable in-flight/activity signals so idle cleanup never releases a fiber serving a request, stream, or WebSocket. A route update means bypass is not guaranteed on the literal next request.

3. Use one activation-aware gateway
Client → gateway → fiber
            │
            └─ control calls → activation service / Fiberd

Use a gateway with supported extension points to acquire/select the fiber and forward the application request directly to its endpoint. The activation component can remain, but handles control messages rather than relaying request/response bodies.

This could support both fresh-per-request and reuse if the gateway can reliably couple acquisition and release to request completion, cancellation, stream completion, and WebSocket closure. Verify supported endpoint-selection and completion hooks; an authorization filter alone should not be assumed sufficient, and stock Kourier should not be assumed to provide these hooks.

Trade-offs: one application HTTP proxy and no per-request Kubernetes reconciliation, but requires gateway-specific integration and robust lifecycle behavior.

4. Make fiber-router the sole application gateway

Expose the existing router as the HTTP/TLS ingress and remove the preceding application-level Kourier hop, while retaining its Fiberd acquisition and completion tracking.

Trade-offs: potentially the simplest lifecycle model, but Lampyr would own more gateway responsibilities: TLS/certificate management, public ingress exposure, routing readiness, observability, and hardened public-server behavior. Compare that burden with extending an established gateway.

Requirements whichever option we choose
  • Preserve default fresh-per-request isolation and release at request completion. A fresh request must not attach to a prior request's fiber.
  • Preserve optional reuse, capacity/concurrency enforcement, weighted revision selection, and protected Grant authorization/revocation.
  • Never idle-release fibers while requests, streams, or WebSockets are active.
  • Handle cancellation, fiber/home crashes, gateway restarts, stale endpoints, route propagation races, and draining before release.
  • Keep HTTP, streaming, WebSockets, internal service addresses, TLS, and optional Broker/Event Grid delivery working on Kind and AKS.
  • Do not patch Fiberd, Knative, or Kourier, or reintroduce their source submodules.
Investigation / outcome

Compare viable options against today's two-proxy baseline for cold and warm latency, throughput, resource use, failure behavior, and operational complexity. Prototype the smallest supported integration and demonstrate the actual traffic path, not just a route configuration change.

Record a recommendation and its limitations before implementation. If keeping the extra proxy is the best trade-off, document why rather than treating it as an unavoidable requirement of Fiberd.

主要语言
Rust
星标
3
派生
2
平均合并
3 天 57 分钟
30 天内合并 PR
17

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hyperlight-dev/lampyr 的其他 Issue

查看 hyperlight-dev/lampyr 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。