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 许可证。

Hatchet 宣布了 Brickie,一个用于在用户自己的 AWS/EKS 账户中运行沙箱的开源工具。沙箱通过安全执行不可信代码并利用文件系统快照保留状态,支持代理式应用。Brickie 在 Kubernetes agent-sandbox 项目基础上扩展了快照、分叉、暂停和恢复功能,以及 Hatchet 的编排和可观测性。它是在对自托管沙箱基础设施的需求以及 Hatchet 集成沙箱提供商的工作的推动下创建的。该项目还解决了协调代理"会话状态"与文件系统状态的问题,使用一种将快照打包为 tar 存入 S3 的简单机制。Brickie 目前处于早期测试版,正在寻求测试者、贡献者和反馈。
相关文章

原文

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