fix: refresh run source during distribution builds

This commit is contained in:
npc0-hue
2026-08-21 23:09:28 +08:00
parent 2381b69d24
commit 0a605495af
12 changed files with 317 additions and 119 deletions
+6 -4
View File
@@ -7,7 +7,7 @@ The local debug workspace runs the real platform API, run worker, platform_web c
- Platform listens on `http://127.0.0.1:18080` by default.
- platform_web listens on `http://127.0.0.1:5173` by default and proxies `/api/v1` plus `/healthz` to platform.
- Run editable source is loaded from `RUN_SOURCE_DIR` / legacy `RUN_REPO_DIR`, defaulting to the ignored nested `./run` checkout.
- Run source is snapshotted into `.local-debug/run/build-buckets/source/current`; the platform mounts that snapshot read-only into the dedicated `browser-platform-distribution-builder:1.0.0` image, and the local bootstrap worker is built into `.local-debug/run/build-buckets/bootstrap/bin/run` before registering as `run-local-debug`.
- Run source is kept as an independent checkout. The platform-owned builder refreshes the configured repository revision for every Run build, exports a clean per-job source workspace, injects package configuration, and compiles before publishing the artifact. The local bootstrap worker is built from the checkout before registering as `run-local-debug`.
- Disposable state lives under `.local-debug/`.
- Logs live under `.local-debug/logs/`.
- PIDs live under `.local-debug/pids/`.
@@ -30,7 +30,6 @@ Use the managed local debug scripts for browser-facing verification. Do not star
## Start
```bash
git clone git@git.npc0.com:admin343/run.git run # once, if the ignored local checkout is missing
scripts/dev-start.sh
```
@@ -59,7 +58,9 @@ Key platform variables:
- `PLATFORM_LOG_DIR=.local-debug/platform/logs`
- `PLATFORM_BUILDER_DOCKER_BINARY=docker`
- `PLATFORM_BUILDER_IMAGE=browser-platform-distribution-builder:1.0.0`
- `PLATFORM_BUILDER_SOURCE_DIR=.local-debug/run/build-buckets/source/current`
- `PLATFORM_BUILDER_SOURCE_DIR=./run`
- `PLATFORM_BUILDER_SOURCE_REPOSITORY=git@git.npc0.com:admin343/run.git`
- `PLATFORM_BUILDER_SOURCE_REVISION=main`
- `PLATFORM_BUILDER_WORKSPACE_DIR=.local-debug/platform/distribution-builds`
- `PLATFORM_BUILDER_CACHE_DIR=.local-debug/platform/distribution-build-cache`
- `PLATFORM_BUILDER_TIMEOUT_SECONDS=1800`
@@ -70,7 +71,8 @@ Key run variables:
- `RUN_SOURCE_DIR=./run`
- `RUN_REPO_DIR=./run` as a legacy alias for `RUN_SOURCE_DIR`
- `RUN_BUILD_BUCKET_ROOT=.local-debug/run/build-buckets`
- `RUN_BUILD_SOURCE_ROOT=.local-debug/run/build-buckets/source/current`
- `RUN_SOURCE_REPOSITORY=git@git.npc0.com:admin343/run.git`
- `RUN_SOURCE_REVISION=main`
- `RUN_BOOTSTRAP_BIN=.local-debug/run/build-buckets/bootstrap/bin/run`
- `RUN_MODE=worker`
- `RUN_PLATFORM_URL=http://127.0.0.1:18080`