I have two USB cameras that I want to read video frames from and send to another computer. While it might be somewhat easier to coordinate the synchronization of the two cameras from a single executable given that the cameras are different communication failure modes.
When I say different failure modes, I mean that one camera might not fully work until we reopen and flush it several times, and the other camera is then waiting. Or a camera will suddenly stop responding, possibly resulting in a failure with the second camera while the code tries to re-establish communications with the first camera.
So while we try to figure out the root causes, and fix the underlying problems we are stuck with a very unstable system when we could have a somewhat stable system. Trade-offs…
I was wondering if there are any suggestions on how best to deploy and run two containers running basically the same code on the same device.
My first thought is to just duplicate the executable code and dockerfile.templates to create identical containers and use service variables or the container names to distinguish between them. Container1 would work with Camera1, Container2 with Camera2. This requires 2x the build time and 2x deployment time.
The second idea is to have one container hold the executable code, and to rsync it to a shared volume on startup. Then both containers can run the same code from the shared volume. 1x build time, 1x deployment time, maybe 1.5x boot time after a deployment.