Skip to content

feat(preview): app-start proof for the offline preview image (CHE-9898) [merge] - #356

Open
congvc-bot-x99[bot] wants to merge 2 commits into
mainfrom
agent/x99-claude-sonnet/che-9898-e8076caebabd
Open

congvc-bot-x99[bot] wants to merge 2 commits into
mainfrom
agent/x99-claude-sonnet/che-9898-e8076caebabd

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Status

Draft. Stage 2b of CHE-1434. The offline --target preview image starts on X99. docs/preview-build.md now marks the target usable.

Conditions

  • The live console Dockerfile stages are unchanged. test_live_target_unchanged_from_base passes.
  • This PR changes uv.lock: opencv-python 5.0.0.93 becomes opencv-python-headless 5.1.0.95. No other package changed.
  • No host change, no deploy, no public route. No build ran on C00 or vps-langfuse.

Change

  • Blocker found by the first run on main at 5ee318c0: import cv2 failed with libxcb.so.1: cannot open shared object file (also libGL.so.1, libglib-2.0.so.0 and libgthread-2.0.so.0 missing). The issue forbids apt-get in a networked preview stage, so the dependency changed instead.
  • pyproject.toml, uv.lock: opencv-python becomes opencv-python-headless. The code uses cv2.VideoCapture and image functions only. No imshow, namedWindow or waitKey call exists outside tests.
  • Dockerfile: the preview-wheel-builder stage copies device_lease/. setup.py ships it and the admin console imports it at startup. Without it the app failed with ModuleNotFoundError: No module named 'device_lease'.
  • tests/unit/preview_host/test_build.py: asserts the device_lease copy. test_opencv_is_the_headless_build_in_pyproject_and_lock fails if pyproject.toml or uv.lock goes back to opencv-python or opencv-contrib-python.
  • docs/preview-build.md: "App-start proof" section with the run command and result.

Blast Radius

The preview target, docs/preview-build.md and the dependency set. uv.lock is shared, so the live console also gets the headless OpenCV wheel. A break shows as an ImportError or missing video or image function in the console. CI keeps installing libgl1, libglib2.0-0 and libxcb1; that is harmless and untouched. Separate finding: the live wheel-builder stage also lacks COPY device_lease/. This PR does not change it.

Proof level: 4 (X99 build and run below).

Evidence

python3 -m pytest --confcutdir=tests/unit/preview_host tests/unit/preview_host -q
1 failed, 654 passed, 2 skipped in 63.45s

The one failure is test_egress.py::test_denied_ipv6_covers_everything_outside_global_unicast_or_is_not_accepted. It also fails on origin/main (1 failed, 90 passed, 1 skipped in that file), so it is not caused by this PR. tests/unit/test_workflow_runner_policy.py: 13 passed. ruff check and ruff format --check pass on the changed test file.

X99 build, with acquisition from the real uv.lock (175 wheels) and npm ci --ignore-scripts:

docker buildx build --network=none --target preview \
  --build-context preview-node-inputs=./node-inputs \
  --build-context preview-python-inputs=./py/python-inputs --load .

Exit 0. Image digest sha256:ee11b581262fda4bcdf11bd8922deab0af6de8537aabbedd49768cbd86bb3641. Config.User is 10001:10001.

Run with --network none, ARTEMIS_PREVIEW_PROFILE=1 (set in the image), tmpfs /tmp and /scratch, and a throwaway public key bundle (command in the docs). The server logs Application startup complete. Inside the container as UID 10001:

  • GET / without a token: 401.
  • GET / with a valid Cf-Access-Jwt-Assertion: 200.
  • GET /api/system/readiness with the token: 200.

Acquisition ran with direct egress on X99. No egress proxy was in the path, so the proxy-only rule from preview-egress.md is not proven here.

Negative proof: notinwheelhouse==1.0 --hash=sha256:00...00 added to a copy of requirements.txt. The build fails at pip install --no-cache-dir --no-index --require-hashes --find-links /inputs/wheelhouse -r /inputs/requirements.txt with ERROR: No matching distribution found for notinwheelhouse==1.0 (exit code 1).

df -B1, used bytes, /: 433144053760 before, 435392229376 after cleanup. /mnt/ssd2: 405997998080 before, 406743220224 after. Removed: both test images, the container, the staging directory, the key bundle. Residual: BuildKit cache, shared with other work, not pruned. Owner: X99 runtime owner.

Part of CHE-1434
Closes CHE-9898

congvc-bot[bot] added 2 commits November 27, 2026 12:50
Swap opencv-python for opencv-python-headless (no libxcb/libGL/libglib needed),
copy device_lease into the preview wheel builder, and document the proof.
@congvc-bot-x99 congvc-bot-x99 Bot changed the title feat(preview): app-start proof for the offline preview image [squash] feat(preview): app-start proof for the offline preview image (CHE-9898) [squash] Nov 27, 2026
@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review November 30, 2026 08:05
@congvc-bot-x99
congvc-bot-x99 Bot requested a review from congvc-dev November 30, 2026 08:20
@congvc-bot-x99 congvc-bot-x99 Bot changed the title feat(preview): app-start proof for the offline preview image (CHE-9898) [squash] feat(preview): app-start proof for the offline preview image (CHE-9898) [merge] Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants