mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4312] [TUI] launcher: start the bundled runtime when access(X_OK) is denied (Docker's default seccomp profile) #4997
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4997
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4312
Author: @XiaoBinGan
Created: 10/27/2026
Status: 🔄 Open
Base:
main← Head:fix/launcher-exec-probe📝 Commits (2)
7207f96Fix #4309: the Terminal launcher starts the bundled Python when access(X_OK) is denied5a27a0cFix #4309: the container entrypoint resolves its Python the same way📊 Changes
2 files changed (+31 additions, -4 deletions)
View changed files
📝
bin/strata(+17 -3)📝
docker/entrypoint.sh(+14 -1)📄 Description
Problem and result
In the official image on a host whose Docker daemon uses an older default seccomp profile
(19.03.15 here), a container start stops with "The engine in this image does not match this
computer's graphics card, or the card is not visible to the container", and the launcher's text
under it says "no usable Python found". The card is fine and the runtime is there: the same image and
the same command work with
--security-opt seccomp=unconfined. After this change both places thatdecide "is this Python usable?" start the candidate when the permission test says no, so the container
needs no seccomp override to start.
Related discussion
#4309 — the report with the four-way A/B evidence, and the container-start log.
Cause
test -xis not a reliable yes/no here. That daemon's seccomp profile deniesaccess(X_OK)/faccessatforX_OK, so the test answers false for a file the shell can still execute: in the samecontainer
[ -e .../python3 ]is true,readlink -fresolves it, and running it printsPython 3.12.15. Two places depend on that test:bin/strata(pick_python) skipped the bundled runtime, found nopython3on PATH for the samereason, and printed "no usable Python found".
docker/entrypoint.sh(PYBIN=...) is the one a container start hits first: it setPYBIN=python3,which is not installed in the image, and the start reported the card mismatch above.
The second one is why this is a user-facing misdiagnosis rather than a bad message: the troubleshooting
section of
docs/DOCKER.mdbegins with exactly that card sentence.Approach
One helper per file, same shape, keeping the fast path:
Where
test -xworks — every normal system, and this host withseccomp=unconfined— the first lineanswers, so the chosen interpreter and the startup cost are unchanged. The refusal for an explicitly
useless
STRATA_PYTHONkeeps its message.Validation
Passed: the launcher, in the environment where the bug was measured (Docker 19.03.15, default seccomp,
image
ghcr.nju.edu.cn/niko1221/strata:0.2.2-cuda13, engine 0.1.47; the file under test copied over/opt/strata/terminal/bin/strata):strata: no usable Python found.(the bug)strata 0.2.2 (build 0.1.47; python 3.12.15 at /opt/strata/terminal/python/bin/python3)unconfinedSTRATA_PYTHON=/nope/python3unconfinedstrata: STRATA_PYTHON=/nope/python3 is not executable(unchanged)Passed: the entrypoint's
PYBINresolution, both conditions, replayed in the same image:PYBIN=python3, thenpython3: not foundPYBIN=/opt/strata/terminal/python/bin/python3,Python 3.12.15unconfinedPYBIN,Python 3.12.15Passed:
sh -n docker/entrypoint.shandsh -n bin/strata.Passed: the diagnostic that separates the two hypotheses, in the same container:
test -xfalse,test -etrue,readlink -fresolves, directexecprintsPython 3.12.15,command -v python3notfound.
Failed: none.
Not run: a full container start with the patched entrypoint (model download and load). The image
downloads tens of GB on first start, so the entrypoint change was validated at the
PYBINresolutionand syntax level only, plus the launcher A/B above which exercises the same helper. If you want that
proven end to end, it needs a host whose daemon denies
access(X_OK)and a prepared data volume; sayso and I will run it here rather than claim it.
Not run: no unit test. The condition is a container runtime's seccomp decision on
access(X_OK),which a unit test cannot produce without a seccomp filter of its own, and I did not want to add a test
that only restates the helper. The honest shape is a container-level check like
docker/smoke-test.shbehind an opt-in; I can add that instead if you prefer.Not run: macOS and Windows launchers (
bin/strata.ps1,bin/strata.cmd): the change is in the POSIXlauncher and the container entrypoint only. They keep
Test-Path/where, which no container profilechanges.
Limits
test -xsays no. Where the test works the extra startnever happens, so the normal startup path is unchanged.
found" message; only the decision in between changed.
most readers never see this; the fix costs them nothing.
Measured on: Ubuntu 20.04.3 LTS host, kernel 5.15.0-58, glibc 2.31, two-socket Xeon Gold 5218,
125.6 GiB RAM, RTX 5090 32 GB with driver 580.142, Docker 19.03.15 (AppArmor + default seccomp).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.