Source dependencies
If your app requires dependencies, such as RPMs or Python libraries, you can add them in the src_deps sub directory of the app folder.
The src_deps directory can contain these optional sub directories:
pip
Use the pip folder to install extra Python libraries. For example, if your application requires the observable-0.01.00 Python library, add the observable-0.01.00.tar.gz file to the pip folder.
Don't use .tar files for Python libraries that include extra C-based extensions. Instead, add
libraries as Python wheel files (.whl
), which have C-based extensions
pre-compiled.
You must install Python wheel files on the same system architecture they were compiled upon. To
work with IBM®
QRadar® application
framework, wheel files must be compiled on Centos 6.7 x86_64. If it uses compatible architecture,
you can use the Python bdist_wheel command to create wheel files from a library's
source code on your own system. The command python setup.py sdist bdist_wheel
creates the wheel file when you run it from within the root directory of the Python library's source
folder.
A useful alternative to manually downloading Python packages for your app is the
pip2pi Python package. It requires pip and you can install
it on your development computer by using the pip install pip2pi
command. After you
install this package, you run the following command:
pip2tgz <target-directory> <Python package>
For example, the following command downloads the package's wheel, along with its dependencies, into the specified folder.
pip2tgz python_packages/pytest/ pytest==2.8.2
The pytest parameter is optional and you can use it to download specific versions of a package.
For Python libraries that have dependencies, you can include an optional ordering.txt file in the pip folder to specify the order in which Python libraries are installed. This text file must include the names of files that are in the /pip folder. File names must be separated with a new line (UNIX line endings) in the order that you want them installed.
rpms
Use the rpms folder to install extra Red Hat Enterprise Linus (RHEL) RPMs. The RPMs must be CentOs 6.7 x86_64 compatible.
For RPMs that have dependencies, you can include an optional ordering.txt file in the rpms folder to specify the order in which RPMs are installed. This text file must include the names of files that are in the rpms folder. File names must be separated with a new line (UNIX line endings) in the order you want them installed.
init
Add dependencies files that do not fit into the pip or rpms folders to the init folder. You must also include an ordering.txt file in the init folder. The lines in this text file (UNIX line endings) are run as shell commands during the installation of the app.
For example, you might want to install a collection of RPMs that has a complex dependency chain that is not explicitly known. In this use case, you add a .tar file that is called dependant_rpms.tar.gz to the init folder. You add the following commands to the ordering.txt file:
mkdir /src_deps/init/dependant_rpms
cd /src_deps/init
tar -xzvf dependant_rpms.tar.gz
yum -y localinstall --disablerepo=* dependant_rpms/*rpm
rm -rf dependant_rpms
--disablerepo=*
switch in this example is used to prevent the
yum from attempting to contact remote repositories on QRadar consoles that have
no internet access.This example uses yum's RPM auto-dependency resolution that installs a set of specified RPMs in the required order. If the RPMs are included in the rpms folder, you must specify the installation order.