Installation and Setup
Last updated
Last updated
This section shows you how to run the service from the command line, which is useful for testing. It also shows you how to run it as a service, which is best suited to a production environment.
The AI Enrichment Service should be found in the InsightMaker.Python folder that you created in the prerequisites step.
Activate your virtual environment by navigating to the AIEnrichmentService/venv/Scripts folder and running: activate.bat
You should now see (venv) at the start of your command line.
On the command line navigate back to InsightMaker.Python\AIEnrichmentService
Use ‘pip’ to install all the requirements in the latest requirements file:
Online: pip install -r requirements_3.12.8.txt
Offline: From an internet connected machine:
Create a temporary folder.
Navigate to the temporary folder.
Run pip download -r requirements_3.12.8.txt
Copy the resulting contents of the temporary folder to the target server.
Run the following on the target server, replacing the path to the temporary folder as appropriate.
pip install --no-index --find-links C:/tmp/libs -r requirements_3.12.8.txt
Run pip install AiimiInsightEngine-0.4.2-py3-none-any.whl
This will install the Aiimi Insight Engine library.
If you have a GPU ad you plan to use that to accelerate steps such as vectorisation:
Uninstall torch with
pip uninstall torch
Reinstall torch using the pip command generated by this link: https://pytorch.org/get-started/locally/
For example:
pip install torch --index-url https://download.pytorch.org/whl/cu118
Edit run.bat in the root of ‘InsightMaker.Python\AIEnrichmentService’ to point at the correct location for your virtual environment.
Edit the main configuration to the service can register itself:
Open the following in an editor config/config.json
Edit the following fields:
Scheme should remain http, unless you plan to proxy requests through a HTTPS reverse proxy (IIS ARR for example) - in his case see the using SSL section.
Address should be the IP address or host name of the server (do not use localhost).
Port should not need changing.
Threads, maxRequestHeaderSize, and maxRequestBodySize should not need changing at this stage.
System secret should contain the AIE system secret.
if your secrets are encrypted, set skipSecretDecrypt to false.
Skip System Decrypt: If skipSecretDecrypt is false
the systemSecret parameter will be treated as encrypted.
Key Vault: If an Azure KeyVault URL is added system secret and certificate configurations will be treated as Keyvault secret/certificate names. Python will attempt to read them using Azure Default Authentication.
Admin API should point at the Admin API URL.
caCerts & caPassword: These are the parameters for a certificate authority.
They are only used to authenticate the connection to Content Agent for thumbnail vectorisation (HFVisionTransformer enrichment step).
These are optional parameters where required.
Trusted IPs should contain the IP Address of all of your enrichment agents.
Now you can start the service by running run.bat
.
Note that the first time the service starts no enrichment steps will actually load, as they are disabled by default. In the next section we enable the steps that we want to use.
For Windows - Visual Studio runtime must be installed.
Other Operating Systems - Check requirements