aravis icon indicating copy to clipboard operation
aravis copied to clipboard

Running aravis in orchestrated environment such as kubernetes

Open wuhaochen opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. Related to #707 , we would like to push aravis further to use it in kubernetes to control/stream from many GigE cameras. (100+) Currently this is very hard to achieve as aravis is binding to whatever port that is available and we won't be able to expose all these ports from kubernetes. Even with #709 , because each ArvGvStream is still bind to its own dedicated ports, the number of ports required will scale linearly as we add more cameras.

Describe the solution you'd like Allow specifying port(s) used for streaming and distribute incoming packets based on the source IP to different streams. This should be doable in theory. Currently the g_socket_receive_messages is used to receive traffic and there is an address field in the incoming message that is not being used. We can add additional routing logic there to reuse the same port for different cameras. This way it allows the whole service being hosted in a single port like a typical server setup.

One possible solution is to have a dedicated thread receiving all the traffic and store it in some buffer structure and then have each ArvGvStreamThreadData to access only buffers that assigned to them. At this moment I'm not sure about the performance implication but I'm not particularly worried as the bottleneck is probably unchanged.

Describe alternatives you've considered We can try to have many services in different pods/IP address but the maintenance cost is going to scale as we add more cameras.

Additional context

wuhaochen avatar Oct 05 '22 17:10 wuhaochen

I understand the need and agree #709 is not enough. That will not happen by itself though.

EmmanuelP avatar Oct 06 '22 13:10 EmmanuelP

I understand the need and agree #709 is not enough. That will not happen by itself though.

In that case I would be happy to help. I can probably start working somewhere next week and create a draft if the stated plan makes sense.

wuhaochen avatar Oct 06 '22 19:10 wuhaochen

HI @wuhaochen , did you have a chance to work on this issue ?

EmmanuelP avatar May 19 '23 05:05 EmmanuelP

Hi @EmmanuelP, I'm sorry I got distracted by other stuff and wasn't able to spend much time on this. I might not have time to work on this in the foreseeable future as well.

I did some readings and experiments on the k8s network. While technically it's possible to run say 100 cameras from k8s directly, the network bandwidth requirement becomes the bottleneck very quickly as most GigE cameras transfers raw sensor data. For that reason we decided to compress the images at edge instead.

wuhaochen avatar May 22 '23 18:05 wuhaochen