Repository navigation
feat: send fake alerts to a remote alert API with the fake cameras - #66
Open
MateoLostanlen wants to merge 12 commits into
Open
MateoLostanlen wants to merge 12 commits into
MateoLostanlen wants to merge 12 commits into
Conversation
LOOP=true replays the scenario from the start after the last frame, to generate alerts continuously.
make run-engine-preprod makes fakecam-1 impersonate a camera of data/credentials-preprod.json (st-peray-01 on preprod) and runs the real camera API and engine against DISTANT_API_URL, without the local stack. API URL, credentials file, engine image tag and loop are compose variables with the local values as defaults.
The token script reads a committed template and writes a gitignored file with mode 0600.
So the 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.
With a single clear frame a looped replay never lets the engine close the sequence. The credentials mount of the camera API is read-only.
Both fake cameras play as fake-cam-01 and fake-cam-02 of the fake-cam organization on preprod, placed where the scenario frames were shot, instead of impersonating a St Peray camera.
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.
LOOP=truereplays a scenario forever, so the fake cameras generate alerts continuously.make run-engine-preprodruns the real camera API and engine against the API ofDISTANT_API_URL(preprod) without the local stack. The fake cameras play asfake-cam-01andfake-cam-02of thefake-camorganization, placed where the scenario frames were shot.scripts/preprod_credentials.pyinto a gitignored file, created owner-only. Before asking any token, the script checks that each camera id has the expected name on that API, and stops otherwise.fake-cameraimage embeds the default scenario so it runs alone on a test station (see pi-manager-template). API URL, credentials file, engine image tag and loop are compose variables with the local values as defaults.mainonce it is merged.