diff --git a/score/health_monitor/docs/architecture/component_architecture.rst b/score/health_monitor/docs/architecture/component_architecture.rst new file mode 100644 index 0000000000..55f6267300 --- /dev/null +++ b/score/health_monitor/docs/architecture/component_architecture.rst @@ -0,0 +1,251 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_architecture_hm: + +Component Architecture +====================== + +.. document:: HealthMonitor Architecture + :id: doc__health_monitor_architecture + :status: draft + :version: 1 + :safety: ASIL_B + :security: NO + :realizes: wp__component_arch[version==1] + +.. attention:: + The above directive must be updated according to your needs. + + - Modify ``Your Component Name`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` and followed by ``_architecture`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Overview +-------- + +Document describes HealthMonitor component architecture. + +.. comp:: Health Monitor + :id: comp__health_monitor + :security: YES + :safety: ASIL_B + :status: valid + :version: 1 + :belongs_to: feat__lifecycle[version==1] + :implements: logic_arc_int__lifecycle__deadline_monitor_if[version==1], logic_arc_int__lifecycle__logical_monitor_if[version==1] + :uses: logic_arc_int__lifecycle__alive_if[version==1] + + Health Monitor component provides a set of functionalities to verify the health of the system and its components. It includes monitoring deadlines, logic, and heartbeats to ensure proper system functioning. + +Description +----------- + +This component provides a set of functionalities to manage the lifecycle of programs running on the S-CORE platform. + +Requirements Linked to Component Architecture +--------------------------------------------- + +TODO + +Rationale Behind Architecture Decomposition +******************************************* + +Architecture is not decomposed. + +Static Architecture +------------------- + +.. comp_arc_sta:: Health Monitor Static View + :id: comp_arc_sta__health_mon__hm + :status: valid + :version: 1 + :safety: ASIL_B + :security: NO + :uses: logic_arc_int__lifecycle__alive_if[version==1] + :belongs_to: comp__health_monitor[version==1] + :fulfils: comp_req__health_monitor__dummy + + .. needarch:: + :scale: 50 + :align: center + + {{ draw_component(need(), needs) }} + +.. comp_arc_sta:: Deadline Monitor + :id: comp_arc_sta__deadline_monitor__static_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :implements: + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + :includes: + + .. uml:: assets/dm_static_architecture.puml + +.. comp_arc_sta:: Logic Monitor + :id: comp_arc_sta__logic_monitor__static_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :implements: + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + :includes: + + .. uml:: assets/lm_static_architecture.puml + +.. comp_arc_sta:: Health Monitor + :id: comp_arc_sta__health_monitor__static_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :implements: + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + :includes: + + .. uml:: assets/hm_static_architecture.puml + +Dynamic Architecture +-------------------- + +.. comp_arc_dyn:: HealthMonitor Creation + :id: comp_arc_dyn__health_monitor__dynamic_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + + .. uml:: assets/hm_creation.puml + +.. comp_arc_dyn:: HealthMonitor background thread + :id: comp_arc_dyn__health_lib_thread__dynamic_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + + .. uml:: assets/hm_background_thread.puml + +.. comp_arc_dyn:: DeadlineMonitor Usage + :id: comp_arc_dyn__deadline_monitor__dynamic_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + + .. uml:: assets/dm_usage.puml + +.. comp_arc_dyn:: LogicMonitor Usage + :id: comp_arc_dyn__logic_monitor__dynamic_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + + .. uml:: assets/lm_usage.puml + +.. comp_arc_dyn:: HeartbeatMonitor Usage + :id: comp_arc_dyn__heartbeat_monitor__dynamic_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + + .. uml:: assets/hbm_usage.puml + +.. comp_arc_dyn:: Health Monitoring Startup Interaction + :id: comp_arc_dyn__health_monitor__startup_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + + .. uml:: assets/hm_startup.puml + +.. comp_arc_dyn:: Health Monitoring Shutdown Interaction + :id: comp_arc_dyn__health_monitor__shutdown_view + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :belongs_to: comp__health_monitor[version==1] + + .. uml:: assets/hm_shutdown.puml + +Interfaces +---------- + +.. real_arc_int:: DeadlineMonitor Interface + :id: real_arc_int__deadline_monitor__interface + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :language: rust + + .. uml:: assets/dmb_interface.puml + +.. real_arc_int:: LogicMonitor Interface + :id: real_arc_int__logic_monitor__interface + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :language: rust + + .. uml:: assets/lmb_interface.puml + +.. real_arc_int:: HeartbeatMonitor Interface + :id: real_arc_int__heartbeat_monitor__interface + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :language: rust + + .. uml:: assets/hbm_interface.puml + +.. real_arc_int:: HealthMonitor Interface + :id: real_arc_int__health_monitor__interface + :security: NO + :safety: ASIL_B + :status: valid + :version: 1 + :fulfils: comp_req__health_monitor__dummy + :language: rust + + .. uml:: assets/hmb_interface.puml diff --git a/score/health_monitor/docs/architecture/index.rst b/score/health_monitor/docs/architecture/index.rst index 55f6267300..a600a4b6ce 100644 --- a/score/health_monitor/docs/architecture/index.rst +++ b/score/health_monitor/docs/architecture/index.rst @@ -1,6 +1,6 @@ .. # ******************************************************************************* - # Copyright (c) 2025 Contributors to the Eclipse Foundation + # Copyright (c) 2026 Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -12,240 +12,10 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -.. _component_architecture_hm: - Component Architecture ====================== -.. document:: HealthMonitor Architecture - :id: doc__health_monitor_architecture - :status: draft - :version: 1 - :safety: ASIL_B - :security: NO - :realizes: wp__component_arch[version==1] - -.. attention:: - The above directive must be updated according to your needs. - - - Modify ``Your Component Name`` to be your Component Name - - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` and followed by ``_architecture`` - - Adjust ``status`` to be ``valid`` - - Adjust ``safety`` and ``tags`` according to your needs - -Overview --------- - -Document describes HealthMonitor component architecture. - -.. comp:: Health Monitor - :id: comp__health_monitor - :security: YES - :safety: ASIL_B - :status: valid - :version: 1 - :belongs_to: feat__lifecycle[version==1] - :implements: logic_arc_int__lifecycle__deadline_monitor_if[version==1], logic_arc_int__lifecycle__logical_monitor_if[version==1] - :uses: logic_arc_int__lifecycle__alive_if[version==1] - - Health Monitor component provides a set of functionalities to verify the health of the system and its components. It includes monitoring deadlines, logic, and heartbeats to ensure proper system functioning. - -Description ------------ - -This component provides a set of functionalities to manage the lifecycle of programs running on the S-CORE platform. - -Requirements Linked to Component Architecture ---------------------------------------------- - -TODO - -Rationale Behind Architecture Decomposition -******************************************* - -Architecture is not decomposed. - -Static Architecture -------------------- - -.. comp_arc_sta:: Health Monitor Static View - :id: comp_arc_sta__health_mon__hm - :status: valid - :version: 1 - :safety: ASIL_B - :security: NO - :uses: logic_arc_int__lifecycle__alive_if[version==1] - :belongs_to: comp__health_monitor[version==1] - :fulfils: comp_req__health_monitor__dummy - - .. needarch:: - :scale: 50 - :align: center - - {{ draw_component(need(), needs) }} - -.. comp_arc_sta:: Deadline Monitor - :id: comp_arc_sta__deadline_monitor__static_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :implements: - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - :includes: - - .. uml:: assets/dm_static_architecture.puml - -.. comp_arc_sta:: Logic Monitor - :id: comp_arc_sta__logic_monitor__static_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :implements: - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - :includes: - - .. uml:: assets/lm_static_architecture.puml - -.. comp_arc_sta:: Health Monitor - :id: comp_arc_sta__health_monitor__static_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :implements: - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - :includes: - - .. uml:: assets/hm_static_architecture.puml - -Dynamic Architecture --------------------- - -.. comp_arc_dyn:: HealthMonitor Creation - :id: comp_arc_dyn__health_monitor__dynamic_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - - .. uml:: assets/hm_creation.puml - -.. comp_arc_dyn:: HealthMonitor background thread - :id: comp_arc_dyn__health_lib_thread__dynamic_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - - .. uml:: assets/hm_background_thread.puml - -.. comp_arc_dyn:: DeadlineMonitor Usage - :id: comp_arc_dyn__deadline_monitor__dynamic_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - - .. uml:: assets/dm_usage.puml - -.. comp_arc_dyn:: LogicMonitor Usage - :id: comp_arc_dyn__logic_monitor__dynamic_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - - .. uml:: assets/lm_usage.puml - -.. comp_arc_dyn:: HeartbeatMonitor Usage - :id: comp_arc_dyn__heartbeat_monitor__dynamic_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - - .. uml:: assets/hbm_usage.puml - -.. comp_arc_dyn:: Health Monitoring Startup Interaction - :id: comp_arc_dyn__health_monitor__startup_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - - .. uml:: assets/hm_startup.puml - -.. comp_arc_dyn:: Health Monitoring Shutdown Interaction - :id: comp_arc_dyn__health_monitor__shutdown_view - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :belongs_to: comp__health_monitor[version==1] - - .. uml:: assets/hm_shutdown.puml - -Interfaces ----------- - -.. real_arc_int:: DeadlineMonitor Interface - :id: real_arc_int__deadline_monitor__interface - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :language: rust - - .. uml:: assets/dmb_interface.puml - -.. real_arc_int:: LogicMonitor Interface - :id: real_arc_int__logic_monitor__interface - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :language: rust - - .. uml:: assets/lmb_interface.puml - -.. real_arc_int:: HeartbeatMonitor Interface - :id: real_arc_int__heartbeat_monitor__interface - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :language: rust - - .. uml:: assets/hbm_interface.puml - -.. real_arc_int:: HealthMonitor Interface - :id: real_arc_int__health_monitor__interface - :security: NO - :safety: ASIL_B - :status: valid - :version: 1 - :fulfils: comp_req__health_monitor__dummy - :language: rust +.. toctree:: - .. uml:: assets/hmb_interface.puml + component_architecture + chklst_arc_inspection diff --git a/score/health_monitor/docs/detailed_design/detailed_design.rst b/score/health_monitor/docs/detailed_design/detailed_design.rst new file mode 100644 index 0000000000..5d8b5e4923 --- /dev/null +++ b/score/health_monitor/docs/detailed_design/detailed_design.rst @@ -0,0 +1,101 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 Contributors to the Eclipse Foundation + # + # See the NOTICE file(s) distributed with this work for additional + # information regarding copyright ownership. + # + # This program and the accompanying materials are made available under the + # terms of the Apache License Version 2.0 which is available at + # https://www.apache.org/licenses/LICENSE-2.0 + # + # SPDX-License-Identifier: Apache-2.0 + # ******************************************************************************* + +.. _component_detailed_design_hm: + +Detailed Design +############### + +.. document:: HealthMonitor Detailed Design + :id: doc__health_monitor_detailed_design + :status: draft + :version: 1 + :safety: ASIL_B + :security: NO + :realizes: wp__sw_implementation[version==1] + :tags: template + +.. attention:: + The above directive must be updated according to your Component. + + - Modify ``Your Component Name`` to be your Component Name + - Modify ``id`` to be your Component Name in upper snake case preceded by ``doc__`` and followed by ``_detailed_design`` + - Adjust ``status`` to be ``valid`` + - Adjust ``safety`` and ``tags`` according to your needs + +Detailed Design for Component: HealthMonitor +=============================================== + +Description +----------- + +HealthMonitor component consists of these units: + +- `deadline_monitor` +- `logic_monitor` +- `health_monitor` + +| Design Decisions - For the documentation of the decision the :need:`gd_temp__change_decision_record` can be used. +| Design Constraints + + +Implementation structure +------------------------ + +.. code-block:: bash + + src + └── health_monitoring_lib + ├── cpp # C++ API using Rust FFI + │ ├── include # C++ public header files. + │ │ └── ... + │ └── tests + └── rust # Rust implementation + FFI for C++ + └── deadline + +Implementation approach for multi language +******************************************* + +The implementation is done primarily in `Rust` language to leverage its memory safety features and concurrency model. +Due to a need to interface with existing C++ codebases, a C-compatible Foreign Function Interface (FFI) is provided by this `Rust` implementation. +`C++` API is designed to be idiomatic wrapping around the `Rust` FFI, ensuring ease of use for C++ developers while maintaining the safe usage. + +Rationale Behind Decomposition into Units +****************************************** + +| mandatory: a motivation for the decomposition into one or more units. + +.. note:: Reason for split into multiple units could be- + - Based on design principles like SOLID,DRY etc + - Based on design pattern's etc. + +Static Diagrams for Unit Interactions +------------------------------------- + +.. uml:: assets/static_diagram.puml + +Dynamic Diagrams for Unit Interactions +-------------------------------------- +.. code-block:: rst + + .. dd_dyn::