docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Explicit remote-runner opt-in: invokes real models using the dedicated CLI login.
|
||||
# 此脚本会编译测试并实际调用模型;只用于明确授权的专用远程 runner,普通检查不自动运行。
|
||||
set -euo pipefail
|
||||
umask 077
|
||||
binary=$(realpath "$1")
|
||||
@@ -9,6 +10,7 @@ login=${FOUNDRY_REAL_CODEX_HOME:-/opt/endoleap-infra/foundry/codex/home}
|
||||
test -x "$binary"
|
||||
test -s "$login/auth.json"
|
||||
test -s "$login/models_cache.json"
|
||||
# 随机命名 worker/数据库和临时 socket 目录,退出时一并清理,不复用生产队列。
|
||||
suffix=$(openssl rand -hex 8)
|
||||
database=foundry-real-db-$suffix
|
||||
worker=foundry-real-worker-$suffix
|
||||
@@ -24,6 +26,7 @@ docker exec "$database" psql -X -U postgres -v ON_ERROR_STOP=1 -c 'CREATE ROLE f
|
||||
python3 deploy/migrate.py --container "$database" --database postgres --role foundry_fixture
|
||||
# Only the CLI container sees the login. Core/tests receive the private socket,
|
||||
# never the login, runtime configuration or Docker socket.
|
||||
# 只有 CLI 容器只读读取专用登录和模型缓存,测试容器仅挂 socket,不能访问登录或 Docker socket。
|
||||
docker run -d --name "$worker" --init --network bridge --user 1000:1000 \
|
||||
--cap-drop ALL --security-opt no-new-privileges --read-only --pids-limit 128 --memory 1g \
|
||||
--tmpfs /tmp:rw,nosuid,nodev,size=128m --tmpfs /work:ro,nosuid,nodev \
|
||||
@@ -38,6 +41,7 @@ docker run -d --name "$worker" --init --network bridge --user 1000:1000 \
|
||||
node:24-bookworm-slim /opt/foundry codex-worker >/dev/null
|
||||
for attempt in {1..30}; do if [[ -S "$scratch/run/worker.sock" ]]; then break; fi; sleep 1; done
|
||||
test -S "$scratch/run/worker.sock"
|
||||
# 先等私有 socket 出现,再在 runner 编译并仅运行真实 worker 专项用例;与普通单元测试开关分离。
|
||||
CGO_ENABLED=0 go test -mod=readonly -c -o bin/platform-real-tests ./internal/platform
|
||||
docker run --rm --network "container:$database" --user 1000:1000 \
|
||||
--read-only --cap-drop ALL --security-opt no-new-privileges \
|
||||
|
||||
Reference in New Issue
Block a user