perf: speed up live Docker staging · openclaw/openclaw@ed7ea75
steipete
·
2026-04-25
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -55,7 +55,9 @@ openclaw_live_stage_source_tree() {
|
55 | 55 | openclaw_live_link_runtime_tree() { |
56 | 56 | local dest_dir="${1:?destination directory required}" |
57 | 57 | |
58 | | - ln -s /app/node_modules "$dest_dir/node_modules" |
| 58 | +if [ ! -e "$dest_dir/node_modules" ]; then |
| 59 | + ln -s /app/node_modules "$dest_dir/node_modules" |
| 60 | +fi |
59 | 61 | ln -s /app/dist "$dest_dir/dist" |
60 | 62 | if [ -d /app/dist-runtime/extensions ]; then |
61 | 63 | export OPENCLAW_BUNDLED_PLUGINS_DIR=/app/dist-runtime/extensions |
@@ -64,6 +66,16 @@ openclaw_live_link_runtime_tree() {
|
64 | 66 | fi |
65 | 67 | } |
66 | 68 | |
| 69 | +openclaw_live_stage_node_modules() { |
| 70 | +local dest_dir="${1:?destination directory required}" |
| 71 | +local target_dir="$dest_dir/node_modules" |
| 72 | + |
| 73 | + mkdir -p "$target_dir" |
| 74 | + find /app/node_modules -mindepth 1 -maxdepth 1 -exec ln -s {} "$target_dir" \; |
| 75 | + rm -rf "$target_dir/.vite-temp" |
| 76 | + mkdir -p "$target_dir/.vite-temp" |
| 77 | +} |
| 78 | + |
67 | 79 | openclaw_live_stage_state_dir() { |
68 | 80 | local dest_dir="${1:?destination directory required}" |
69 | 81 | local source_dir="${HOME}/.openclaw" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -163,13 +163,7 @@ esac
|
163 | 163 | tmp_dir="$(mktemp -d)" |
164 | 164 | source /src/scripts/lib/live-docker-stage.sh |
165 | 165 | openclaw_live_stage_source_tree "$tmp_dir" |
166 | | -# Use a writable node_modules overlay in the temp repo. Vite writes bundled |
167 | | -# config artifacts under the nearest node_modules/.vite-temp path, and the |
168 | | -# build-stage /app/node_modules tree is root-owned in this Docker lane. |
169 | | -mkdir -p "$tmp_dir/node_modules" |
170 | | -cp -aRs /app/node_modules/. "$tmp_dir/node_modules" |
171 | | -rm -rf "$tmp_dir/node_modules/.vite-temp" |
172 | | -mkdir -p "$tmp_dir/node_modules/.vite-temp" |
| 166 | +openclaw_live_stage_node_modules "$tmp_dir" |
173 | 167 | openclaw_live_link_runtime_tree "$tmp_dir" |
174 | 168 | openclaw_live_stage_state_dir "$tmp_dir/.openclaw-state" |
175 | 169 | openclaw_live_prepare_staged_config |
@@ -285,6 +279,7 @@ for ACP_AGENT in "${ACP_AGENTS[@]}"; do
|
285 | 279 | -e OPENCLAW_DOCKER_AUTH_PRESTAGED="$DOCKER_AUTH_PRESTAGED" \ |
286 | 280 | -e OPENCLAW_DOCKER_AUTH_DIRS_RESOLVED="$AUTH_DIRS_CSV" \ |
287 | 281 | -e OPENCLAW_DOCKER_AUTH_FILES_RESOLVED="$AUTH_FILES_CSV" \ |
| 282 | + -e OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE="${OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE:-copy}" \ |
288 | 283 | -e OPENCLAW_LIVE_TEST=1 \ |
289 | 284 | -e OPENCLAW_LIVE_ACP_BIND=1 \ |
290 | 285 | -e OPENCLAW_LIVE_ACP_BIND_AGENT="$ACP_AGENT" \ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -371,10 +371,7 @@ openclaw_live_stage_source_tree "$tmp_dir"
|
371 | 371 | # Use a writable node_modules overlay in the temp repo. Vite writes bundled |
372 | 372 | # config artifacts under the nearest node_modules/.vite-temp path, and the |
373 | 373 | # build-stage /app/node_modules tree is root-owned in this Docker lane. |
374 | | -mkdir -p "$tmp_dir/node_modules" |
375 | | -cp -aRs /app/node_modules/. "$tmp_dir/node_modules" |
376 | | -rm -rf "$tmp_dir/node_modules/.vite-temp" |
377 | | -mkdir -p "$tmp_dir/node_modules/.vite-temp" |
| 374 | +openclaw_live_stage_node_modules "$tmp_dir" |
378 | 375 | openclaw_live_link_runtime_tree "$tmp_dir" |
379 | 376 | openclaw_live_stage_state_dir "$tmp_dir/.openclaw-state" |
380 | 377 | openclaw_live_prepare_staged_config |
@@ -444,6 +441,7 @@ DOCKER_RUN_ARGS=(docker run --rm -t \
|
444 | 441 | -e OPENCLAW_DOCKER_AUTH_PRESTAGED="$DOCKER_AUTH_PRESTAGED" \ |
445 | 442 | -e OPENCLAW_DOCKER_AUTH_DIRS_RESOLVED="$AUTH_DIRS_CSV" \ |
446 | 443 | -e OPENCLAW_DOCKER_AUTH_FILES_RESOLVED="$AUTH_FILES_CSV" \ |
| 444 | + -e OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE="${OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE:-copy}" \ |
447 | 445 | -e OPENCLAW_LIVE_CLI_BACKEND_USE_CI_SAFE_CODEX_CONFIG="$CLI_USE_CI_SAFE_CODEX_CONFIG" \ |
448 | 446 | -e OPENCLAW_DOCKER_CLI_BACKEND_PROVIDER="$CLI_PROVIDER" \ |
449 | 447 | -e OPENCLAW_DOCKER_CLI_BACKEND_COMMAND_DEFAULT="$CLI_DEFAULT_COMMAND" \ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -169,10 +169,7 @@ fi
|
169 | 169 | tmp_dir="$(mktemp -d)" |
170 | 170 | source /src/scripts/lib/live-docker-stage.sh |
171 | 171 | openclaw_live_stage_source_tree "$tmp_dir" |
172 | | -mkdir -p "$tmp_dir/node_modules" |
173 | | -cp -aRs /app/node_modules/. "$tmp_dir/node_modules" |
174 | | -rm -rf "$tmp_dir/node_modules/.vite-temp" |
175 | | -mkdir -p "$tmp_dir/node_modules/.vite-temp" |
| 172 | +openclaw_live_stage_node_modules "$tmp_dir" |
176 | 173 | openclaw_live_link_runtime_tree "$tmp_dir" |
177 | 174 | openclaw_live_stage_state_dir "$tmp_dir/.openclaw-state" |
178 | 175 | openclaw_live_prepare_staged_config |
@@ -220,6 +217,7 @@ DOCKER_RUN_ARGS=(docker run --rm -t \
|
220 | 217 | -e OPENCLAW_DOCKER_AUTH_PRESTAGED="$DOCKER_AUTH_PRESTAGED" \ |
221 | 218 | -e OPENCLAW_CODEX_APP_SERVER_BIN="${OPENCLAW_CODEX_APP_SERVER_BIN:-codex}" \ |
222 | 219 | -e OPENCLAW_DOCKER_AUTH_FILES_RESOLVED="$AUTH_FILES_CSV" \ |
| 220 | + -e OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE="${OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE:-copy}" \ |
223 | 221 | -e OPENCLAW_LIVE_CODEX_HARNESS_AUTH="$CODEX_HARNESS_AUTH_MODE" \ |
224 | 222 | -e OPENCLAW_LIVE_CODEX_HARNESS=1 \ |
225 | 223 | -e OPENCLAW_LIVE_CODEX_HARNESS_DEBUG="${OPENCLAW_LIVE_CODEX_HARNESS_DEBUG:-}" \ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -139,10 +139,7 @@ fi
|
139 | 139 | tmp_dir="$(mktemp -d)" |
140 | 140 | source /src/scripts/lib/live-docker-stage.sh |
141 | 141 | openclaw_live_stage_source_tree "$tmp_dir" |
142 | | -mkdir -p "$tmp_dir/node_modules" |
143 | | -cp -aRs /app/node_modules/. "$tmp_dir/node_modules" |
144 | | -rm -rf "$tmp_dir/node_modules/.vite-temp" |
145 | | -mkdir -p "$tmp_dir/node_modules/.vite-temp" |
| 142 | +openclaw_live_stage_node_modules "$tmp_dir" |
146 | 143 | openclaw_live_link_runtime_tree "$tmp_dir" |
147 | 144 | openclaw_live_stage_state_dir "$tmp_dir/.openclaw-state" |
148 | 145 | openclaw_live_prepare_staged_config |
@@ -167,6 +164,7 @@ DOCKER_RUN_ARGS=(docker run --rm -t \
|
167 | 164 | -e OPENCLAW_DOCKER_AUTH_PRESTAGED="$DOCKER_AUTH_PRESTAGED" \ |
168 | 165 | -e OPENCLAW_DOCKER_AUTH_DIRS_RESOLVED="$AUTH_DIRS_CSV" \ |
169 | 166 | -e OPENCLAW_DOCKER_AUTH_FILES_RESOLVED="$AUTH_FILES_CSV" \ |
| 167 | + -e OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE="${OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE:-copy}" \ |
170 | 168 | -e OPENCLAW_LIVE_TEST=1 \ |
171 | 169 | -e OPENCLAW_LIVE_GATEWAY_MODELS="${OPENCLAW_LIVE_GATEWAY_MODELS:-modern}" \ |
172 | 170 | -e OPENCLAW_LIVE_GATEWAY_PROVIDERS="${OPENCLAW_LIVE_GATEWAY_PROVIDERS:-}" \ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -169,10 +169,7 @@ fi
|
169 | 169 | tmp_dir="$(mktemp -d)" |
170 | 170 | source /src/scripts/lib/live-docker-stage.sh |
171 | 171 | openclaw_live_stage_source_tree "$tmp_dir" |
172 | | -mkdir -p "$tmp_dir/node_modules" |
173 | | -cp -aRs /app/node_modules/. "$tmp_dir/node_modules" |
174 | | -rm -rf "$tmp_dir/node_modules/.vite-temp" |
175 | | -mkdir -p "$tmp_dir/node_modules/.vite-temp" |
| 172 | +openclaw_live_stage_node_modules "$tmp_dir" |
176 | 173 | openclaw_live_link_runtime_tree "$tmp_dir" |
177 | 174 | openclaw_live_stage_state_dir "$tmp_dir/.openclaw-state" |
178 | 175 | openclaw_live_prepare_staged_config |
@@ -198,6 +195,7 @@ DOCKER_RUN_ARGS=(docker run --rm -t \
|
198 | 195 | -e OPENCLAW_DOCKER_AUTH_PRESTAGED="$DOCKER_AUTH_PRESTAGED" \ |
199 | 196 | -e OPENCLAW_DOCKER_AUTH_DIRS_RESOLVED="$AUTH_DIRS_CSV" \ |
200 | 197 | -e OPENCLAW_DOCKER_AUTH_FILES_RESOLVED="$AUTH_FILES_CSV" \ |
| 198 | + -e OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE="${OPENCLAW_LIVE_DOCKER_SOURCE_STAGE_MODE:-copy}" \ |
201 | 199 | -e OPENCLAW_LIVE_TEST=1 \ |
202 | 200 | -e OPENCLAW_LIVE_MODELS="${OPENCLAW_LIVE_MODELS:-modern}" \ |
203 | 201 | -e OPENCLAW_LIVE_PROVIDERS="${OPENCLAW_LIVE_PROVIDERS:-}" \ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。