Show HN: Brickie – 在你自己的 AWS 账户中部署沙箱
Show HN: Brickie – Deploy sandboxes in your own AWS account

原始链接: https://github.com/hatchet-dev/brickie

Brickie 通过 `@hatchet-dev/sandbox` 提供耐用的 Kubernetes/云沙箱,基于 agent-sandbox 并使用自定义对象存储快照。每个会话都是一个 shell/工作区容器;每次更改工作区的调用都会创建一个不可变、可派生的快照,并作为可重试、可观测的 Hatchet 任务运行。它支持快速预热 Pod 启动、自定义 `sh`/`tar` 镜像、mTLS、资源限制、灵活运行时(Kata、gVisor、Nitro)、S3/GCS/Azure 存储、FIPS 模式以及本地开发的 Docker。与 agent-sandbox 基于 PVC 的状态和仅限 GKE 的快照不同,Brickie 快照按沙箱/运行 ID 键控,可用于重试、派生和恢复会话。它目前处于 beta 阶段,采用 MIT 许可证。

Hacker News 的帖子宣布 Brickie,一个 Hatchet 的开源项目,用于在用户自己的 AWS 账户中运行沙箱,主要基于 EKS。沙箱帮助代理安全执行不受信任的代码,并通过快照保留文件系统状态。Brickie 基于 Kubernetes agent-sandbox 项目,并增加了文件系统快照、分支、暂停和恢复,以及 Hatchet 的编排与可观测性。它面向需要自托管沙箱基础设施的团队,尤其是企业。帖子还解释了 Hatchet 对持久化执行和会话状态与文件系统状态协调的关注,快照存储在 S3 中。Brickie 目前处于 beta 阶段,正在寻找测试者、贡献者和部署反馈。评论讨论了沙箱提供商、Firecracker 以及在 AI 代理中使用沙箱。
相关文章

原文

release go e2e-docker e2e-kind FIPS 140-3 signed images

Brickie lets you run durable sandboxes in your own cloud / k8s cluster.

Brickie sandboxes are built on top of agent-sandbox with custom snapshot/restore implemented on top of object storage. They are designed to be called from @hatchet-dev/sandbox and support the ability to take a coordinated snapshot of agent state. This means that every sandbox call is a retryable and observable Hatchet task.

Each sandbox session is a container with a shell and a workspace and runs in your Kubernetes cluster with flexible runtime support, including Kata, gVisor and AWS Nitro. Every call that changes the workspace produces a snapshot, which can be used to fork a new sandbox or resume an existing session.

Head over to the quickstart guide to get up and running your own Brickie sandboxes with a local Hatchet instance.

Brickie is in beta. Flags, chart values and the wire contract may change before 1.0. See the changelog.

Docs: here

  • Hatchet-guaranteed safe retries: Hatchet's durable execution guarantees mean no wasted compute on retries of succesful sandbox operations.
  • Immutable and forkable snapshots: Every call that changes files in your sandbox workspace are saved and stored in object storage. They are immutable and forkable from other sandbox processes.
  • Fast starts: A warm pool of pods maintained by the provider means small cold start times for new sandbox pods.
  • Custom images: Any image with sh and tar can be used to run a sandbox.
  • mTLS for all sandboxes: The provider and each sandbox talk to each other over mutual TLS with strict guarantees around certificate issuance, rotation, and usage.
  • Resource limits: Each sandbox is backed by a pre-set network and resource limit to cap usage and to protect nodes from starvation.
  • Any object storage: Metadata and snapshots can be stored in any S3-compatible store as well as in GCS and Azure.
  • FIPS support: By default, the provider runs all of its workloads in FIPS 140-3 mode with signed and SBOM attested container images.
  • Extensible interface: Backed by drivers, the provider can be extended to support more backends apart from Docker and Kubernetes.
pnpm add @hatchet-dev/sandbox @hatchet-dev/typescript-sdk
import "@hatchet-dev/sandbox";

const session = hatchet.durableTask({
  name: "agent-session",
  fn: async (input) => {
    const sandbox = await hatchet.sandbox.create({
      id: input.conversationId,
      template: "alpine:3",
    });
    await sandbox.files.write("haiku.txt", "an old silent pond");
    const haiku = await sandbox.exec("cat haiku.txt");
    await sandbox.kill();
    return { haiku: haiku.stdout };
  },
});

// run the session for a conversation; its ID becomes the sandbox ID
const { haiku } = await session.run({ conversationId: "conv-42" });

// later, from anywhere with a Hatchet client
const again = await hatchet.sandbox.connect("conv-42");

Brickie versus agent-sandbox

Under the hood, brickie uses the agent-sandbox controller and warm pools to run sandbox pods. On top of this, the Brickie provider does a few different things:

  1. Every brickie sandbox turn produces an immutable snapshot in your object store, keyed by sandbox and Hatchet run ID. These snapshots can be forked into new sandboxes, or used to resume an existing session. On agent-sandbox, state is persisted through a PVC per sandbox, which forces a cold start, while the only point-in-time snapshot is GKE-specific.

  2. Every call is a Hatchet task, so it is retried, observable, and replayed from its own snapshot. A retried call finds the snapshot it already stored and does not run the command twice.

  3. The same code path runs on a Docker engine, so the Kubernetes cluster is not needed for development locally.

Pull requests are welcome from vouched contributors, and the first ones should be small. CONTRIBUTING.md explains how to get vouched, what to work on first and how AI use is disclosed.

MIT

联系我们 contact @ memedata.com