Contents¶
eii_libs_installer Overview¶
This script installs all the Edge Insights for Industrial (EII) libraries and their respective required dependencies.
Note
In this document, you will find labels of ‘Edge Insights for Industrial (EII)’ for filenames, paths, code snippets, and so on.
Running the Install Script¶
Note:
The installer needs specific versions of grpc and protobuf to be installed. If these libraries are already present in the
/usr/local/lib
or at theCMAKE_INSTALL_PREFIX
env location, the installation will skip building and installing the libraries. It is recommended to remove grpc before proceeding, as it can cause version conflicts.sudo apt-get remove --auto-remove --purge -y grpc
Also, ensure that all the EII occurrences are removed from
/usr/local/lib
and/usr/local/include
Install EII libraries¶
To install all of EII libraries and their dependencies, run the following commands:
sudo apt-get update For Ubuntu-20.04
sudo apt-get install -y libcjson-dev libzmq3-dev zlib1g-dev For Ubuntu-18.04
sudo apt-get install -y libjson-c-dev libzmq3-dev zlib1g-dev
mkdir -p /opt/intel/eii/ sudo -E CMAKE_INSTALL_PREFIX="/opt/intel/eii" ./eii_libs_installer.sh
Note:
If the INSTALL_LIBS option is not provided, then script will install all the libs. Different use cases are as follows:
Install Utils libs
sudo -E CMAKE_INSTALL_PREFIX="/opt/intel/eii" INSTALL_LIBS="UTILS" ./eii_libs_installer.sh
Install MessageBus libs
sudo -E CMAKE_INSTALL_PREFIX="/opt/intel/eii" INSTALL_LIBS="MSGBUS" ./eii_libs_installer.sh
Install ConfigMgr libs
sudo -E CMAKE_INSTALL_PREFIX="/opt/intel/eii" INSTALL_LIBS="CONFIGMGR" ./eii_libs_installer.sh
Note: During the execution of
eii_libs_installer.sh
, if any $GOPATH-related error occurs then, set theGOPATH
appropriately, where GO is installed. Ideally, the above script will take care of the GO installation and setting up the path. If GO is already installed, and GOPATH is tampered, then ensure to set GOPATH appropriately.For unforeseen errors leading to unsuccessful installation, run the following command to cleanup any or all untracked tar files:
sudo git clean -xdf
Complete the following steps to set the required env variables while running in bare metal:
For updating the $LD_LIBRARY_PATH env variable:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/eii/lib export PATH=$PATH:/usr/local/go/bin export GOPATH=~/go
Note:
$LD_LIBRARY_PATH
should be appended by$CMAKE_INSTALL_PREFIX/lib
. In the above installation CMAKE_INSTALL_PREFIX is/opt/intel/eii
and hence LD_LIBRARY_PATH appended with /opt/intel/eii/libFor updating the $no_proxy env variable to connect to etcd:
export no_proxy=$no_proxy,127.0.0.1
Libs package generation¶
EII libraries (Message Bus, Config Manager and C Utils) are getting distributed as packages for easier integration with the applications built on top of EII stack, so users don’t have go through the pain of compiling these libraries from source or copying these built binaries from the EII base images.
The underlying C/C++ EII core libraries are distributed as deb, rpm and apk packages for ubuntu, fedora and alpine OS or docker images respectively. This package installation is a must as this is where the underlying logic lies.
The Python binding of these EII core libraries are distributed as wheel packages, we have 2 specific multi-linux packages:
Python3.8 compatible manylinux wheel package for Ubuntu
Python3.9 compatible manylinux wheel package for Fedora
Due to some challenges with underlying musl C library in alpine, we don’t have a compatible Python wheel package to work on alpine.
The golang binding of these EII core libraries are distributed as GitHub repos Config Manager Golang repo([WORK_DIR]/IEdgeInsights/common/libs/ConfigMgr/go
) and MessageBus Golang repo([WORK_DIR]/IEdgeInsights/common/libs/EIIMessageBus/go
) which gets referenced in the go.mod files of EII services.
For now, the core libraries distribution is exercised through the EII sample apps accessible at sample Apps([WORK_DIR]/IEdgeInsights/Samples
).
The script libs_package_generator.sh([WORK_DIR]/IEdgeInsights/common/libs_package_generator.sh
) when run natively on Ubuntu 20.04 OS system generates the required packages which can then be hosted to respective locations.
Run the following command to export the env variables if they are not set already.
set -a && source ../build/.env && set +a
Run the command below to generate the EII core libs and host it on a local HTTP server:
docker-compose up --build
Update the eii_no_proxy and PKG_SRC variables in .env file with system IP address to use these hosted packages locally. Ex: eii_no_proxy=localhost,127.0.0.1,.intel.com,10.106.xxx.xxx
PKG_SRC=http://10.106.xxx.xxx:80