]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
node-proxy: refactor entrypoint 55454/head
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 14:23:35 +0000 (15:23 +0100)
commit55325e65b0939e68c1c31da851015f070930c637
tree22d5c1f61cf3c9f4ee8c39cee0b259dd469e08c3
parent34eb38d1739c5bfa27dd976ecf1816892e4564a3
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>
(cherry picked from commit ebf05d5d6cf0532d321a668a4444d2069f995d4a)
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/cephadm.py
src/pybind/mgr/cephadm/agent.py
src/pybind/mgr/cephadm/services/node_proxy.py