Installation

For proper installation you need to clone project from git.

Surroundings

The service can be installed on Windows 10 and CentOS 7 (not tested on other system versions).

Required predefined dependencies:

  • Python 3.11 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_tasks/configs/config.conf”.

Database creation

All databases for service must be created in accordance with “./luna_tasks/configs/config.conf”.

  • Postgresql (require version 9.6 or higher)

  • Oracle (require version Oracle Database Express Edition 11g or higher)

Create all required schemes 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_tasks”):

psql -U postgres;
create role luna;
ALTER USER luna WITH PASSWORD 'luna';
CREATE DATABASE luna_tasks;
GRANT ALL PRIVILEGES ON DATABASE luna_tasks TO luna;
ALTER ROLE luna WITH LOGIN;

Then launch db_create.py script for tables and primal data creation:

python ./base_scripts/db_create.py

If script was executed without errors, all schemes were created successfully.

  • Luna-Image-Store

For Luna-Image-Store usage you should create bucket from config.conf. To do this, launch lis_bucket_create.py script (note that this script doesn’t check if bucket already exists or not):

python ./base_scripts/lis_bucket_create.py

First launch and testing

If all previous actions are executed successfully, server is ready to work. To start server please launch run.py script. By default 5050 port is used. Also it possible to run service with config from luna-configurator (see configurator).

Example running “tasks_worker” service:

python ./run.py --port=5051 --config=./configs/myconfig.conf --service-type=tasks_worker

At startup, you can add arguments (server message port):

python ./run.py --port=5050 --config=./configs/myconfig.conf

After server is started, testing is recommended. To perform testing execute command

python -m unittest tests.unittests_main

All tests should perform successfully.