diff --git a/README.md b/README.md index aa9e312..2c0d628 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,18 @@ + +> [!NOTE] +> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。 +> [English](./README.en.md) · [原始项目](https://github.com/Tracer-Cloud/opensre) · [上游 README](https://github.com/Tracer-Cloud/opensre/blob/HEAD/README.md) +> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。 +
The open-source framework for AI SRE agents, and the training and evaluation environment they need to improve. Connect the 60+ tools you already run, define your own workflows, and investigate incidents on your own infrastructure.
+面向 AI SRE 智能体的开源框架,以及它们持续改进所需的训练与评估环境。连接你已运行的 60+ 种工具,定义自己的工作流,并在自有基础设施上调查事故。
- Quickstart · - Docs · - FAQ · - Security + 快速入门 · + 文档 · + 常见问题 · + 安全
@@ -40,78 +46,78 @@ --- -> 🚧 Public Alpha: Core workflows are usable for early exploration, though not yet fully stable. The project is in active development, and APIs and integrations may evolve +> 🚧 公开 Alpha:核心工作流可用于早期探索,但尚未完全稳定。项目正在积极开发中,API 与集成可能会演进 --- -## Table of Contents +## 目录 -- [Why OpenSRE?](#why-opensre) -- [Install](#install) -- [Quick Start](#quick-start) -- [Deployment](#deployment) -- [How OpenSRE Works](#how-opensre-works) -- [Benchmark](#benchmark) -- [Capabilities & integrations](#capabilities--integrations) -- [Contributing & development](#contributing--development) -- [Security](#security) -- [Telemetry](#telemetry) -- [License](#license) -- [Citations](#citations) +- [为什么选择 OpenSRE?](#why-opensre) +- [安装](#install) +- [快速入门](#quick-start) +- [部署](#deployment) +- [OpenSRE 工作原理](#how-opensre-works) +- [基准测试](#benchmark) +- [能力与集成](#capabilities--integrations) +- [贡献与开发](#contributing--development) +- [安全](#security) +- [遥测](#telemetry) +- [许可证](#license) +- [引用](#citations) --- -## Why OpenSRE? +## 为什么选择 OpenSRE? -When something breaks in production, the evidence is scattered across logs, metrics, traces, runbooks, and Slack threads. OpenSRE is an open-source framework for AI SRE agents that resolve production incidents, built to run on your own infrastructure. +当生产环境出现问题时,证据分散在日志、指标、链路追踪、运行手册(runbook)和 Slack 讨论串中。OpenSRE 是一个用于解决生产事故的开源 AI SRE 智能体框架,专为在自有基础设施上运行而构建。 -We do that because SWE-bench1 gave coding agents scalable training data and clear feedback. Production incident response still lacks an equivalent. +我们这样做,是因为 SWE-bench1 为编码智能体提供了可扩展的训练数据和清晰的反馈。生产事故响应仍缺少同等的基础设施。 -Distributed failures are slower, noisier, and harder to simulate and evaluate than local code tasks, which is why AI SRE, and AI for production debugging more broadly, remains unsolved. +分布式故障比本地代码任务更慢、更嘈杂、更难模拟和评估,这也是 AI SRE,以及更广泛的面向生产调试的 AI,仍未被解决的原因。 -OpenSRE is building _that_ missing layer: +OpenSRE 正在构建_这一_缺失的层次: -> an open reinforcement learning environment for agentic infrastructure incident response, with end-to-end tests and synthetic incident simulations for realistic production failures +> 面向智能体基础设施事故响应的开放强化学习环境,配备端到端测试和合成事故模拟,以复现真实的生产故障 -We do that by: +我们通过以下方式实现: -- building easy-to-deploy, customizable AI SRE agents for production incident investigation and response -- running scored synthetic RCA suites that check root-cause accuracy, required evidence, and adversarial red herrings [(tests/synthetic)](tests/synthetic/rds_postgres) -- running real-world end-to-end tests across cloud-backed scenarios including Kubernetes, EC2, CloudWatch, Lambda, ECS Fargate, and Flink [(tests/e2e)](tests/e2e) -- keeping semantic test-catalog naming so e2e vs synthetic and local vs cloud boundaries stay obvious [(tests/README.md)](tests/README.md) +- 构建易于部署、可定制的 AI SRE 智能体,用于生产事故调查与响应 +- 运行带评分的合成 RCA(根因分析)套件,检验根因准确性、所需证据以及对抗性干扰项(红鲱鱼)[(tests/synthetic)](tests/synthetic/rds_postgres) +- 在涵盖 Kubernetes、EC2、CloudWatch、Lambda、ECS Fargate 和 Flink 等云支撑场景的真实端到端测试中运行 [(tests/e2e)](tests/e2e) +- 保持语义化的测试目录命名,使 e2e 与 synthetic、本地与云之间的边界一目了然 [(tests/README.md)](tests/README.md) -Our mission is to build AI SRE agents on top of this, scale it to thousands of realistic infrastructure failure scenarios, and establish OpenSRE as the benchmark and training ground for AI SRE. +我们的使命是在此之上构建 AI SRE 智能体,将其扩展到数千种真实的基础设施故障场景,并将 OpenSRE 确立为 AI SRE 的基准与训练场。 1 https://arxiv.org/abs/2310.06770 --- -## Install +## 安装 -The root installer URL auto-detects Unix shell vs PowerShell and installs the latest build from `main`. OpenSRE moves quickly, so `main` is the latest stable version for normal installs. +根安装器 URL 会自动检测 Unix shell 与 PowerShell,并从 `main` 安装最新构建。OpenSRE 迭代很快,因此 `main` 是常规安装的最新稳定版本。 -macOS / Linux: +macOS / Linux: ```bash curl -fsSL https://install.opensre.com | bash ``` -The macOS/Linux installer does not require sudo. If no writable bin directory is already on `PATH`, it installs to `~/.local/bin` and prints the shell command to apply the PATH update. +macOS/Linux 安装器不需要 sudo。若 `PATH` 上尚无可写的 bin 目录,则会安装到 `~/.local/bin`,并打印用于更新 PATH 的 shell 命令。 -Equivalent explicit main-channel form: +等价的显式 main 渠道形式: ```bash curl -fsSL https://install.opensre.com | bash -s -- --main ``` -Homebrew: +Homebrew: ```bash brew tap tracer-cloud/tap brew install tracer-cloud/tap/opensre ``` -Windows (PowerShell): +Windows(PowerShell): ```powershell irm https://install.opensre.com | iex @@ -132,31 +138,31 @@ Configure once, then pick how you want to run investigations: opensre onboard ``` -**Interactive shell** — with no subcommand, `opensre` starts a REPL (TTY required). Describe incidents in plain language, stream investigations, and use slash commands for session control (`/help`, `/status`, `/cost`, `/sessions`, `/resume`, `/compact`, `/new`, `/exit`), integrations (`/integrations list`, `/integrations verify`), local agent fleet monitoring (`/agents`), and reasoning depth (`/effort` for **OpenAI** and **Codex** — `low` through `max`). Ctrl+C cancels an in-flight investigation without losing session state. See **[interactive shell commands](https://www.opensre.com/docs/interactive-shell-commands)** for the full reference. +**交互式 shell** — 不带子命令时,`opensre` 会启动 REPL(需要 TTY)。用自然语言描述事故、流式输出调查过程,并使用斜杠命令进行会话控制(`/help`、`/status`、`/cost`、`/sessions`、`/resume`、`/compact`、`/new`、`/exit`)、集成(`/integrations list`、`/integrations verify`)、本地智能体集群监控(`/agents`)以及推理深度(**OpenAI** 与 **Codex** 使用 `/effort` — `low` 至 `max`)。Ctrl+C 可取消进行中的调查,且不会丢失会话状态。完整参考见 **[交互式 shell 命令](https://www.opensre.com/docs/interactive-shell-commands)****。 ```bash opensre ``` -**One-shot investigation** — run the agent once against an alert file: +**一次性调查** — 针对告警文件运行智能体一次: ```bash opensre investigate -i tests/e2e/kubernetes/fixtures/datadog_k8s_alert.json ``` -**Remote runtime investigation** — investigate a deployed service by name (live health, logs, and deployment status): +**远程运行时调查** — 按名称调查已部署的服务(实时健康状态、日志与部署状态): ```bash opensre investigate --service api-backend ``` -**Hermes log watch** — tail a Hermes `errors.log`, classify incidents, and optionally alert on Telegram: +**Hermes 日志监视** — 跟踪 Hermes `errors.log`,对事故进行分类,并可选择通过 Telegram 告警: ```bash opensre hermes watch ``` -Other useful commands: +其他实用命令: ```bash opensre integrations setup @@ -167,19 +173,19 @@ opensre uninstall # remove opensre and all local data --- -## Deployment +## 部署 -Two primary AWS EC2 paths and a general hosted option: +两条主要的 AWS EC2 路径,以及一个通用托管选项: -- **EC2 (Docker/ECR):** `make build-image` then `make deploy` — runs `opensre-web` and `opensre-gateway` containers on one instance. -- **Gateway (AMI + systemd):** `make bake-gateway` then `make deploy-gateway` — Telegram gateway only, no Docker, baked into a custom AMI. -- **Hosted (Railway / ECS / Vercel):** deploy with the repo `Dockerfile`; set `LLM_PROVIDER` and the matching API key (see [`.env.example`](.env.example)), plus `DATABASE_URI` and `REDIS_URI` if persistence is needed. +- **EC2(Docker/ECR):** `make build-image`,然后 `make deploy` — 在同一实例上运行 `opensre-web` 与 `opensre-gateway` 容器。 +- **Gateway(AMI + systemd):** `make bake-gateway`,然后 `make deploy-gateway` — 仅 Telegram 网关,无需 Docker,内置于自定义 AMI。 +- **托管(Railway / ECS / Vercel):** 使用仓库中的 `Dockerfile` 部署;设置 `LLM_PROVIDER` 及对应的 API 密钥(见 [`.env.example`](.env.example)),若需持久化还需设置 `DATABASE_URI` 与 `REDIS_URI`。 -**[Full deployment steps and prerequisites → DEPLOYMENT.md](DEPLOYMENT.md)** +**[完整部署步骤与前置条件 → DEPLOYMENT.md](DEPLOYMENT.md)** --- -## How OpenSRE Works +## OpenSRE 工作原理