CCI-MOC / lsvd-rbd

Log Structured Virtual Disk
GNU General Public License v2.0
8 stars 5 forks source link

Add RPC support and overhaul configuration system #41

Closed IsaacKhor closed 1 month ago

IsaacKhor commented 1 month ago

RPC support complete; I don't have time to document it, so if you want to add it that'll be great new docs at docs/configuration.md. Server can be run with the new binary lsvd_tgt. Usage:

$ export PYTHONPATH=path/to/directory/with/rpc_plugin.py
$ ./rpc.py --plugin rpc_plugin bdev_lsvd_create --help
usage: rpc.py [options] bdev_lsvd_create [-h] [-c CFG] pool_name name

positional arguments:
  pool_name          Name of the ceph pool
  name               Name of the lsvd disk image

options:
  -h, --help         show this help message and exit
  -c CFG, --cfg CFG  Path to config file OR inline JSON string

$ ./rpc.py --plugin rpc_plugin bdev_lsvd_delete --help
usage: rpc.py [options] bdev_lsvd_delete [-h] name

positional arguments:
  name        Name of the lsvd disk image

options:
  -h, --help  show this help message and exit

Also reading from config file is unimplemented so you can't actually use it yet, I'll add that in next. Implemented now but untested, so give it a spin first. Usage described in doc file and above.

@knikolla feel free to write unit tests for this, because this is actually isolated to just the config.cc file. I didn't have the time to do that.

IsaacKhor commented 1 month ago

Left TODO is debugging why spdk_json_decode_object is failing. Fixed.