Skip to content

Github trending [cloudflare/computer] 三合一虚拟文件系统 #963

Description

@web1992

项目地址

https://github.com/cloudflare/computer

AI 摘要

Cloudflare Computer 是一个基于 Durable Object 的虚拟文件系统,使用 SQLite 存储权威状态,并提供统一的执行入口。它支持三种后端:容器(FUSE 挂载,完整 Linux 环境)、Isolate Shell(运行 just-bash)和 Isolate JavaScript(运行 ECMAScript 模块)。各后端可组合使用,且支持无后端独立使用文件系统。目前仅限预览,适用于实验和原型开发,不适合生产环境。

README 原文

Cloudflare Computer

Cloudflare Computer is a virtual filesystem that lives inside a
Durable Object. The Durable Object holds the authoritative state in
SQLite and exposes one pluggable execution surface through
workspace.runtime. Three backends ship today:

  • Container projects the SQLite state into a sandbox container as
    a real FUSE mount. A sandbox-side daemon (computerd) mounts the state
    as a filesystem and syncs changes back over a capnweb RPC channel.
    Full Linux userland, real binaries, real network.
  • Isolate shell runs just-bash
    in a Dynamic Worker. It reaches the authoritative Workspace over
    Workers RPC, so there is no second store or sync round trip.
  • Isolate JavaScript runs an ECMAScript module in a fresh Dynamic
    Worker with structured input/results, durable relative imports,
    configured libraries, Workspace-backed node:fs/promises, and trusted ws:git and
    ws:artifacts modules.

A Workspace may register multiple backends under stable IDs.
workspace.runtime.exec(source, { backend }) is the single execution
entry point; the selected backend defines whether source is a shell
command or an ECMAScript module. Backends connect lazily on first use.

Workspace can also be constructed without a backend at all, giving
callers the filesystem on its own.

Important

PREVIEW ONLY This package is provided as a preview for feedback only.
APIs are unstable and the design is subject to change.

Suitable for experiments, exploration and prototypes. It is NOT suitable
for production use at this time.

The specification under docs/ is forward-looking — read it for
intent, not as description of the code today.

Using it

If you want to build on Cloudflare Computer, install
@cloudflare/computer and follow that
package's README — it has the installation steps, the entrypoint map,
and worked examples of the fs and runtime...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions