Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Installer flags in [installation options](./getting-started/install-options.md)

1. It runs the `init` service, which checks that the data volume belongs to the installed release and finishes initializing it if the first start stopped early.
2. It runs `oac-core check-config` with the `.env` you edited and changes no service if a value is invalid.
3. It runs `docker compose up -d --wait` with the images already on the host. Compose recreates only the services whose configuration changed and removes containers the release no longer defines.
3. It runs `docker compose up -d --wait` with the images already on the host. Compose recreates only the services whose configuration changed and removes containers the release no longer defines. If a service does not become healthy, the message names it and the command that prints its log.

Use `docker compose ps` to check the services. See [stop and restart](./getting-started/operations.md#stop-and-restart) for what a restart interrupts.

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/install-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Stop with `docker compose stop` using the same files and environment. Back up th

## Process settings

These flags are written to `.env` once. After installation, edit that file and run `oac apply`. Rerunning the installer on an existing installation ignores these flags and starts it with the saved settings.
These flags are written to `.env` once. After installation, edit that file and run `oac apply`. Rerunning the installer on an existing installation ignores these flags, names those that differ from the saved settings, and starts it with the saved settings.

| Flag | `.env` variable |
| --- | --- |
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ The script downloads that release's Compose files, checks their SHA-256, and:
2. prepares the [installation directory](../configuration.md#installation-directory), `~/.oac/core`, with `.env` and the native `oac` command (`oac.exe` on Windows);
3. starts the services with Docker Compose. Web serves the console on port 8080 and forwards `/v1`, `/api/v1` and `/docs` to Core. Core and PostgreSQL are not published.

The installer prints the console address and Core key. After signing in, configure execution resources and create Projects in Web.
The installer prints the console address and, on a fresh install only, the Core key; a rerun or upgrade prints `oac core-key --show` instead. When the installer chose the console address itself, it adds that browsers must open exactly that address and how to change it with `OAC_PUBLIC_URL`. After signing in, configure execution resources and create Projects in Web.

Downloads and configuration checks happen before the installation directory is published. After that, failures preserve the configuration and data and report the failed step; inspect it with `docker compose logs --tail 100` in the installation directory. Fix the reported cause and rerun the same command, or specify the installation directory:
Downloads and configuration checks happen before the installation directory is published. After that, failures preserve the configuration and data. A rejected setting or data volume is reported by itself: fix it as the message says. A service that does not become healthy within three minutes is named together with the `docker compose logs --tail 50` command for it; fix the cause and rerun the same command. Ctrl-C prints `Interrupted; rerun the installer to continue.` and leaves the installation ready for that rerun. Rerun the same command, or specify the installation directory:

```bash
curl -fsSL https://openagentcore.dev/install.sh | bash -s -- --install-dir "$HOME/.oac/core"
```

Use your chosen directory if it differs. A rerun uses the saved Compose file and settings; installation flags only apply to new directories. Existing images and containers are reused; missing images are downloaded. To change settings, edit `.env` and run `oac apply`. To move to a newer release, follow [Upgrade](./operations.md#upgrade).
Use your chosen directory if it differs. A rerun uses the saved Compose file and settings; installation flags only apply to new directories, and the installer names the ones it ignored. Existing images and containers are reused; missing images are downloaded. To change settings, edit `.env` and run `oac apply`. To move to a newer release, follow [Upgrade](./operations.md#upgrade).

For insufficient space or quota, free space on the filesystem named by the error. Image-loading failures can also require space in Docker's storage, which may be on a different filesystem.

Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ docker compose -f ~/.oac/core/compose.yaml ps
| `docker compose ps` | Shows the services. Run it in the installation directory |
| `docker compose start` | Starts the services |
| `docker compose stop` | Stops the services. Data, nodes and sandboxes are kept |
| `oac apply` | Checks the data volume and `.env`, then starts the services and recreates those whose configuration changed; see [how oac apply works](../configuration.md#how-oac-apply-works). A failed check changes no service |
| `oac apply` | Checks the data volume and `.env`, then starts the services and recreates those whose configuration changed; see [how oac apply works](../configuration.md#how-oac-apply-works). A failed check changes no service. On success it prints `Services are running with the current settings.` |
| `oac core-key [--show]` | Identifies the key location in the data volume, or prints the key with `--show` |
| `oac rotate-core-key` | Replaces the Core key and restarts Core and Web |
| `oac rotate-core-key` | Replaces the Core key and restarts Core and Web, then says how to read the new key |
| `docker compose down` | Removes the containers. Data is kept |
| `oac uninstall` | Deletes the installation and its data after confirmation; see [Uninstall](#uninstall) |

Expand Down Expand Up @@ -216,7 +216,7 @@ Without `--upgrade`, another release's installer changes nothing and stops with

The installer downloads the release's `compose.yaml` and pulls missing images. Before it replaces any file, it runs the new release's configuration check and initialization with the installation's `.env` and Compose overrides. Initialization upgrades the data volume, or refuses a downgrade. The installer then puts the new `compose.yaml` and `oac` in place and starts the services, recreating those that changed; Core migrates the database as it starts. [Deployment](https://github.com/MiniMax-AI/OpenAgentCore/blob/main/deploy/README.md#installation) describes each step. The restart interrupts work as any [Core restart](#stop-and-restart) does; nodes and sandboxes keep running and reconnect.

On success the installer prints the Core key and the line `Upgraded from <old> to <new>. Settings → Sandbox and scheduling offers this release's Runtime; sandboxes keep their current Runtime until you apply it.`
On success the installer prints the console address, `oac core-key --show` in place of the key, and the line `Upgraded from <old> to <new>. Settings → Sandbox and scheduling offers this release's Runtime; sandboxes keep their current Runtime until you apply it.`

If a check fails, the installer prints `Upgrade stopped; the running services are unchanged` with Docker's output, and the previous release keeps serving. Fix the cause and rerun the command. Once initialization has upgraded the data volume, the previous release can no longer start on it: if a later step fails, for example with `startup failed; data retained, rerun the installer`, rerun the same command, which repeats every step safely, or [roll back](#roll-back).

Expand Down Expand Up @@ -277,7 +277,7 @@ The project is the `oac-…` name from the list. Then delete `~/.oac/core.lock`
| `This account cannot access …` | An earlier run with `sudo` left files owned by root. Run the `sudo chown` command the message prints, then rerun as your own account |
| `Docker Compose 2.26 or newer is required` | Install or update the Docker Compose plugin |
| `Docker could not pull …` | The Docker daemon cannot reach the registry. Configure its proxy or a registry mirror, or use the [offline archive](./install-options.md#offline-hosts) |
| `startup failed; data retained, rerun the installer` | Read the service logs above it, fix the cause, then [resume installation](./install.md#install); keep the data |
| `startup failed; data retained, rerun the installer` | The message lists the services that are not healthy and the `docker compose logs --tail 50` command for them. Fix the cause, then [resume installation](./install.md#install); keep the data. After `oac apply`, the same message says to run `oac apply` again |
| Web answers 403 `Forbidden` | The browser host is not `OAC_PUBLIC_URL`. Open that origin; a reverse proxy must pass the original Host |
| Web shows that Core is unavailable (502) | Core is stopped or failing: `docker compose ps`, then Core's log |
| Session creation returns 400 `model_provider_required` | No model provider: set a [default model](../configuration.md#default-models) for the Harness, or pass one; self-hosted Sessions always pass their own |
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "配置参考"
source: docs/configuration.md
source_hash: 51d98943e71402c79cf134e757192607c3628944369e869a69a9582e34fa8666
source_hash: 600946b2952a270983450ee93e75fbcdb950c2249ff845c7e3fc81a6154a6910
---

Core 安装的每项设置都恰好只有一个归属位置,分属以下三类:
Expand All @@ -26,7 +26,7 @@ Core 安装的每项设置都恰好只有一个归属位置,分属以下三类

1. 它运行 `init` 服务,确认数据卷属于已安装的版本;如果首次启动中途停止,就完成初始化。
2. 它用你改过的 `.env` 运行 `oac-core check-config`。值无效时不改动任何服务。
3. 它用主机上已有的镜像运行 `docker compose up -d --wait`。Compose 只重新创建配置有变化的服务,并移除该版本不再定义的容器。
3. 它用主机上已有的镜像运行 `docker compose up -d --wait`。Compose 只重新创建配置有变化的服务,并移除该版本不再定义的容器。若有服务未变为健康,消息会指出该服务和打印其日志的命令。

用 `docker compose ps` 检查服务。重启会中断哪些操作,见[停止和重启](getting-started/operations.md#stop-and-restart)。

Expand Down
4 changes: 2 additions & 2 deletions docs/zh/getting-started/install-options.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "安装选项"
source: docs/getting-started/install-options.md
source_hash: dc50c81c07f235146acb81aa965c6d9814dc3e57e43fd9769f98713eb008da4f
source_hash: a27a6f3c7c819690fa81d5ede14c80b93446ffea33781764272dc9bec58ea942
---

[默认安装](install.md)无需任何选项。本页介绍安装选项、Compose 部署和反向代理配置。
Expand Down Expand Up @@ -47,7 +47,7 @@ docker compose exec web oac-web core-key

## 进程设置 {#process-settings}

这些标志只会一次性写入 `.env`。安装完成后,编辑该文件并运行 `oac apply`。对已有安装重新运行安装程序时,这些标志会被忽略,安装以已保存的设置启动。
这些标志只会一次性写入 `.env`。安装完成后,编辑该文件并运行 `oac apply`。对已有安装重新运行安装程序时,这些标志会被忽略,安装程序会指出与已保存设置不同的标志,并以已保存的设置启动。

以下表格是由脚本自动生成的参考信息,因此保留为英文原文:
| Flag | `.env` variable |
Expand Down
8 changes: 4 additions & 4 deletions docs/zh/getting-started/install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "安装 Core 和 Web"
source: docs/getting-started/install.md
source_hash: de77f596cad24c26ddb2ddfa71ef104ace08dfe62d57a785b26f692df8f5a3ed
source_hash: 5589a96a188bc9d778f5bebf8cab78db7f9fbebffb1656a0b91001ac05f31d95
---

一条命令即可在 Linux、macOS 或 Windows 上安装 Core、Web 控制台和 PostgreSQL。用 Core 密钥登录 Web,设置默认模型并签发项目 API 密钥。应用使用这些密钥调用 Core。Session 在你添加的节点上的沙箱中运行,也可以在 E2B 上运行。
Expand Down Expand Up @@ -57,15 +57,15 @@ curl -fsSL https://openagentcore.dev/install.sh | bash -s -- --public-url https:
2. 准备[安装目录](../configuration.md#installation-directory) `~/.oac/core`,写入 `.env` 和原生 `oac` 命令(Windows 为 `oac.exe`);
3. 用 Docker Compose 启动服务。Web 在 8080 端口提供控制台,并把 `/v1`、`/api/v1` 和 `/docs` 转发到 Core。Core 和 PostgreSQL 不发布端口。

安装器会打印控制台地址和 Core 密钥。登录后,在 Web 中配置执行资源并创建项目。
安装器会打印控制台地址;仅在全新安装时打印 Core 密钥,重新运行或升级则打印 `oac core-key --show`。控制台地址由安装器自行选定时,它还会提示浏览器必须打开的确切地址,以及如何用 `OAC_PUBLIC_URL` 修改。登录后,在 Web 中配置执行资源并创建项目。

安装目录就位前,先完成下载和配置检查。之后的失败会保留配置与数据,并报告失败步骤;在安装目录运行 `docker compose logs --tail 100` 查看日志。修复报错后,重新执行同一命令,或指定安装目录即可继续:
安装目录就位前,先完成下载和配置检查。之后的失败会保留配置与数据。被拒绝的设置或数据卷会单独报告,按提示修复即可。服务三分钟内未变为健康时,会列出这些服务和查看其日志的 `docker compose logs --tail 50` 命令;修复原因后重新执行同一命令。按 Ctrl-C 会打印 `Interrupted; rerun the installer to continue.`,安装保持可继续的状态。重新执行同一命令,或指定安装目录即可继续:

```bash
curl -fsSL https://openagentcore.dev/install.sh | bash -s -- --install-dir "$HOME/.oac/core"
```

如果使用了其他目录,请替换路径。重新执行时沿用已保存的 Compose 文件和设置;安装参数只对新目录生效。已有镜像和容器直接复用,缺失镜像会重新下载。修改设置请编辑 `.env` 并运行 `oac apply`。要换到更新的发布版本,请按[升级](operations.md#upgrade)操作。
如果使用了其他目录,请替换路径。重新执行时沿用已保存的 Compose 文件和设置;安装参数只对新目录生效,安装器会指出被忽略的参数。已有镜像和容器直接复用,缺失镜像会重新下载。修改设置请编辑 `.env` 并运行 `oac apply`。要换到更新的发布版本,请按[升级](operations.md#upgrade)操作。

空间或配额不足时,请释放错误信息所指文件系统的空间。加载镜像失败还可能需要释放 Docker 存储空间,该存储可能位于另一个文件系统。

Expand Down
10 changes: 5 additions & 5 deletions docs/zh/getting-started/operations.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "运维"
source: docs/getting-started/operations.md
source_hash: c4e6dc4ae4e0167591ecad9e5a8534271c523e655a95d605c5cd7f3902db4876
source_hash: daba721bddebf8d6544ddef597390307a7b4a28f041978133acc200004812d69
---

安装运维人员负责 Core 主机、存储和可用性。节点主机运行各自的服务;参阅[节点](nodes.md)。设置见[配置参考](../configuration.md)。
Expand All @@ -19,9 +19,9 @@ docker compose -f ~/.oac/core/compose.yaml ps
| `docker compose ps` | 在安装目录中展示服务 |
| `docker compose start` | 启动服务 |
| `docker compose stop` | 停止服务。保留数据、节点和沙箱 |
| `oac apply` | 检查数据卷和 `.env`,然后启动服务,并重新创建配置有变化的服务;参见 [oac apply 的工作方式](../configuration.md#how-oac-apply-works)。校验失败时不改动任何服务 |
| `oac apply` | 检查数据卷和 `.env`,然后启动服务,并重新创建配置有变化的服务;参见 [oac apply 的工作方式](../configuration.md#how-oac-apply-works)。校验失败时不改动任何服务。成功时打印 `Services are running with the current settings.` |
| `oac core-key [--show]` | 指出 Core 密钥在数据卷中的位置;加上 `--show` 时打印密钥本身 |
| `oac rotate-core-key` | 替换 Core 密钥并重启 Core 和 Web |
| `oac rotate-core-key` | 替换 Core 密钥并重启 Core 和 Web,然后说明如何读取新密钥 |
| `docker compose down` | 移除容器。数据保留 |
| `oac uninstall` | 确认后删除安装及其数据;参见[卸载](#uninstall) |

Expand Down Expand Up @@ -218,7 +218,7 @@ v0.0.10 及更高版本的安装可以原地升级到更新的发布版本,并

安装程序下载该版本的 `compose.yaml` 并拉取缺失的镜像。替换任何文件之前,它使用安装的 `.env` 和 Compose 覆盖文件运行新版本的配置检查和初始化。初始化会升级数据卷,或拒绝降级。随后安装程序将新的 `compose.yaml` 和 `oac` 放到位并启动服务,重新创建有变化的服务;Core 启动时迁移数据库。[部署](https://github.com/MiniMax-AI/OpenAgentCore/blob/main/deploy/README.md#installation)说明了每个步骤。这次重启对工作的影响与任何一次 [Core 重启](#stop-and-restart)相同;节点和沙箱继续运行并重新连接。

成功时,安装程序打印 Core 密钥以及一行 `Upgraded from <old> to <new>. Settings → Sandbox and scheduling offers this release's Runtime; sandboxes keep their current Runtime until you apply it.`
成功时,安装程序打印控制台地址、用 `oac core-key --show` 代替密钥,以及一行 `Upgraded from <old> to <new>. Settings → Sandbox and scheduling offers this release's Runtime; sandboxes keep their current Runtime until you apply it.`

如果某项检查失败,安装程序会打印 `Upgrade stopped; the running services are unchanged` 及 Docker 的输出,先前版本继续提供服务。修复原因后重新运行命令。初始化升级数据卷后,先前版本便无法再在该数据卷上启动:如果后续步骤失败(例如出现 `startup failed; data retained, rerun the installer`),重新运行同一命令,它会安全地重复每个步骤;也可以[回滚](#roll-back)。

Expand Down Expand Up @@ -279,7 +279,7 @@ docker compose -p <project> down --volumes --remove-orphans
| `This account cannot access …` | 之前用 `sudo` 运行留下了属于 root 的文件。运行消息给出的 `sudo chown` 命令,再以自己的账号重新运行 |
| `Docker Compose 2.26 or newer is required` | 安装或更新 Docker Compose 插件 |
| `Docker could not pull …` | Docker 守护进程无法访问容器注册表。配置其代理或镜像加速器,或使用[离线归档](install-options.md#offline-hosts) |
| `startup failed; data retained, rerun the installer` | 查看上方服务日志,修复原因,再[继续安装](install.md#install);不要删除数据 |
| `startup failed; data retained, rerun the installer` | 消息会列出不健康的服务和查看其日志的 `docker compose logs --tail 50` 命令。修复原因,再[继续安装](install.md#install);不要删除数据。运行 `oac apply` 时,同一消息会提示再次运行 `oac apply` |
| Web 返回 403 `Forbidden` | 浏览器主机名不是 `OAC_PUBLIC_URL`。打开该源地址;反向代理必须传递原始 Host |
| Web 显示 Core 不可用(502) | Core 停止或失败:先 `docker compose ps`,再查看 Core 日志 |
| 创建 Session 返回 400 `model_provider_required` | 缺少模型提供商:为 Harness 设置[默认模型](../configuration.md#default-models),或显式提供;自托管 Session 始终自带提供商 |
Expand Down
16 changes: 15 additions & 1 deletion services/core/cmd/oac/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"
"os/exec"
"strings"
)

// Runner executes docker compose in the installation directory. Tests substitute it.
Expand Down Expand Up @@ -42,6 +43,19 @@ func (r execRunner) command(ctx context.Context, args []string) *exec.Cmd {
}
cmd := exec.CommandContext(ctx, "docker", append(prefix, args...)...)
cmd.Dir = r.dir
cmd.Env = os.Environ()
cmd.Env = dockerEnv()
return cmd
}

// dockerEnv is the environment of every Docker child. The installation's .env is the one home of OAC_* and COMPOSE_* settings, so the caller's shell cannot override them.
func dockerEnv() []string {
var env []string
for _, entry := range os.Environ() {
name, _, _ := strings.Cut(entry, "=")
name = strings.ToUpper(name)
if !strings.HasPrefix(name, "OAC_") && !strings.HasPrefix(name, "COMPOSE_") {
env = append(env, entry)
}
}
return env
}
Loading
Loading