Project

General

Profile

Feature #50321

Updated by Ernesto Puerta 2 months ago

Currently Dashboard contains hard-coded data structures of Cephadm internals (like Service Specs). This has led to some mismatches when Cephadm changes one of this internal specs. In order to avoid so, Service Specifications (and this might also be extended to other Cephadm internals) should be shared between Cephadm and Dashboard. As both components share code tree, the easiest way is to define abstract typed classes for Service Specs (if not yet) and import those from the Dashboard, where they would be inspected and the corresponding backend-frontend code would be generated dynamically.

This has already been done with other parts in Dashboard, like Cluster configuration, or Manager Modules (where the mgr_map is parsed to generate views of each mgr module OPTIONS).

It'll require that those classes are typed (python @typing@) and probably annotated with extra hints if they involve special validations (e.g.: max-min, etc).

As classes can be directly imported across projects, there's no need to explore schemas (like JSONSChema), which are only required from cross-language integrations (Python-Angular) or decoupled components (frontend/backend).

Back