Installing CVB in Docker

#1

Hello

We want to be able to distribute our app using docker. Has anyone been successful in this?

We experience problems getting the debian package installed without errors (the errors are related to run-level determination) after installation we can compile and link against the cvb library but we cannot run the program as it fails.

Unpacking codemeter (5.22.1504.500) ...
Setting up codemeter (5.22.1504.500) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21.4) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Selecting previously unselected package cvb-foundation-dev.
(Reading database ... 112023 files and directories currently installed.)
Preparing to unpack .../cvb-foundation-dev-13.01.003-ubu1604-x86_64.deb ...
Unpacking cvb-foundation-dev (13.01.003) ...
Selecting previously unselected package cvb-tools-dev.
Preparing to unpack .../cvb-tools-dev-13.01.003-ubu1604-x86_64.deb ...
Unpacking cvb-tools-dev (13.01.003) ...
Selecting previously unselected package cvb-camerasuite.
Preparing to unpack .../cvb-camerasuite-13.01.003-ubu1604-x86_64.deb ...
Unpacking cvb-camerasuite (13.01.003) ...
Selecting previously unselected package cvb-foundation.
Preparing to unpack .../cvb-foundation-13.01.003-ubu1604-x86_64.deb ...
Unpacking cvb-foundation (13.01.003) ...
Selecting previously unselected package cvb-camerasuite-dev.
Preparing to unpack .../cvb-camerasuite-dev-13.01.003-ubu1604-x86_64.deb ...
Unpacking cvb-camerasuite-dev (13.01.003) ...
Selecting previously unselected package cvb-tools.
Preparing to unpack .../cvb-tools-13.01.003-ubu1604-x86_64.deb ...
Unpacking cvb-tools (13.01.003) ...
Setting up cvb-camerasuite (13.01.003) ...
Setting CVB services up...
Failed to retrieve/decode the log configuration for module GEVSVC: Failed to connect to the shared memory with connection info: No such file or directory

*****************************************************************
                  (c) 2015 STEMMER IMAGING GmbH
*****************************************************************

STEMMER IMAGING Logging Service Application 
BuildDate : 	Feb 28 2018


Enter service
Setting up cvb-foundation (13.01.003) ...
Setting up cvb-camerasuite-dev (13.01.003) ...
Setting up cvb-tools (13.01.003) ...
Setting up cvb-foundation-dev (13.01.003) ...
Setting up cvb-tools-dev (13.01.003) ...
#2

@mla, sorry for replying that late, but codemeter and :cvb: setups are not intended for Docker installation. The errors you see come from trying to register the necessary daemons. To be able to install the packages you need to split the installation and get rid of the postinst script (and then do some of the work later).

Install

> dpkg --unpack path/to/codemeter*.deb
> rm /var/lib/dpkg/info/codemeter.postinst
> dpkg --configure codemeter
> dpkg --unpack path/to/cvb-camerasuite-13.01*.deb
> rm /var/lib/dpkg/info/cvb-camerasuite.postinst
> dpkg --configure cvb-camerasuite
> ldconfig

and starting with version 13.01.004

> ln -s `find /opt/ -name cvb-*` /opt/cvb

The other packages can be installed normally via dpkg -I.

Start

For the following start-up script I assume that you want to use a GigE Vision cameras with CameraSuite licensing only.

Before you start your app in the container you need to start at least two services manually and source some environment variables. The most direct way would be a start script in your image which is run in the container:

/opt/cvb/bin/cvmgmtd
/opt/cvb/bin/siGevSvc -s
. /etc/profile.d/cvb_environment.sh

After that you can start your app.

Also, if you want to persist settings you need to map the following directories outside the container:

  • /etc/opt/cvb
  • /var/opt/cvb
1 Like
#3

Thank you for your reply, i got it working inside docker, but i am unable to get rid of the watermark.

my startup script

/opt/cvb/bin/siLogSvc -s
/opt/cvb/bin/cvmgmtd
/opt/cvb/bin/siGevSvc -s
. /etc/profile.d/cvb_environment.sh

i have added the license key to /opt/cvb/camerasuite.lic but it does not seem to work.

best regards
Morten Larsen

#4

First the file should be located under:

/var/opt/cvb/camerasuite.lic

Did you write the camerasuite.lic inside the image? Do the keys inside this file work outside the container?

I would recommend to put that file outside of the image and mount it there (or mount it somewhere else and adjust the $CVBDATA environment variable pointing to that location. Also other information will be saved there which you might want to persist.

#5

Thank you for your quick reply and assistance.

I am running cvb version 13.01.003

i am mounting

"-v /etc/opt/cvb:/etc/opt/cvb"
"-v /var/opt/cvb:/var/opt/cvb"

the /etc/opt/cvb on the host machine contains the driver

cat /etc/opt/cvb/drivers/GenICam.ini 
;utf8
[SYSTEM]
NumCameras=1
CreateAutoIni=0
AutoSwitchEnable=0
DeviceUpdateTimeout=-1
AutoConfigExecuted=1
[Channel_0]
TLType=GEV
TL=/opt/cvb/drivers/genicam/libGevTL.cti.1.1800.26
Interface=SD::MAC->correct mac for this host
Device=::ID->redacted::192.168.19.2
NumBuffer=30
PacketSize=8192
InterPacketDelay=-1
PixelFormat=5
RotateImage=0
AccessMode=4
Vendor=Allied Vision Technologies
Model=Mako G-507B (9616)
UserName=
SerialNumber=redacted by me
PacketResend=1
HeartbeatTimeout=-1
HeartbeatTimeoutMargin=-1
MCMasterMode=0
MCSession=0
MCNoJoin=0
UseTurboDrive=0
NumConvertThreads=1
AttachChunk=0

ls /var/opt/cvb/

camerasuite.lic  genicam  GenICamBrowser.xml  log  Registry

I copied the driver from a working system and changed the mac address to match the new host. Then i copied the camerasuite.lic file where i found it in the old system (on that it was located in /opt/cvb/camerasuite.lic) i did also copy the complete contents of /var/opt/cvb to the new machine, perhaps this is the problem?

#6

Nevermind

Turns out you have to disable the firewall completely on the host system

systemctl firewalld stop

for the watermark to disappear, can you confirm this? the new host system is centos7 btw.

#7

Hi there!

when working with a CameraSuite license, this behaviour would in fact make sense because the license validity check relies on being able to every now and then talk to the camera. If a firewall prevents this, this would in fact be interpreted as “camera is not there” in which case the CameraSuite license is inactive.