diff --git a/.env.example b/.env.example index a03f66b3d..a6f443aa6 100644 --- a/.env.example +++ b/.env.example @@ -8,6 +8,8 @@ AGENTFLOW_HTTP_PORT=8090 AGENTFLOW_MYSQL_DSN=loopforge:REPLACE_ME@tcp(127.0.0.1:33315)/loopforge AGENTFLOW_SESSION_SECRET=REPLACE_WITH_64_RANDOM_HEX_CHARACTERS AGENTFLOW_AUTH_REQUIRED=true +# Compose: maximum concurrent sandbox commands in the platform worker (positive integer). +AGENTFLOW_WORKER_CONCURRENCY=8 LOOPFORGE_DB_PASSWORD=REPLACE_ME LOOPFORGE_DB_ROOT_PASSWORD=REPLACE_ME LOOPFORGE_MYSQL_PORT=33315 diff --git a/compose.yaml b/compose.yaml index 25e5535c9..9cd4eaf6a 100644 --- a/compose.yaml +++ b/compose.yaml @@ -48,7 +48,7 @@ services: AGENTFLOW_GATE_MCP_BINARY: /app/bin/agentflow-gate-mcp-{os}-{arch} # Claude Code is not bundled; it is installed from npm here on first use. AGENTFLOW_RUNTIME_CLI_DIR: ${LOOPFORGE_DATA_DIR}/cli - command: ["-workspaces", "${LOOPFORGE_DATA_DIR}/workspaces"] + command: ["-workspaces", "${LOOPFORGE_DATA_DIR}/workspaces", "-worker-concurrency", "${AGENTFLOW_WORKER_CONCURRENCY:-8}"] volumes: - platform-data:/data # Docker sandboxes bind workspace paths on the host, so the data diff --git a/docs/deployment.md b/docs/deployment.md index 0d1c79995..881df6cde 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -40,6 +40,8 @@ Run it as the installation owner, including an ordinary Linux user. If that user `compose.yaml` is the published-image stack and never builds: `./start.sh`, `scripts/install.sh` and a plain `docker compose --profile platform up` all pull the GHCR release pinned there (currently `ghcr.io/tencent/loopforge:0.4.0`). The pin matches the checkout's migrations and seeds, so check out a release tag when you install. Set `LOOPFORGE_IMAGE` (for example to an `@sha256:` digest) only to override it; a value saved in `.env` takes precedence over later pin changes. +Set `AGENTFLOW_WORKER_CONCURRENCY` to a positive integer in `.env` to tune the Compose platform worker's concurrent sandbox command limit (default `8`). Recreate the platform container with `docker compose --profile platform up -d platform` after changing it. These slots are shared across projects on that worker; project run admission and each connected execution machine keep their own limits. Native installations can pass `-worker-concurrency N` to the platform binary. + To upgrade, update the checkout first, then refresh the containers: ```bash