OpenVisualCloud / Smart-City-Sample

The smart city reference pipeline shows how to integrate various media building blocks, with analytics powered by the OpenVINO™ Toolkit, for traffic or stadium sensing, analytics and management tasks.
BSD 3-Clause "New" or "Revised" License
189 stars 81 forks source link

How to use multioffice in Kubernetes? #737

Closed divdaisymuffin closed 3 years ago

divdaisymuffin commented 3 years ago

I am trying to do multioffice in traffic scenario, db gets initialized for both offices, but other pods are not able to connect to them, for other Pods the logs shows, 'waiting fo db' , this I was doing in the same PC. Please suggest me what I am doing wrong here.

xwu2git commented 3 years ago

Can you list the steps you use to compile and to start the offices? In your other pods, can you ping or curl the db pod? curl http://:9200.

divdaisymuffin commented 3 years ago

I followed following steps cmake -DSCENARIO=traffic -DNOFFICES=2 .. make make start_kubernetes

after this I can see pods created for both the offices, and curl http://:9200 is also working fine from other pods, but still logs of other pods says "waiting for DB". Also Db-init Pod is having proper connection with db Pod and db is getting initialized

divdaisymuffin commented 3 years ago

@xwu2git , there is one update, So I figured it out, it was related to kubernetes cluster and swap thing, now both of my offices are running, db is getting initialized and other pods are connected to it. But the problem now is, my traffic-office1-analytics-traffic pod is getting sensor feed and further process is happening, which includes, creation of all indices (analytics, sensor, recordings etc.) for the office1, but my office2 traffic-office2-analytics-traffic is not getting the sensor stream. So as we know that we need to give the camera or video information into the sensor-info.json, there is only one office longitude and latitude info mentioned, so I tried to append that sensor-info.json with office2 location (long and lat) but while make I got error. Please put some more light into it.

xwu2git commented 3 years ago

There are 3 offices defined in sensor-info.json. They are:

    "scenario": "traffic",
    "address": "Dawson Creek",
    "location": {
        "lat": 45.539626,
        "lon": -122.929569
    },
    "scenario": "traffic",
    "address": "Shady Wood",
    "location": {
        "lat": 45.524460,
        "lon": -122.960475
    },

and

    "scenario": "traffic",
    "address": "Glencoe Tract",
    "location": {
        "lat": 45.543645,
        "lon": -122.984178
    },

You don't need to do any extension for less than 3 offices. I suspect your issue is still in the Kubernetes setup, most likely in your POD network setup. Is the analytics POD actually running, or waiting to be deployed? If it's the later, probably you don't have enough CPU resources to run three offices.

xwu2git commented 3 years ago

I just re-checked. 3 offices started as expected. Please double check your Kubernetes setup.

xwu2git commented 3 years ago

If you run multiple machine setup, please turn off firewall. Kubernetes require special setup for firewalls.

divdaisymuffin commented 3 years ago

Yeah you are right, its working now. Thanks a lot @xwu2git :)