Installation¶
For proper installation one need to clone project from git.
Surroundings¶
The service can be installed on Windows 10 and CentOS 8 (not tested on other system versions).
Required predefined dependencies:
Python of version 3.12 is required.
It is strongly recommended to create virtual surroundings for python dependencies installation.
Python setuptools module can be installed via pip (pip install setuptools).
Dependencies installation¶
After surroundings installation launch pip install with “-r requirements.txt” parameter.
pip install -r requirements.txt
Configuration¶
After dependencies installation configuration file should be set. File is placed in “./luna_configurator/configs/config.conf”. Also another configuration file can be used: just pass it with -\-config=./luna_configurator/configs/dev_config.conf.
Database creation¶
Database for the service must be created in accordance with “./luna_configurator/configs/config.conf”.
Postgresql (require version 9.6 or higher)
Create all required schemas in postgresql. If database or user is not created yet, one should execute the following commands with “user name” and “database” from the config file (for example, config.conf with “luna” and “luna_configurator”):
psql -U postgres;
create role luna;
ALTER USER luna WITH PASSWORD 'luna';
CREATE DATABASE luna_configurator;
GRANT ALL PRIVILEGES ON DATABASE luna_configurator TO luna;
ALTER ROLE luna WITH LOGIN;
Then launch db_create.py script for tables:
python base_scripts/db_create.py --config=./luna_configurator/configs/config.conf
One can call the following for more information:
python base_scripts/db_create.py --help
If script was executed without errors, all schemes were created successfully.
Customising database creation:
to recreate database, use the -\-recreate-database command line argument;
to create dumped settings and limitations from the provided file, set -\-dump-file command line argument (limitations from the listed limitation files are replaced with limitations from dump-file, if names of the limitations are same):
python base_scripts/db_create.py --dump-file dump_settings.json
First launch and testing¶
If all previous actions are executed successfully, server is ready to work. To start server please launch run.py script. While start one can add arguments: server message port and not default config for a service. By default 5070 port is used. Example:
python run.py --port=5070 --config=./configs/config.conf
After server is started, testing is recommended. To perform testing execute command
python -m unittest tests.unittests_main
All tests should perform successfully.