Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provisioning sensor script fails #754

Closed
sudhirkshirsagar opened this issue Mar 20, 2021 · 12 comments
Closed

Provisioning sensor script fails #754

sudhirkshirsagar opened this issue Mar 20, 2021 · 12 comments

Comments

@sudhirkshirsagar
Copy link

It is not possible to run provision.py in its directory because it references other py files in other directories.

@xwu2git
Copy link
Collaborator

xwu2git commented Mar 20, 2021

Note that the smtc_db_init image derives from the smtc_common image.

@sudhirkshirsagar
Copy link
Author

sudhirkshirsagar commented Mar 20, 2021 via email

@xwu2git
Copy link
Collaborator

xwu2git commented Mar 20, 2021

What script dependency is missing?

BTW, provision.py is just an example of initial provisioning. In a real product, a field provisioning tool must be written to dynamically insert provisioning information into the DB. This field tool is out of scope of the sample. Thus provision.py is there to write something to the DB so that the sample can function.

@sudhirkshirsagar
Copy link
Author

sudhirkshirsagar commented Mar 21, 2021 via email

@xwu2git
Copy link
Collaborator

xwu2git commented Mar 21, 2021

Yes, db_ingest import DBIngest, which is in the smtc_common. This is why the db_init image uses smtc_common as the base image. The final built image smtc_db_init is self-sufficient with all the dependencies. In other images where DBIngest is needed, they either use smtc_common as the base image or copy the *.py scripts over. What was the issue exactly?

As for provisioning, the camera info from sensor-info.json is written to the provisions index. Then at runtime, when a new sensor is discovered, the IP address or URL is compared to the provisions index to find a match. Then the discover sensor is written to the sensors index. See sensor/discovery for details.

@sudhirkshirsagar
Copy link
Author

sudhirkshirsagar commented Mar 22, 2021 via email

@xwu2git
Copy link
Collaborator

xwu2git commented Mar 22, 2021

Don't fully understand what you say. All python scripts are under /home. No issue with execution.
Single node docker swarm is tested.
The v21.3 branch does not build simply because the required openvisualcloud software stacks have not yet released and uploaded to dockerhub.

@sudhirkshirsagar
Copy link
Author

sudhirkshirsagar commented Mar 22, 2021 via email

@xwu2git
Copy link
Collaborator

xwu2git commented Mar 22, 2021

Let's use the smtc_db_init image as an example. You can run into the image to talk a look:

docker run --rm -it smtc_db_init ls -l /home

You can see that all the python scripts and their dependencies are under /home.

@sudhirkshirsagar
Copy link
Author

sudhirkshirsagar commented Mar 22, 2021 via email

@xwu2git
Copy link
Collaborator

xwu2git commented Mar 22, 2021

Please check deployment/docker-swarm/secret.m4 and deployment/docker-swarm/analytics.m4.
The sensor-info.json is mounted to the image vs docker secrets.

@sudhirkshirsagar
Copy link
Author

sudhirkshirsagar commented Mar 22, 2021 via email

@xwu2git xwu2git closed this as completed Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants