Repository navigation
[Other] root Dockerfile: pass the source commit to the terminal stage (source build fails at v0.2.2) - #3644
[Other] root Dockerfile: pass the source commit to the terminal stage (source build fails at v0.2.2)#3644robertoetcheverryr wants to merge 2 commits into
Conversation
|
Did you run on a clean pull from the repo? My build script for reference. |
Since I built it with a docker compose instead of manually, something might have been different, I will check in a completely clean environment. |
|
I checked both points on a clean worktree of this PR's head (fb957cb). Environment: Ubuntu 26.04, plain 1. The documented command works. This covers the "docs commands as written" item, for the terminal stage only: It passed, and 2. @OcBuddy's error is reproduced exactly by a dangling symlink in the checkout:
|
|
Second confirmation here. Built the image correctly and no errors in the log NOTE: git reset does not remove untracked/ignored files and the directory that failed is not part of the tree (it is downloaded later) so it explains why it failed for OcBuddy |
Running these commands from your repo it build. |
|
Confirming this fix on Linux with v0.2.3.1 (commit 7ddc17a). Without it, Build: The image runs on one or both cards with pictured on, using Qwen3.8-Flash-Next from 1-bit up to Q8_0 and on RTX A5000 (driver 595.104.02). |
…stage (#3644) .git is not in the build context, so package_terminal.py had no commit to put in the archive and the documented source build stopped. Ported from PR #3644 by robertoetcheverryr: ARG STRATA_COMMIT / ENV STRATA_BUILD_COMMIT as in docker/Dockerfile, and the two 'From source' commands in docs/DOCKER.md pass --build-arg STRATA_COMMIT=$(git rev-parse HEAD). Added: .dockerignore leaves out the folders docker/entrypoint.sh creates in a mounted data/ (install, state, home, Strata-data). A dangling data/install/third_party/llama.cpp link in a clone that had been mounted made the Terminal stage fail with a copytree error (seen in the review thread of #3644). Not built with docker here (no docker on this PC).
…rce-build commands pass it (#3644)
|
Thanks. Confirmed: the root Dockerfile passes no commit to the Terminal stage, so package_terminal stops. Ported with your docs change, plus a .dockerignore line for the folders the entrypoint creates in data/ (the failure OcBuddy hit). Fixed in 0.2.7. Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7 |
Problem and result
At v0.2.2 (011c9e6) the documented source build (
docker build -t strata:src ., "From source" in docs/DOCKER.md) fails in the terminal stage:.dockerignoreexcludes.git, and the root Dockerfile's terminal stage takes no commit argument, sopackage_terminal.pyhas nothing to read. After this change the documented commands pass the commit, the build goes through, and the archive carries its COMMIT file.Related discussion
Same failure reported in a comment on #3503 (closed) and worked around locally in #3624 ("reported separately"). Build and docs fix only, no behavior or default change.
Approach
docker/Dockerfilealready uses,ARG STRATA_COMMIT→ENV STRATA_BUILD_COMMIT, whichbuild_commit()already reads. Two lines in the terminal stage.--build-arg STRATA_COMMIT=$(git rev-parse HEAD), with one sentence on why.Without the arg the value is empty,
build_commit()rejects it and the build stops with the same message as before.Validation
Passed:
sudo docker compose build --build-arg STRATA_COMMIT=$(sudo git -C app rev-parse HEAD)(compose build context = repo clone, argsCUDA_ARCHITECTURES: "86"), v0.2.2 011c9e6 plus this change, Debian 13, Docker 29.9.2 (a82e528), RTX 3090: image built in 1056.1 s, terminal stagestrata --versionpassed. COMMIT file carried into the image:Failed:
[terminal 4/5]with the message above.Not run:
docker/Dockerfile/docker/build.sh: not touched.docker build -t strata:src ...): built through docker compose with the same build arg instead.Limits
A bare
docker build .without the arg still stops, as the packager intends (it refuses an archive with no commit). Making it work with no arg would mean either keeping.gitin the build context or letting the packager warn instead of fail. I left both out because they change existing behavior; happy to do either if preferred.