Installing QAnswer on premise
Introduction
If you are interested to install QAnswer on premise you need to reach us at info@the-qa-company.com to get a license key and the various access to be able to follow this guide.
Architecture of the application
Here is a diagram explaining the overall architecture of the qanswer application
QAnswer contains the following software components:
- a React3 front-end web-app to allow access and interact with APIs via an intuitive user interface;
- a Spring Boot Java back-end4. This application is serving and securing all APIs;
- a fast API python back-end5 that is responsible for the machine learning functionalities;
- a fast API python back-end that is serving a language model;
- an ElasticSearch instance6;
- a Redis7 server for caching;
- a Selenium8 server to scrape websites;
- a transcription server for speech to text;
- a Postgres9 database that stores user information.
Requirements
To run QAnswer you need:
- a linux distribution (we use Ubuntu by default)
- A GPU with at least 48GB of memory (we recommend NVIDIA® L40S)
- Docker
(this will allow you to serve 7 to 13 concurrent users depening on RAG or Chat workload, you can contact us at info@the-qa-company.com if you need help sizing your infrastructure)
Install Nvidia Drivers
- Download and install the CUDA drivers from the NVIDIA website. If you are using a Ubuntu distribution you can use the following command to install the drivers
sudo ubuntu-drivers install --gpgpu
Install Docker
You need to install Docker on your machine. You can follow the official documentation to install it on your machine.
Then you need to install the nvidia container runtime by following the official documentation
After that you need to restart docker by running the following command
sudo service docker restart
Install QAnswer
QAnswer is provided as a docker-compose file. You can clone the repository by running the following command
git clone https://gitlab.the-qa-company.com/qanswer-app/bundle.git
The first thing you have to do is from template.env
create a .env
file with the secret of your installation.
In this file you have to fill the following field:
Configuration overview
System details
The credential used to get the images of QAnswer (supplied by us)
Property | Value |
---|---|
USER | The username to access the registry |
PASSWORD | The password to access the registry |
Application details
Property | Value |
---|---|
QA_KEY | The license Key to activate the application we provide |
QA_PUBLIC_UI_URL | The URL of the frontend |
QA_PUBLIC_URL | The URL of the backend for http/https |
QA_PUBLIC_WSURL | The URL of the backend for websocket |
QA_ADMIN_USERNAME | The username for the admin account |
QA_ADMIN_EMAIL | The email for the admin account |
QA_ADMIN_PASSWORD | the password for the admin account |
SPRING_DATASOURCE_PASSWORD | The password of the database |
APP_JWTSECRET | A JWT secret token |
CHECK_MALWARE | True to enable Malware detection else False |
Malware detection
Malware detection in ClamAV (Clam AntiVirus) refers to the process of identifying malicious software on systems using a signature-based and heuristic scanning engine. ClamAV is an open-source antivirus engine widely used for email scanning, web scanning, and endpoint security. It detects malware by comparing files against a database of known virus signatures—unique patterns associated with specific types of malware. This signature database is regularly updated to cover new threats. ClamAV also incorporates heuristic detection, which involves analyzing files for suspicious behaviors that may indicate a previously unknown threat. Through these mechanisms, ClamAV can identify and quarantine or remove various types of malware, including viruses, trojans, and ransomware.
If this service is enabled and a file is marked as malware by ClamAV, the file upload is skipped.
To enable malware detection add --profile malwareDetection
to the docker compose.
Contact Email
The email that people will be encourage to contact in case there is a problem
Property | Value |
---|---|
CONTACT_MAIL | The email of the contact |
Run QAnswer
Then after filling everything you have to run to generate the configuration of QAnswer
./generate-config.sh
After that, pull all the image of QAnswer by running the following command
./init.sh
Then you can run finally the following command to have QAnswer running
docker compose up -d
If you want to enable malware detection add --profile malwareDetection
docker compose --profile malwareDetection up -d
After enabling the malwareDetection
profile you have to add the env variable CHECK_MALWARE
to the env file to start using the service.