[PR #3974] [CLOSED] [Other] docker image: stage the nested tools/ scripts the Terminal bundle reads (build stops at "installer tool missing: tools/dsv41/tune.py") #4860

Closed
opened 2026-11-07 16:30:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3974
Author: @hurui200320
Created: 10/24/2026
Status: ❌ Closed

Base: main ← Head: docker-ctx-nested-tools


📝 Commits (1)

  • 04b7364 docker: the build context carries the nested tools/ scripts the Terminal bundle reads (INSTALLER_SCRIPTS names dsv41/*, so the terminal stage stopped at "installer tool missing: tools/dsv41/tune.py" since v0.2.4.1); the context test checks every installer tool is staged

📊 Changes

2 files changed (+15 additions, -2 deletions)

View changed files

📝 docker/build.sh (+5 -2)
📝 tests/terminal/test_docker_files.py (+10 -0)

📄 Description

Problem and result

Since v0.2.4.1 (b7958c04), packaging/package_terminal.py bundles the DeepSeek installer scripts: INSTALLER_SCRIPTS (line 128) names the nested modules dsv41/pack_gguf, dsv41/smoke, dsv41/tune, which setup.py runs by path. docker/build.sh fills the Docker build context's terminal-src/ with git ls-files ... ':(glob)tools/*.py' — top-level tools/ modules only. Inside the image, package_terminal.py runs on that context (docker/Dockerfile line 37) and add_installer() → local_imports() stops with:

SystemExit: installer tool missing: tools/dsv41/tune.py

Every image built from the v0.2.4.1 or v0.2.4.2 tree fails in the terminal stage this way, for every flavor (the context is flavor-independent). After this change the nested modules are in the context and the terminal stage completes; the image contents are unchanged otherwise — add_installer() still decides what enters the Terminal bundle, the context only gains source files.

Reproduced on main 7dd5cf18 (identical to v0.2.4.2 in every file this PR touches): sh docker/build.sh --flavor cuda --engine <stub package> --ctx ... --ctx-only, then package_terminal.local_imports() over the staged terminal-src → SystemExit: installer tool missing: tools/dsv41/tune.py. With this change the same call passes and finds dsv41/pack_gguf, dsv41/smoke, dsv41/tune.

None. Focused fix; no existing issue or PR covers it (searched open and closed). Not related to #3644 (root Dockerfile source build at v0.2.2): the root Dockerfile copies the whole tree (COPY . .), so only docker/build.sh's hand-written context list has this gap.

Approach

  • docker/build.sh: widen the pathspec to ':(glob)tools/**/*.py'. Git's :(glob) magic makes ** match zero or more directories, so the top-level modules are still staged exactly as before (all 158 still match) and tools/dsv41/*.py now reaches the context.
  • The no-.git fallback (source ZIP) used the shell glob tools/*.py, top-level only; it now stages find tools -name '*.py' so both branches carry the same set.
  • tests/terminal/test_docker_files.py: test_build_script_exits_zero_after_assembling_a_context already runs build.sh --ctx-only for real; it now reads INSTALLER_TOOLS and INSTALLER_SCRIPTS from package_terminal.py (ast, the way the sibling test reads PAYLOAD) and asserts every tools/<name>.py is in the context. Against the pre-fix script it fails with build.sh did not copy tools/dsv41/pack_gguf.py into the context; with the fix it passes.

Validation

Passed (branch 04b73643, Linux x86_64):

  • sh -n docker/build.sh → ok; shellcheck 0.11.0 reports nothing on the changed lines (the file's pre-existing CDPATH= warnings remain).
  • python -m pytest tests/terminal/test_docker_files.py -q → 17 passed (host, Python 3.13).
  • Regression check against the pre-fix script (same test file, docker/build.sh stashed to HEAD): test_build_script_exits_zero_after_assembling_a_context fails with build.sh did not copy tools/dsv41/pack_gguf.py into the context; restored → 17 passed.
  • Real context assembly: docker/build.sh --flavor cuda --engine <stub> --ctx ... --ctx-only; tools/dsv41/{pack_gguf,smoke,tune}.py present; package_terminal.local_imports() over the staged terminal-src passes.
  • No-.git tree: same sources staged without .git, its docker/build.sh --ctx-only stages tools/dsv41/tune.py; local_imports() passes.

Failed: none from this change.

Not run:

  • A full docker build on this machine. The failing stage is the terminal stage, and the checks above are the exact inputs it reads. External evidence, not validation of this commit: hurui200320/llm-ops CI run 40100350366 (2026-10-24, success, commit 2e44931) applied the same one-line pathspec change (via sed) to a v0.2.4.2 checkout — docker/, Dockerfile and package_terminal.py are identical to this branch — and built and smoke-tested ghcr.io/hurui200320/llm-ops-strata:0.2.4.2-rocm-gfx110x (Terminal version, component inventory, strata-dsv41).
  • GPU execution: the failing path is build-time and hardware-independent; no inference was run.

Limits

  • The already-cut tags v0.2.4.1 and v0.2.4.2 still carry the bug. Images for those versions need docker-images.yml's source_ref input pointed at the fixed commit (or a backport to the tag); later tags get the fix.
  • The find fallback assumes no whitespace in tools/ filenames, like the script's hand-written path list; git ls-files -- tools | grep -c ' ' → 0.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3974 **Author:** [@hurui200320](https://github.com/hurui200320) **Created:** 10/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `docker-ctx-nested-tools` --- ### 📝 Commits (1) - [`04b7364`](https://github.com/Niko1221/Strata/commit/04b7364300e35cdadebf0fa52de2f7ed270016fe) docker: the build context carries the nested tools/ scripts the Terminal bundle reads (INSTALLER_SCRIPTS names dsv41/*, so the terminal stage stopped at "installer tool missing: tools/dsv41/tune.py" since v0.2.4.1); the context test checks every installer tool is staged ### 📊 Changes **2 files changed** (+15 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docker/build.sh` (+5 -2) 📝 `tests/terminal/test_docker_files.py` (+10 -0) </details> ### 📄 Description ## Problem and result Since v0.2.4.1 (`b7958c04`), `packaging/package_terminal.py` bundles the DeepSeek installer scripts: `INSTALLER_SCRIPTS` (line 128) names the nested modules `dsv41/pack_gguf`, `dsv41/smoke`, `dsv41/tune`, which `setup.py` runs by path. `docker/build.sh` fills the Docker build context's `terminal-src/` with `git ls-files ... ':(glob)tools/*.py'` — top-level `tools/` modules only. Inside the image, `package_terminal.py` runs on that context (`docker/Dockerfile` line 37) and `add_installer()` → `local_imports()` stops with: SystemExit: installer tool missing: tools/dsv41/tune.py Every image built from the v0.2.4.1 or v0.2.4.2 tree fails in the terminal stage this way, for every flavor (the context is flavor-independent). After this change the nested modules are in the context and the terminal stage completes; the image contents are unchanged otherwise — `add_installer()` still decides what enters the Terminal bundle, the context only gains source files. Reproduced on `main` `7dd5cf18` (identical to v0.2.4.2 in every file this PR touches): `sh docker/build.sh --flavor cuda --engine <stub package> --ctx ... --ctx-only`, then `package_terminal.local_imports()` over the staged `terminal-src` → `SystemExit: installer tool missing: tools/dsv41/tune.py`. With this change the same call passes and finds `dsv41/pack_gguf`, `dsv41/smoke`, `dsv41/tune`. ## Related discussion None. Focused fix; no existing issue or PR covers it (searched open and closed). Not related to #3644 (root `Dockerfile` source build at v0.2.2): the root Dockerfile copies the whole tree (`COPY . .`), so only `docker/build.sh`'s hand-written context list has this gap. ## Approach - `docker/build.sh`: widen the pathspec to `':(glob)tools/**/*.py'`. Git's `:(glob)` magic makes `**` match zero or more directories, so the top-level modules are still staged exactly as before (all 158 still match) and `tools/dsv41/*.py` now reaches the context. - The no-`.git` fallback (source ZIP) used the shell glob `tools/*.py`, top-level only; it now stages `find tools -name '*.py'` so both branches carry the same set. - `tests/terminal/test_docker_files.py`: `test_build_script_exits_zero_after_assembling_a_context` already runs `build.sh --ctx-only` for real; it now reads `INSTALLER_TOOLS` and `INSTALLER_SCRIPTS` from `package_terminal.py` (ast, the way the sibling test reads `PAYLOAD`) and asserts every `tools/<name>.py` is in the context. Against the pre-fix script it fails with `build.sh did not copy tools/dsv41/pack_gguf.py into the context`; with the fix it passes. ## Validation **Passed** (branch `04b73643`, Linux x86_64): - `sh -n docker/build.sh` → ok; `shellcheck 0.11.0` reports nothing on the changed lines (the file's pre-existing `CDPATH=` warnings remain). - `python -m pytest tests/terminal/test_docker_files.py -q` → 17 passed (host, Python 3.13). - Regression check against the pre-fix script (same test file, `docker/build.sh` stashed to HEAD): `test_build_script_exits_zero_after_assembling_a_context` fails with `build.sh did not copy tools/dsv41/pack_gguf.py into the context`; restored → 17 passed. - Real context assembly: `docker/build.sh --flavor cuda --engine <stub> --ctx ... --ctx-only`; `tools/dsv41/{pack_gguf,smoke,tune}.py` present; `package_terminal.local_imports()` over the staged `terminal-src` passes. - No-`.git` tree: same sources staged without `.git`, its `docker/build.sh --ctx-only` stages `tools/dsv41/tune.py`; `local_imports()` passes. **Failed:** none from this change. **Not run:** - A full `docker build` on this machine. The failing stage is the terminal stage, and the checks above are the exact inputs it reads. *External evidence, not validation of this commit:* hurui200320/llm-ops CI run [40100350366](https://github.com/hurui200320/llm-ops/actions/runs/40100350366) (2026-10-24, success, commit `2e44931`) applied the same one-line pathspec change (via sed) to a v0.2.4.2 checkout — `docker/`, `Dockerfile` and `package_terminal.py` are identical to this branch — and built and smoke-tested `ghcr.io/hurui200320/llm-ops-strata:0.2.4.2-rocm-gfx110x` (Terminal version, component inventory, `strata-dsv41`). - GPU execution: the failing path is build-time and hardware-independent; no inference was run. ## Limits - The already-cut tags v0.2.4.1 and v0.2.4.2 still carry the bug. Images for those versions need `docker-images.yml`'s `source_ref` input pointed at the fixed commit (or a backport to the tag); later tags get the fix. - The `find` fallback assumes no whitespace in `tools/` filenames, like the script's hand-written path list; `git ls-files -- tools | grep -c ' '` → 0. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:30:55 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4860
No description provided.