Repository navigation
feat: fake Reolink camera driven by scenarios - #65
Open
MateoLostanlen wants to merge 18 commits into
Open
MateoLostanlen wants to merge 18 commits into
MateoLostanlen wants to merge 18 commits into
Conversation
A stdlib HTTPS server answering the Reolink CGI API (Snap, PtzCtrl, GetPtzPreset, SetPtzPreset, zoom, focus, reboot) from a folder of frames, one per interval from the first Snap, last frame held. Three scenario definitions and a script to build frames from a replayed alert.
engine and pyro_camera_api move from host networking to the compose network so the fake cameras are reachable by name. The camera API waits for init_script to write the camera tokens. The stuck detector is off since every preset serves the same frames. Poses of the two scenario cameras take the production presets and azimuths.
docker compose up restarts the exited init container, which failed on the duplicate organizations and blocked the services that wait for it.
A database initialized before this branch has the organizations but no token for the new fake cameras: do not exit early in that case.
Also state in the scenario descriptions that every preset serves the same frames for now.
The fake camera only serves frames, so for the engine a false positive is the same as a wildfire. Keep fire and no fire.
fetch-scenario downloads unless every camera of the scenario has frames. init_script skips a re-run only when a marker written at the end of a successful run exists, so a partial init is not mistaken for a complete one.
The previous commit only changed fetch-scenario; this is the init_script part: a re-run exits early only when data/.init_done exists, so a partial init is not mistaken for a complete one.
latest on main, X.Y.Z on a fake-camera-vX.Y.Z tag, build only on pull requests. The default scenario is fetched from the release and embedded.
So the published image runs alone, e.g. on a test station; a volume on /scenarios still overrides it. The build takes data/scenarios as a named context, which the image workflow already passes.
A restored credentials.json with blank tokens must not be skipped, and a full init starts by dropping the marker.
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.
scenariosrelease,scripts/make_scenario.pybuilds them from a replayed alert.ENABLE_STUCK_DETECTOR=false(every preset serves the same frames) and can reach a MediaMTX on the host (host.docker.internal).pyronear/fake-camera(latest on main, X.Y.Z on afake-camera-vX.Y.Ztag) with the default scenario embedded; it needs theDOCKERHUB_LOGIN/DOCKERHUB_PWsecrets..env, starts the engine profile and fails when a service is unhealthy or the engine is not running. It is disabled on the repo and has to be enabled again.