Skip to content

Let a deployment turn the camera on - #16

Open
yalexx wants to merge 3 commits into
mainfrom
feature/camera-env
Open

Let a deployment turn the camera on#16
yalexx wants to merge 3 commits into
mainfrom
feature/camera-env

Conversation

@yalexx

@yalexx yalexx commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

skysim renders camera frames, and no deployment can ask it to. docker-entrypoint.sh maps SKYSIM_TILES, SKYSIM_DT, SKYSIM_VEHICLES and the rest into flags but has no camera mapping at all, so --camera-fps is 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_FPS is the switch — matching the CLI, where --camera-fps is what decides whether the render service exists.
  • SKYSIM_CAMERA_SIZE (default 256x144), _QUALITY, _THREADS, _FOV, _PITCH, _RANGE apply once it is on.
  • README documents the full SKYSIM_* set, which was undocumented.

Verified by running the entrypoint with exec stubbed, for camera-off, camera-on-defaults and camera-on-all-set:

--camera-fps 10 --camera-size 256x144
--camera-fps 10 --camera-size 320x180 --camera-quality 70 --camera-threads 2 --camera-range 400

🤖 Generated with Claude Code

https://claude.ai/code/session_017cgM68QE3FDz7S2pQAfTaZ

Summary by CodeRabbit

  • New Features

    • Added configurable camera output for Docker deployments.
    • Enable and customize camera resolution, image quality, processing threads, field of view, pitch, range, and frame rate.
    • Camera output is available through the documented MJPEG endpoint.
    • Added Docker configuration for interactive or strict timing modes.
    • Camera-specific settings are ignored when camera output is disabled.
  • Documentation

    • Expanded Docker guidance with environment-variable options and a camera-enabled usage example.

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
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a43cb25-da46-46c3-90a3-2633cb46d868

📥 Commits

Reviewing files that changed from the base of the PR and between b0672d4 and a97cc82.

📒 Files selected for processing (1)
  • docker-entrypoint.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • docker-entrypoint.sh

📝 Walkthrough

Walkthrough

The Docker entrypoint maps timing and camera settings from SKYSIM_* environment variables to CLI arguments. The README documents these settings and provides a camera-enabled Docker command with the MJPEG endpoint.

Changes

Docker environment configuration

Layer / File(s) Summary
Timing environment mapping
docker-entrypoint.sh, README.md
The entrypoint conditionally maps timing and spawn settings and adds SKYSIM_TIME_MODE. The README documents timing and related entrypoint settings.
Camera environment mapping
docker-entrypoint.sh, README.md
When SKYSIM_CAMERA_FPS is set, the entrypoint enables camera output and applies optional camera settings. The README documents the variables and MJPEG endpoint usage.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: enabling camera configuration at deployment level.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/camera-env

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 70b0c01 and aaaef9e.

📒 Files selected for processing (2)
  • README.md
  • docker-entrypoint.sh

Comment thread README.md
Comment on lines +197 to +200
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
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.

yalexx and others added 2 commits August 9, 2026 11:05
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
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.

1 participant