1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-01 06:21:41 +03:00
Files
mariadb-columnstore-engine/cmapi
Alan Mologorsky dec8350f0e MCOL-5594: Interactive "mcs cluster stop" command for CMAPI. (#3024)
* MCOL-5594: Interactive "mcs cluster stop" command for CMAPI.

[add] NodeProcessController class to handle Node operations
[add] two endpoints: stop_dmlproc (PUT) and is_process_running (GET)
[add] NodeProcessController.put_stop_dmlproc method to separately stop DMLProc on primary Node
[add] NodeProcessController.get_process_running method to check if specified process running or not
[add] build_url function to helpers.py. It needed to build urls with query_params
[add] MCSProcessManager.gracefully_stop_dmlproc method
[add] MCSProcessManager.is_service_running method as a top level wrapper to the same method in dispatcher
[fix] MCSProcessManager.stop by using new gracefully_stop_dmlproc
[add] interactive option and mode to mcs cluster stop command
[fix] requirements.txt with typer version to 0.9.0 where supports various of features including "Annotated"
[fix] requirements.txt click version (8.1.3 -> 8.1.7) and typing-extensions (4.3.0 -> 4.8.0). This is dependencies for typer package.
[fix] multiple minor formatting, docstrings and comments

* MCOL-5594: Add new CMAPI transaction manager.

- [add] TransactionManager ContextDecorator to manage transactions in less code and in one place
- [add] TransactionManager to cli cluster stop command and to API cluster shutdown command
- [fix] id -> txn_id in ClusterHandler class
- [fix] ClusterHandler.shutdown class to use inside existing transaction
- [add] docstrings in multiple places

* MCOL-5594: Review fixes.
2024-02-23 21:40:50 +03:00
..

CMAPI REST server

Build Status

Overview

This RESTfull server enables multi-node setups for MCS.

Requirements

See requirements.txt file.

All the Python packages prerequisits are shipped with a pre-built Python enterpreter.

Usage

To run the server using defaults call:

python3 -m cmapi_server

There is a configuration server inside cmapi_server.

Testing

To launch the integration and unit tests use unittest discovery mode.

python3 -m unittest discover -v mcs_node_control
python3 -m unittest discover -v cmapi_server
python3 -m unittest discover -v failover

mcs_control_node unit tests ask for root privileges and additional systemd unit to run smoothly.

Build packages

Packages have bundled python interpreter and python dependencies.

Get dependencies

get portable python

wget -qO- https://cspkg.s3.amazonaws.com/python-dist-no-nis.tar.gz | tar xzf - -C ./

install python dependencies

python/bin/pip3 install -t deps --only-binary :all -r requirements.txt

RPM

./cleanup.sh
yum install -y wget cmake make rpm-build
cmake -DRPM=1 .
make package

DEB

./cleanup.sh
DEBIAN_FRONTEND=noninteractive apt update && apt install -y cmake make
cmake -DDEB=1 .
make package