Repository navigation
Conversation
Fixes #3271. Every browser Node image ships video_ready.py (recorder autostart) because node-base builds FROM the video image, and video-ready has always listened on port 9000 regardless of SE_RECORD_VIDEO - PR #3131 made both video-recording's and video-ready's supervisord autostart unconditional so a session could turn recording on dynamically via the se:recordVideo capability. That capability is handled entirely by video_recorder.py / video_service.py (SE_VIDEO_FILE_NAME=auto / the event-driven service); video-ready has no part in it and nothing in this repo queries its endpoint outside the Helm chart's optional, off-by-default sidecar probes. Its own handler already special-cases this: when neither SE_VIDEO_EVENT_DRIVEN nor SE_RECORD_VIDEO is true, it always answers "ready" immediately - so a container in that state gets nothing from running it, only the bound port. Compute SE_VIDEO_READY_ENABLED in Video/entry_point.sh from those two variables (or an explicit override) and have recorder.conf gate video-ready's autostart/autorestart on it. NodeBase's own defaults (SE_RECORD_VIDEO=false, SE_VIDEO_EVENT_DRIVEN=true) are unchanged by this - video-ready keeps running exactly as it does today unless a deployment also turns event-driven mode off, or sets SE_VIDEO_READY_ENABLED=false directly (the explicit opt-out the issue asked for, e.g. for network_mode: host). Verified in a real container with the actual recorder.conf and entry_point.sh under supervisord: defaults listen as today; both variables false stops it from binding the port at all; the explicit override forces it on or off regardless of the other two. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3271.
Every browser Node image (
node-chrome,node-chromium,node-firefox,node-edge, ...) shipsvideo_ready.pybecausenode-baseis builtFROMthevideoimage.Video/recorder.conf'svideo-readyprogram has listened on port 9000 unconditionally since PR #3131, regardless ofSE_RECORD_VIDEO- that PR made bothvideo-recording's andvideo-ready's supervisordautostart/autorestartunconditionallytrueso a session could turn recording on dynamically via these:recordVideocapability, replacing the oldautostart=%(ENV_SE_RECORD_VIDEO)sgating.Tracing where that capability is actually handled: entirely inside
video_recorder.py/video_service.py(viaSE_VIDEO_FILE_NAME=autoin legacy/shell mode, or the event-driven service inSE_VIDEO_EVENT_DRIVEN=truemode).video-readyhas no part in it, and nothing in this repo ever queries its HTTP endpoint - the only documented consumer is the Helm chart's optional video-recorder-sidecarstartupProbe/livenessProbe(videoRecorder.startupProbe/livenessProbeinvalues.yaml), which are empty/off by default.video_ready.py's own handler already special-cases the condition where nothing can happen: when neitherSE_VIDEO_EVENT_DRIVENnorSE_RECORD_VIDEOistrue, it always answers{"status": "ready"}immediately, every single time - so a container in that exact state gets zero value from the server actually running, only the bound port and the symptom in the issue (fails undernetwork_mode: host, since the container shares the host's network namespace entirely so even a loopback-only bind wouldn't help here - only not starting the process does).What this does
Video/entry_point.shcomputes a newSE_VIDEO_READY_ENABLEDfromSE_RECORD_VIDEOandSE_VIDEO_EVENT_DRIVEN(or respects an explicit override) before launching supervisord.Video/recorder.confgatesvideo-ready'sautostart/autorestarton it, restoring the pre-Docker: Video recording starts via session capability se:recordVideo #3131-style conditional start for this one program -video-recordingkeeps its unconditionalautostart=true, since these:recordVideocapability feature genuinely depends on it always running and is otherwise untouched by this change.VIDEO_READY_PORT(existing, previously undocumented, per the issue) and the newSE_VIDEO_READY_ENABLEDinENV_VARIABLES.md, including the direct opt-out the issue asked for ("document an environment variable that disables it") -SE_VIDEO_READY_ENABLED=falseforces it off regardless of the other two, e.g. fornetwork_mode: host.Important:
NodeBase/Dockerfile's own defaults areSE_RECORD_VIDEO=falseandSE_VIDEO_EVENT_DRIVEN=true- so by default,video-readykeeps running exactly as it does today (nothing changes out of the box). The issue's reporter setSE_RECORD_VIDEO=falseexplicitly without also disabling event-driven mode, which is already the Node image's default and not what actually stopsvideo-ready. Reaching the issue's desired "nothing video-related is listening" state needsSE_VIDEO_EVENT_DRIVEN=falsetoo (now documented), or the new direct override.Test plan
video_ready.py's endpoint in this repo (none besides the chart's own off-by-default probe docs) and ofSE_VIDEO_EVENT_DRIVEN/SE_RECORD_VIDEOin the recording-side scripts, to confirm gatingvideo-readyalone doesn't affect these:recordVideocapability feature.Video/recorder.conf,Video/entry_point.sh, andVideo/video_ready.pyunder realsupervisord, and verified all four cases:video-readystarts, port 9000 responds (matches current/default behavior, unchanged).SE_RECORD_VIDEO=false SE_VIDEO_EVENT_DRIVEN=false->video-readydoes not start, port 9000 refuses connections.SE_VIDEO_READY_ENABLED=true-> starts anyway (explicit force-on).SE_RECORD_VIDEO=true SE_VIDEO_EVENT_DRIVEN=true SE_VIDEO_READY_ENABLED=false-> does not start (explicit force-off overrides both).bash -nsyntax check andmake lint_format_scripts(shfmt) onVideo/entry_point.sh.🤖 Generated with Claude Code