]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
node-proxy: refactor entrypoint
authorGuillaume Abrioux <gabrioux@ibm.com>
Sun, 4 Feb 2024 19:11:41 +0000 (19:11 +0000)
committerGuillaume Abrioux <gabrioux@ibm.com>
Mon, 5 Feb 2024 09:26:46 +0000 (09:26 +0000)
commitebf05d5d6cf0532d321a668a4444d2069f995d4a
tree56eaf8c04815a0c5046c4f45e43851b049ec77ae
parenta3ec5d366b531ac17edd1b743eb48180db46bc9c
node-proxy: refactor entrypoint

This commit introduces a major refactor of the main
entrypoint.

- subclass threading.Thread:
  - Introduce a new class `BaseThread()` that is a
    `threading.Thread()` abstraction class in order
    to monitor the different threads.
  - `BaseSystem()` inherits from `BaseThread()`.
  - Handle `SIGTERM` signal in order to gracefully shutdown
    node-proxy (make threads exit gracefully, log out from RedFish API, etc.)

Additionally, this:
  - drops the class `Logger()` from util.py which
was not adding value. It is now replaced with a simple `get_logger()`
function.
  - changes the node-proxy API port from 8080 to 9456
    (8080 being widely used for frontend apps...)
  - changes the container entrypoint in order to use the
    `ceph-node-proxy` binary from the packaging

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
src/ceph-node-proxy/ceph_node_proxy/api.py
src/ceph-node-proxy/ceph_node_proxy/baseredfishsystem.py
src/ceph-node-proxy/ceph_node_proxy/basesystem.py
src/ceph-node-proxy/ceph_node_proxy/main.py
src/ceph-node-proxy/ceph_node_proxy/redfish_client.py
src/ceph-node-proxy/ceph_node_proxy/redfishdellsystem.py
src/ceph-node-proxy/ceph_node_proxy/reporter.py
src/ceph-node-proxy/ceph_node_proxy/util.py
src/cephadm/cephadmlib/daemons/node_proxy.py
src/pybind/mgr/cephadm/agent.py
src/pybind/mgr/cephadm/services/node_proxy.py