Table of Contents |
---|
Deployment
...
Python is generally not a compiled language, however we wish to create a portable binary file for use on our Linux servers. To accomplish this, we use the tool pyinstaller.
Compile the iktool as follows:Required only at the first time the virtual env is created
Create a directory for your virtual environment
Create a virtual environment and activate it (only need to create it the first time you compile)
virtualenv -p python3 ~/virtualenv/iktool
Activate the virtual environment
source ~/virtualenv/iktool/bin/activate
Install the dependencies from
requirements.txt
inpip3 install -r ~/<your_path>/indeni-knowledge/scripts/iktool.deploy
as followspip3 install -r /requirements.txt
(again, only necessary the first time you compile)Install pyinstaller with the command
pip3 install pyinstaller
(Only necessary on first compilation)Compile the iktool with the command pyinstallerdeactivate
iktool compilation
source ~/virtualenv/iktool/bin/activate
Compile
pyinstaller ~/indeni-knowledge/scripts/iktool.deploy/iktool.py -F
This will create a single executable file stored in the folderdist/
Run this binary, if Compiled file is located in/Users/<username>/dist/iktool
Run iktool --help.
If the usage is printed, the compilation was successful.
...
Examples
Config file (for running workflow/block on real device)
...