Project

General

Profile

Feature #50321

Feature #50320: mgr/dashboard: Lean Dashboard

mgr/dashboard: cephadm service spec schemas

Added by Ernesto Puerta about 1 month ago. Updated about 1 month ago.

Status:
New
Priority:
High
Assignee:
-
Category:
Orchestrator
Target version:
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:
Tags:

Description

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).

History

#1 Updated by Ernesto Puerta about 1 month ago

  • Description updated (diff)

Also available in: Atom PDF