Feature #5
openHUB ALPR - Feature #11: Dockerize services
Dockerize cameraserver
90%
Description
To avoid having multiple versions of cameraserver (for Ubuntu 18.04 and 22.04) and discrepancies with the code, dockerizing the service would make it independent of the host machine.
Evaluate out the following:
1. Performance.
2. Total size of the container.
3. Set up.
4. Compatibility.
5. License and commercial use.
Updated by Khaled Malhal Abbas about 1 month ago
- Status changed from New to In Progress
- % Done changed from 0 to 60
- Estimated time changed from 3:00 h to 12:00 h
An initial Dockerfile has been made to install the Qt libraries necessary for the cameraserverd service.
install_qt.sh is copied and executed in the image in the moment of building. In that same script, it checks that the tarball of the Qt sources is present and validated. It also skips a bunch of Qt modules that are not necessary to quicken the pace of the building and installation of the Qt libraries, skipping as well some tools (such as designer).
In the docker-compose.yml is important to keep the variable QT_VERSION and QT_SUBVERSION coherent to each other and updated to the desired version since from those variables it obtains the sources.
Next, we should be able to install the rest of the libraries needed such as Pylon, OpenCV and VPAR.
Updated by Khaled Malhal Abbas about 1 month ago
- Status changed from In Progress to Paused
- % Done changed from 60 to 80
Installation of VPAR7, OpenCV and ConfigALPR. Some modifications for Qt libraries.
ConfigALPR does not compile properly due to serialport module.
VPAR7 does not load when executing cameraserverd due to not recognizing license USB.systemctl does not execute in the Docker container because of dependency of running the init process (PID 1). This might not be necessary to fix and we could run manually the services (/usr/sbin/hasplmd and /usr/sbin/aksusbd).
It is suspected that, despite getting the dongle recognized by the container, it does not "resolve" it due to missing "drivers".
Updated by Khaled Malhal Abbas about 1 month ago
- % Done changed from 80 to 90
The processes hasplmd and aksusbd when executed, will attempt to daemonize themselves. But since there is no PID 1 (or init process) to take ownership of them, they "probably" exit. So, a mini init process has been integrated to take ownership of these daemons (https://github.com/krallin/tini).
However, one limitation is that the Sentinel driver of USB dongles have to be installed in the host machine.
So far, it has been tested out with a camera connected to the host and it reads license plates. But some more exhaustive testing needs to be done.
configalpr needs to be compiled as well.
Updated by Khaled Malhal Abbas about 1 month ago
There are various files in the Vama's Synpatic server. Docker will fetch the necessary libraries and sources from there instead of the official sources because of control reasons.
Furthermore, there are a few things to consider before building the image:- When downloading the OpenCV's sources, it will have this format
x.y.z.zip, wherex,yandzare the version numbers. To keep consistency in the server, add the prefixopencv_to the file, resulting in the following:opencv_x.y.z.zip. - The file
tiniis a binary and executable file obtained from this repository: https://github.com/krallin/tini. They make various releases in different formats and for different operating systems. It was decided to simply download the already compiled executable.
In the Dockerfile, you will find where those sources were found for reference.
Updated by Khaled Malhal Abbas about 1 month ago
It seems that it is possible to deploy our docker image into GitHub using GitHub Packages. More researching is needed because of how delicate the repositories access and visibility is.
Updated by Khaled Malhal Abbas 6 days ago
- Subject changed from Dockerize the service to Dockerize cameraserver
- Parent task set to #11