Service launch

If all previous actions are executed successfully and all the required services are launched, LUNA Licenses is ready to work.

Launch service using configuration file

The service is launched using the run.py script.

The example of service launch from the service directory is given below:

  • Go to the service directory

cd ./luna-licenses/luna_licenses/
  • Activate the virtual environment by the command:

The virtual environment for the Licenses service must be activated before the script launch if you created virtual environment during installation.

source ./venv/bin/activate
  • Run the service:

The example shows launching of the service on the default port with the default configuration file.

python run.py --port=5120

The example shows launching of the service on a different port and using a custom configuration file.

python run.py --port=5121 --config=./configs/myconfig.conf --log_suffix=test

Examples description:

  • The service is launched on port 5121;

  • Custom configuration file “myconfig.conf” is set using the relative path to the service directory. If there is no “–config” argument specified, the default configuration file “./luna-licenses/luna_licenses/configs/config.conf” is used;

  • The output will be written to the log files with the “test” suffix.

Launch service using Configurator

It is possible to run service with the config received from the Configurator service.

To use the Configurator service for service launching, do not pass config param to run service, use “luna-config” instead of it.

To specify the Configurator service address and port, use the following command:

python run.py --luna-config http://127.0.0.1:5070/1

Where http://127.0.0.1:5071 is the available Configurator service address and 1 is the Configurator API version. By default the Configurator service is launched on the 5070 port.

If one does not pass –luna-config command-line argument, it can be specified in the [LUNA_CONFIGURATOR] section of a config file. While the value of USE_CONFIGURATOR is set to “0”, the settings from the configuration file are used. Otherwise, the settings from the Configurator service are used.

Set non-default setting in Configurator

It is possible to specify a tag for every setting to get the non-default setting. (see the LUNA Configurator documentation for more information).

Example:

python run.py --INFLUX_MONITORING TAG_1

Where INFLUX_MONITORING is the setting name and TAG_1 is the desired tag for this setting.

Command line arguments

You can view help to find out more about command-line arguments using the following command:

python run.py --help

or

python run.py -h