[PR #3644] [CLOSED] [Other] root Dockerfile: pass the source commit to the terminal stage (source build fails at v0.2.2) #4731

Closed
opened 2026-11-07 15:38:40 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3644
Author: @robertoetcheverryr
Created: 10/21/2026
Status: ❌ Closed

Base: main ← Head: FixContainer


📝 Commits (2)

📊 Changes

2 files changed (+10 additions, -7 deletions)

View changed files

📝 Dockerfile (+2 -0)
📝 docs/DOCKER.md (+8 -7)

📄 Description

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:

the commit of these sources is unknown (no .git here, no --commit, no STRATA_COMMIT): the archive would carry no COMMIT file, and every `strata bench run` on it would be nonconforming

.dockerignore excludes .git, and the root Dockerfile's terminal stage takes no commit argument, so package_terminal.py has nothing to read. After this change the documented commands pass the commit, the build goes through, and the archive carries its COMMIT file.

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

  • Dockerfile: the same handling docker/Dockerfile already uses, ARG STRATA_COMMIT → ENV STRATA_BUILD_COMMIT, which build_commit() already reads. Two lines in the terminal stage.
  • docs/DOCKER.md: both "From source" commands (CUDA 13 and cuda12) now pass --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, args CUDA_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 stage strata --version passed. COMMIT file carried into the image:

    $ docker run --rm --entrypoint cat strata:local /opt/strata/terminal/COMMIT
    011c9e600a93bbc9fd451c563501b5831c32bbca
    

Failed:

  • Same build without this change: fails at [terminal 4/5] with the message above.

Not run:

  • cuda12 variant, HIP, SYCL: not built. The change is in the terminal stage only, which doesn't depend on the backend.
  • docker/Dockerfile / docker/build.sh: not touched.
  • The docs commands exactly as written (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 .git in 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.


🔄 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/3644 **Author:** [@robertoetcheverryr](https://github.com/robertoetcheverryr) **Created:** 10/21/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `FixContainer` --- ### 📝 Commits (2) - [`64f5696`](https://github.com/Niko1221/Strata/commit/64f56961c5250426ad6e490d0817f4a0c98c17f7) Update Dockerfile - [`fb957cb`](https://github.com/Niko1221/Strata/commit/fb957cb212f887150859dfef7c9129a0bb39a709) Update DOCKER.md ### 📊 Changes **2 files changed** (+10 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+2 -0) 📝 `docs/DOCKER.md` (+8 -7) </details> ### 📄 Description ## 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: the commit of these sources is unknown (no .git here, no --commit, no STRATA_COMMIT): the archive would carry no COMMIT file, and every `strata bench run` on it would be nonconforming `.dockerignore` excludes `.git`, and the root Dockerfile's terminal stage takes no commit argument, so `package_terminal.py` has 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 - Dockerfile: the same handling `docker/Dockerfile` already uses, `ARG STRATA_COMMIT` → `ENV STRATA_BUILD_COMMIT`, which `build_commit()` already reads. Two lines in the terminal stage. - docs/DOCKER.md: both "From source" commands (CUDA 13 and cuda12) now pass `--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, args `CUDA_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 stage `strata --version` passed. COMMIT file carried into the image: $ docker run --rm --entrypoint cat strata:local /opt/strata/terminal/COMMIT 011c9e600a93bbc9fd451c563501b5831c32bbca **Failed:** - Same build without this change: fails at `[terminal 4/5]` with the message above. **Not run:** - cuda12 variant, HIP, SYCL: not built. The change is in the terminal stage only, which doesn't depend on the backend. - `docker/Dockerfile` / `docker/build.sh`: not touched. - The docs commands exactly as written (`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 `.git` in 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:38:40 +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#4731
No description provided.