smart-edge-open / edgeapps

Applications that can be onboarded to an Intel® Smart Edge Open edge node.
Apache License 2.0
51 stars 73 forks source link

Fix mount directory for HDDL sockets and forward text output from openvino sample application #42

Closed alvarovn closed 3 years ago

alvarovn commented 3 years ago

This PR aims to fix a few issues that I've encountered related to the Openvino Sample Application.

The kubernetes manifest for the consumer app mounts /tmp directory. I'm assuming that the reason to mount this directory is to get access to the hddl-daemon sockets. However, that directory is actually /var/tmp. See: https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_docker_linux.html https://github.com/open-ness/specs/blob/master/doc/building-blocks/enhanced-platform-awareness/openness_hddl.md https://github.com/open-ness/openness-experience-kits/blob/master/roles/hddl/network_edge/controlplane/templates/setup_hddl_daemonset.yaml.j2#L41 Also the /dev/shm mount is missing, which is another requirement to work with HDDL daemon.

Moreover, every time that the application attempted to connect to HDDL daemon, it made the daemon crash with a segmentation fault. Following this thread: https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Segmentation-fault-for-object-detection-sample-with-MYRIAD/td-p/1182239 I changed the patch file and the issue disappeared.

Furthermore, I was getting the following issue:

[ ERROR ] Failed to create plugin /opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/lib/intel64/libHDDLPlugin.so for device HDDL
Please, check your environment
Cannot load library '/opt/intel/openvino_2020.2.120/deployment_tools/inference_engine/lib/intel64/libHDDLPlugin.so': libjson-c.so.2: cannot open shared object file: No such file or directory

Which is fixed by adding the missing library as a dependency in the dockerfile.

Finally, the stdout and stderr from the C++ openvino application is not being shown correctly in the Go application. Since the main function calling the go routines that control the text forwarding do not wait for them to finish, nothing gets forwarded. I added a waitgroup to control that. This last fix was needed to be able to see if the C++ openvino app is detecting the HDDL daemon or not.

Let me know if this should be divided into multiple PRs.

jiangzhg commented 3 years ago

@alvarovn Please refer to the following changes and submit again.

https://raw.githubusercontent.com/jiangzhg/tmppatch/master/0001-fix-some-check-issues-by-CI-tools.patch