Let a deployment turn the camera on - #16
Conversation
skysim renders camera frames and no deployment can ask it to: the entrypoint maps SKYSIM_TILES, SKYSIM_DT and the rest into flags but has no camera mapping, so --camera-fps is never passed and the render service is never built. That is the state on dev — the service is running the rendering build, the gateway is pointed at it, and there are no pictures. SKYSIM_CAMERA_FPS is the switch, matching the CLI where --camera-fps is what decides whether the render service exists at all. Size, quality, threads, fov, pitch and range apply once it is on. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cgM68QE3FDz7S2pQAfTaZ
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Docker entrypoint maps timing and camera settings from ChangesDocker environment configuration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@README.md`:
- Around line 197-200: Update the README camera Docker command to set
SKYSIM_VEHICLES=1, ensuring the documented instance 0 has a vehicle-specific
frame available when the camera URL is opened.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e202e196-39bb-4dfb-a1ea-71acdb6fc8a6
📒 Files selected for processing (2)
README.mddocker-entrypoint.sh
| docker run --rm -p 8642:8642 -p 9002-9202:9002-9202/udp \ | ||
| -v $(pwd)/build/city/tiles:/world:ro -e SKYSIM_TILES=/world \ | ||
| -e SKYSIM_CAMERA_FPS=10 -e SKYSIM_CAMERA_SIZE=256x144 skysim | ||
| # http://localhost:8642/instances/0/camera.mjpg |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the camera example create or reserve a vehicle.
At Line 197, the command leaves SKYSIM_VEHICLES at the Dockerfile default 0. The per-instance route at src/api/control_server.cpp:317-345 therefore has no vehicle-specific frame for the documented instance 0.
Set SKYSIM_VEHICLES=1, or document the POST /vehicles step before opening the URL.
Proposed documentation fix
docker run --rm -p 8642:8642 -p 9002-9202:9002-9202/udp \
-v $(pwd)/build/city/tiles:/world:ro -e SKYSIM_TILES=/world \
+ -e SKYSIM_VEHICLES=1 \
-e SKYSIM_CAMERA_FPS=10 -e SKYSIM_CAMERA_SIZE=256x144 skysim📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| docker run --rm -p 8642:8642 -p 9002-9202:9002-9202/udp \ | |
| -v $(pwd)/build/city/tiles:/world:ro -e SKYSIM_TILES=/world \ | |
| -e SKYSIM_CAMERA_FPS=10 -e SKYSIM_CAMERA_SIZE=256x144 skysim | |
| # http://localhost:8642/instances/0/camera.mjpg | |
| docker run --rm -p 8642:8642 -p 9002-9202:9002-9202/udp \ | |
| -v $(pwd)/build/city/tiles:/world:ro -e SKYSIM_TILES=/world \ | |
| -e SKYSIM_VEHICLES=1 \ | |
| -e SKYSIM_CAMERA_FPS=10 -e SKYSIM_CAMERA_SIZE=256x144 skysim | |
| # http://localhost:8642/instances/0/camera.mjpg |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` around lines 197 - 200, Update the README camera Docker command to
set SKYSIM_VEHICLES=1, ensuring the documented instance 0 has a vehicle-specific
frame available when the camera URL is opened.
skysim defaults to strict — barrier every tick, abort on a miss — because that is what determinism and CI replays need. A long-lived server wants the opposite: vehicles join and leave, some lag, and none of that should take the fleet down. There was no way to say so. The entrypoint mapped --dt but not --time-mode, so every containerised deployment ran strict unless it hand-wrote SKYSIM_EXTRA_ARGS. Dev does run strict, and it is why a vehicle that reserved its slot correctly then vanished from the fleet: its 200 Hz scheduler answers one tick in four of an 800 Hz world, and strict mode drops the straggler. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cgM68QE3FDz7S2pQAfTaZ
add_if_set was introduced and then only the camera block used it — the same change hand-wrote SKYSIM_TIME_MODE in the old three-line form, next to SKYSIM_DT and SKYSIM_SPAWN_HOME already written that way. Hoisted above first use; nine lines become three. --camera-size stops restating 256x144, which src/main.cpp already defaults to. Written out in the entrypoint, the README and the terraform task definition, it meant changing the default in main.cpp would silently change nothing in a container. Verified by running the entrypoint with exec stubbed, for camera off, everything set, and camera on with size unset. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017cgM68QE3FDz7S2pQAfTaZ
skysim renders camera frames, and no deployment can ask it to.
docker-entrypoint.shmapsSKYSIM_TILES,SKYSIM_DT,SKYSIM_VEHICLESand the rest into flags but has no camera mapping at all, so--camera-fpsis never passed, the render service is never constructed, and the camera endpoints serve nothing.That is the state on dev right now: the service is running the rendering build, the gateway is pointed at it, and there are no pictures.
SKYSIM_CAMERA_FPSis the switch — matching the CLI, where--camera-fpsis what decides whether the render service exists.SKYSIM_CAMERA_SIZE(default256x144),_QUALITY,_THREADS,_FOV,_PITCH,_RANGEapply once it is on.SKYSIM_*set, which was undocumented.Verified by running the entrypoint with
execstubbed, for camera-off, camera-on-defaults and camera-on-all-set:🤖 Generated with Claude Code
https://claude.ai/code/session_017cgM68QE3FDz7S2pQAfTaZ
Summary by CodeRabbit
New Features
Documentation