diff --git a/BUILD b/BUILD index aff49b6b..02610d71 100644 --- a/BUILD +++ b/BUILD @@ -15,6 +15,16 @@ load("@rules_rust//rust:defs.bzl", "rust_clippy") load("@score_docs_as_code//:docs.bzl", "docs") load("@score_tooling//:defs.bzl", "cli_helper", "copyright_checker", "dash_license_checker", "setup_starpls", "use_format_targets") load("//:project_config.bzl", "PROJECT_CONFIG") +load("@score_tooling//bazel/rules/score_module:score_module.bzl", + "sphinx_module", + "architectural_design", + "assumptions_of_use", + "component_requirements", + "dependability_analysis", + "feature_requirements", + "safety_analysis", + "score_component") + # Creates all documentation targets: # - `:docs` for building documentation at build-time @@ -26,6 +36,81 @@ docs( source_dir = "docs", ) +sphinx_module( + name = "persistency_module_doc", + srcs = glob( + [ + "docs/**/*.rst", + "docs/**/*.puml", + ], + allow_empty = True, + ), + index = "docs/index.rst", + visibility = ["//visibility:public"], + deps = [ + "@score_process//:score_process_module", + "@score_platform//:score_platform_module", + ], +) + +# ============================================================================ +# KVS Component Artifacts +# ============================================================================ + +assumptions_of_use( + name = "kvs_assumptions_of_use", + srcs = ["docs/persistency/docs/manual/safety_manual.rst"], +) + +component_requirements( + name = "kvs_component_requirements", + srcs = ["docs/persistency/kvs/docs/requirements/requirements.rst"], +) + +architectural_design( + name = "kvs_architectural_design", + static = ["docs/persistency/kvs/docs/architecture/static_architecture.rst"] + glob(["docs/persistency/kvs/docs/architecture/_assets/*.puml"]), + dynamic = ["docs/persistency/kvs/docs/architecture/dynamic_architecture.rst"], +) + +safety_analysis( + name = "kvs_safety_analysis", + failuremodes = ["docs/persistency/kvs/docs/safety_analysis/fmea.rst"], +) + +dependability_analysis( + name = "kvs_dependability_analysis", + safety_analysis = [":kvs_safety_analysis"], + dfa = ["docs/persistency/kvs/docs/safety_analysis/dfa.rst"], + fmea = ["docs/persistency/kvs/docs/safety_analysis/fmea.rst"], + arch_design = ":kvs_architectural_design", +) + +# ============================================================================ +# KVS Score Component (SEooC) +# ============================================================================ + +score_component( + name = "persistency_kvs", + description = """ +The Key-Value Store (KVS) component provides persistent storage capabilities +for safety-critical applications. It offers a simple interface for storing +and retrieving key-value pairs with support for data integrity, versioning, +and fail-safe operations. +""", + assumptions_of_use = [":kvs_assumptions_of_use"], + component_requirements = [":kvs_component_requirements"], + architectural_design = [":kvs_architectural_design"], + dependability_analysis = [":kvs_dependability_analysis"], + sphinx = "@score_tooling//bazel/rules/score_module:score_build", + visibility = ["//visibility:public"], + deps = [ + "@score_process//:score_process_module", + "@score_platform//:score_platform_module", + ], +) + + setup_starpls( name = "starpls_server", visibility = ["//visibility:public"], diff --git a/MODULE.bazel b/MODULE.bazel index 8c70910b..bb743b5c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -95,14 +95,18 @@ bazel_dep(name = "score_process", version = "1.3.2") bazel_dep(name = "score_python_basics", version = "0.3.4") bazel_dep(name = "score_tooling", version = "1.0.3") -# ToDo: remove this once 1.0.4 is released, -# since it will contain updated cr_checker git_override( module_name = "score_tooling", - commit = "654664dae7df2700fd5840c5ed6c07ac6c61705d", #until 1.0.4 is released + commit = "b5b182dd9c1ed72b3f70939a72488d135645e5b5", remote = "https://github.com/eclipse-score/tooling.git", ) +git_override( + module_name = "score_docs_as_code", + commit = "5af3382025784130f91fed0767091997073911ca", + remote = "https://github.com/eclipse-score/docs-as-code.git", +) + # ToDo: implicit dependencies for score_tooling, but needed directly here?? bazel_dep(name = "aspect_rules_lint", version = "1.10.2") bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2") diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_builder.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_builder.puml new file mode 100644 index 00000000..a1b25fe4 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_builder.puml @@ -0,0 +1,25 @@ +@startuml + +title Sequence Diagram: Build KVS Instance + +participant "User" as actor +participant "«component» :kvs" as kvs + +actor -> kvs: Create KVS builder +kvs --> actor: KVS builder instance + +actor -> kvs: Set need_defaults flag +kvs --> actor: KVS builder instance + +actor -> kvs: Set need_kvs flag +kvs --> actor: KVS builder instance + +actor -> kvs: Build KVS instance + +alt kvs-builder-success + kvs --> actor: KVS instance with builder config +else kvs-builder-error + kvs --> actor: KVS ErrorCode +end + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_check_value_default.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_check_value_default.puml new file mode 100644 index 00000000..01baa272 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_check_value_default.puml @@ -0,0 +1,24 @@ +@startuml + +title Sequence Diagram: Check if Key contains Default Value + +participant "User" as actor +participant "«component» :kvs" as kvs + +actor -> kvs: Does key have default value + +alt default-key-exists + alt key-exists + alt default-and-key-match + kvs --> actor: Key contains default value + else key-doesnt-exist + kvs --> actor: Key doesn't containt default value + end + else key-doesnt-exist + kvs --> actor: Key contains default value + end +else default-doesnt-exist + kvs --> actor: Key doesn't contain default value +end + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_delete_data_key.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_delete_data_key.puml new file mode 100644 index 00000000..e2b222e3 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_delete_data_key.puml @@ -0,0 +1,16 @@ +@startuml + +title Sequence Diagram: Delete Key from KVS Instance + +participant "User" as actor +participant "«component» :kvs" as kvs + +actor -> kvs: Remove key + +alt key-exists + kvs --> actor: Successfully deleted key +else key-doesnt-exist + kvs --> actor: Key-Not-Found-Error +end + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_flush_local_repr_to_file.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_flush_local_repr_to_file.puml new file mode 100644 index 00000000..947cf782 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_flush_local_repr_to_file.puml @@ -0,0 +1,56 @@ +@startuml + +title Sequence Diagram: Flush Local Representation to Data File + +participant "User" as actor +participant "«component» :kvs" as kvs +participant "«component» :json" as json_parser +participant "«component» :fs" as fs + +actor -> kvs: Flush KVS + +kvs -> json_parser: Generate string from local representation + +alt json-string + json_parser --> kvs: JSON data string +else json-string-error + json_parser --> kvs: JSON generator error + kvs --> actor: JSON generator error +end + +kvs -> kvs: Rotate snapshots + +alt snapshot-rotate-success + kvs --> kvs: Snapshots rotated +else snapshot-rotate-error + kvs --> actor: Snapshot-Rotate-Error +end + +kvs -> kvs: Create JSON data hash + +alt hash-created-success + kvs -> kvs: Data hash +else hash-create-error + kvs --> actor: Hash-Calc-Error +end + +kvs -> fs: Write JSON data string to file + +alt file-write + fs --> kvs: File successfully written +else file-write-error + fs --> kvs: File-Write-Error + kvs --> actor: File-Write-Error +end + +kvs -> fs: Write JSON data hash to file + +alt file-hash-write + fs --> kvs: Hash file successfully written + kvs --> actor: Flush successful +else file-hash-write-error + fs --> kvs: File-Hash-Write-Error + kvs --> actor: File-Hash-Write-Error +end + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_read_data_key.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_read_data_key.puml new file mode 100644 index 00000000..064e2489 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_read_data_key.puml @@ -0,0 +1,20 @@ +@startuml + +title Sequence Diagram: Read Key from KVS Instance + +participant "User" as actor +participant "«component» :kvs" as kvs + +actor -> kvs: Get value for key + +alt key-exists + kvs --> actor: Return value for key +else key-doesnt-exist + alt default-exists + kvs --> actor: Return default value for key + else default-doesnt-exist + kvs --> actor: Key-Not-Found error + end +end + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_read_file_into_local_repr.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_read_file_into_local_repr.puml new file mode 100644 index 00000000..4a154d24 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_read_file_into_local_repr.puml @@ -0,0 +1,47 @@ +@startuml + +title Sequence Diagram: Read Data into Local Representation (KvsValue) + +participant "User" as actor +participant "«component» :kvs" as kvs +participant "«component» :json" as json_parser +participant "«component» :fs" as fs + +actor -> kvs: Open KVS + +kvs -> fs: Read defaults file + +alt file-exists + fs --> kvs: Defaults file content (JSON) +else file-based-error + fs --> kvs: File-Error + kvs -> actor: File-Error +end + +kvs -> fs: Read defaults file hash + +alt file-exists + fs --> kvs: Defaults file hash +else file-based-error + fs --> kvs: File-Error + kvs -> actor: File-Error +end + +kvs -> kvs: Generate defaults file hash + +alt hash-match-success + kvs -> json_parser: Parse JSON data +else hash-match-error + kvs -> actor: Hash-Error +end + +alt parsing-success + json_parser --> kvs: Parsed JSON object +else parsing-based-error + json_parser -> kvs: Parser-Error + kvs -> actor: Parser-Error +end + +kvs --> actor: KVS instance + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_restore_snapshot.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_restore_snapshot.puml new file mode 100644 index 00000000..17eb75b3 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_restore_snapshot.puml @@ -0,0 +1,16 @@ +@startuml + +title Sequence Diagram: Restore Snapshot + +participant "User" as actor +participant "«component» :kvs" as kvs + +actor -> kvs: Restore snapshot + +alt snapshot-restore-success + kvs --> actor: Snapshot restored successfully +else snapshot-restore-error + kvs --> actor: Snapshot-Not-Available-Error +end + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_write_data_key.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_write_data_key.puml new file mode 100644 index 00000000..b34c24cc --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_dyn_write_data_key.puml @@ -0,0 +1,11 @@ +@startuml + +title Sequence Diagram: Write Key to KVS Instance + +participant "User" as actor +participant "«component» :kvs" as kvs + +actor -> kvs: Set value for key +kvs --> actor: Value set for key + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_interface.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_interface.puml new file mode 100644 index 00000000..46f65a27 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_interface.puml @@ -0,0 +1,21 @@ +@startuml + +interface IKvs { + open + flush_on_exit + reset + get_all_keys + key_exists + get_value + get_default_value + has_default_value + set_default_value + set_value + remove_key + flush + snapshot_count + snapshot_max_count + snapshot_restore +} + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/_assets/kvs_static_view.puml b/docs/persistency/kvs/docs/architecture/_assets/kvs_static_view.puml new file mode 100644 index 00000000..ebb646f2 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/_assets/kvs_static_view.puml @@ -0,0 +1,34 @@ +@startuml +allowmixing + +title Static View - kvs + +!include kvs_interface.puml + + +skinparam package { + BackgroundColor #E0E0D0 + BorderColor Black + backgroundColor<> lightgreen +} + +skinparam component { + backgroundColor<> white +} + +' Define Features +package "persistency" <> { + component kvs <> + component fs <> + component json <> +} + + + +kvs --> IKvs : implements + +kvs ..> json : use +kvs ..> fs : use + + +@enduml diff --git a/docs/persistency/kvs/docs/architecture/chklst_arc_inspection.rst b/docs/persistency/kvs/docs/architecture/chklst_arc_inspection.rst new file mode 100644 index 00000000..e52a0e13 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/chklst_arc_inspection.rst @@ -0,0 +1,176 @@ +.. + # ******************************************************************************* + # 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 + # ******************************************************************************* + + +.. document:: Persistency Architecture Inspection Checklist + :id: doc__persistency_arc_inspection + :status: draft + :safety: ASIL_B + :security: YES + :realizes: wp__sw_arch_verification + + +Architecture Inspection Checklist +================================= + +Purpose +------- + +The purpose of the software architecture checklist is to ensure that the design meets the criteria and quality as +defined per project processes and guidelines for feature and component architectural design elements. +It helps to check the compliance with requirements, identify errors or inconsistencies, and ensure adherence to best +practices. +The checklist guides evaluation of the architecture design, identifies potential problems, and aids in +communication and documentation of architectural decisions to stakeholders. + +Checklist +--------- + +.. list-table:: Feature Architecture Design Review Checklist Persistency + :header-rows: 1 + + * - Review Id + - Acceptance criteria + - Type + - Guidance + - passed + - Remarks + - Issue link + * - ARC_01_01 + - Is the traceability from software architectural elements to requirements, and other level architectural + elements (e.g. component to interface) established according to the defined :need:`Relations between the architectural elements `? + - automated + - Trace should be checked by Sphinx. Will be removed from checklist once requirement is implemented. + - No + - Traceability not complete, template not followed + - `Issue for Findings `_ + * - ARC_01_02 + - If the architectural element is related to any supplier manuals (incl. safety and security) + are the relevant parts covered? + - manual + - If the architecture makes use of supplied elements, their manuals (like safety) have to be considered (i.e. its provided functionality matches the expectation and assumptions are fulfilled). Note that in case of safety component this means that assumed Technical Safety Requirements and AoUs of the safety manual are covered. + - Yes + - Not applicable + - + * - ARC_01_03 + - Is the architectural element traceable to the lower level artifacts as defined by the workproduct traceability? + - automated + - Will be removed from checklist once requirement is implemented by automated tool check. + Details of possible linking can be depicted from `Traceability Concept `_ + - No + - Traceability not complete, template not followed + - `Issue for Findings `_ + * - ARC_02_01 + - Is the software architecture design compliant with the (overall) feature architecture? + - manual + - On component level check against the feature architecture, on feature level check other features with common components used. + - No + - There is no component architecture available for persistency + - `Issue for Findings `_ + * - ARC_02_02 + - Is appropriate and comprehensible operation/interface naming present in the architectural design? + - manual + - Check :need:`gd_guidl__arch_design` + - No + - Are these interfaces names, any operations? Please update template. + - `Issue for Findings `_ + * - ARC_02_03 + - Are correctness of data flow and control flow within the architectural elements considered? + - manual + - E.g. examine definitions, transformations, integrity, and interaction of data; check error handling, data + exchange between elements, correct response to inputs and documented decision making. + Note: consistency is ensured by the process/tooling, by defining each interface only once. + - Yes + - + - + * - ARC_02_04 + - Are the interfaces between the software architectural element and other architectural elements well-defined? + - manual + - Check if the interface reacts on non-defined behavior or errors; can established protocols be used; are the + interfaces for inputs, outputs, error codes documented; is loose coupling considered and only limited exposure; + can unit or integration test be written against the interface; data amount transferred; no sensitive data + exposure; + - Yes + - + - + * - ARC_02_05 + - Does the software architectural element consider the timing constraints (from the parent requirement)? + - manual + - If there are hard requirements on the timing a programming time estimation should be performed and also + deadline supervision considered. + - No + - No information found, but required + - `Issue for Findings `_ + * - ARC_02_06 + - Is the documentation of the software architectural element, including textual and graphical descriptions + (e.g., UML diagrams), comprehensible and complete? + - manual + - Use of semi-formal notation is expected for architectural elements with an allocated ASIL level. + Is the architecture template correctly filled? + - Yes + - + - + * - ARC_03_01 + - Is the architectural element modular and encapsulated? + - manual + - Check e.g. that only minimal interfaces are used. Design should be object oriented. Interfaces and interactions are clearly defined. Usage of access types (private, protected) properly set. Limited global variables. + - No + - Yes + - + * - ARC_03_02 + - Is the suitability of the software architecture for future modifications and maintainability considered? + - manual + - Check for e.g. loose coupling, separation of concerns, high cohesion, versioning strategy for interfaces, + decision records, use of established design patterns. + - Yes + - Not applicable on feature architecture level + - + * - ARC_03_03 + - Are simplicity and avoidance of unnecessary complexity present in the software architecture? + - manual + - Indicators for complexity are: number of use cases (corresponding to dynamic diagrams) + allocated to single design element, number of interfaces and operations in an interface, + function parameters, global variables, complex types, limited comprehensibility. + + Note: If the "number" above exceeds "3" a design rationale is mandatory (for all types) + - Yes + - Not applicable on feature architecture level + - + * - ARC_03_04 + - Is the software architecture design following best practices and design principles? + - manual + - Refer to architectural guidelines and recommendations within the project documentation. + - Yes + - + - + * - ARC_04_01 + - If software partitioning (different operating system processes) is used to implement freedom from interference between the processes with different rating (QM/ASIL), is effectiveness evidence generated during integration and verification tests? + + Note: see ISO 26262-6, 7.4.9 and Annex D for partitioning + - manual + - + a) the usage of shared resources (cpu time, shared memory, ...) are checked in a way that freedom from interference between the processes is ensured, + b) check if the operating system supports freedom from interference between the processes + - + - + - + * - ARC_04_02 + - Is an upper estimation of the required resources (RAM, ROM, non volatile memory, communication) available and documented? + + Note: see ISO 26262-6, 7.4.11 + - manual + - + - + - + - diff --git a/docs/persistency/kvs/docs/architecture/dynamic_architecture.rst b/docs/persistency/kvs/docs/architecture/dynamic_architecture.rst new file mode 100644 index 00000000..70106628 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/dynamic_architecture.rst @@ -0,0 +1,81 @@ +.. + # ******************************************************************************* + # 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 + # ******************************************************************************* + +.. _feature_architecture_persistency: + +Dynamic Architecture +-------------------- + +.. feat_arc_dyn:: Check if key contains default value + :id: feat_arc_dyn__persistency__check_key_default + :security: YES + :safety: ASIL_B + :fulfils: feat_req__persistency__default_values,feat_req__persistency__default_value_get + :status: valid + + .. uml:: _assets/kvs_dyn_check_value_default.puml + +.. feat_arc_dyn:: Delete key from KVS instance + :id: feat_arc_dyn__persistency__delete_key + :security: YES + :safety: ASIL_B + :fulfils: feat_req__persistency__support_datatype_keys,feat_req__persistency__support_datatype_value + :status: valid + + .. uml:: _assets/kvs_dyn_delete_data_key.puml + +.. feat_arc_dyn:: Flush to permanent storage + :id: feat_arc_dyn__persistency__flush + :security: YES + :safety: ASIL_B + :fulfils: feat_req__persistency__store_data,feat_req__persistency__snapshot_create,feat_req__persistency__integrity_check,feat_req__persistency__snapshot_restore + :status: valid + + .. uml:: _assets/kvs_dyn_flush_local_repr_to_file.puml + +.. feat_arc_dyn:: Read key value + :id: feat_arc_dyn__persistency__read_key + :security: YES + :safety: ASIL_B + :fulfils: feat_req__persistency__support_datatype_keys,feat_req__persistency__support_datatype_value,feat_req__persistency__default_values,feat_req__persistency__default_value_get + :status: valid + + .. uml:: _assets/kvs_dyn_read_data_key.puml + +.. feat_arc_dyn:: Read data from permanent storage + :id: feat_arc_dyn__persistency__read_from_storage + :security: YES + :safety: ASIL_B + :fulfils: feat_req__persistency__load_data,feat_req__persistency__integrity_check,feat_req__persistency__snapshot_restore + :status: valid + + .. uml:: _assets/kvs_dyn_read_file_into_local_repr.puml + +.. feat_arc_dyn:: Write value to key + :id: feat_arc_dyn__persistency__write_key + :security: YES + :safety: ASIL_B + :fulfils: feat_req__persistency__support_datatype_keys,feat_req__persistency__support_datatype_value + :status: valid + + .. uml:: _assets/kvs_dyn_write_data_key.puml + +.. feat_arc_dyn:: Restore snapshot + :id: feat_arc_dyn__persistency__snapshot_restore + :security: YES + :safety: ASIL_B + :fulfils: feat_req__persistency__snapshot_restore,feat_req__persistency__store_data + :status: valid + + .. uml:: _assets/kvs_dyn_restore_snapshot.puml diff --git a/docs/persistency/kvs/docs/architecture/index.rst b/docs/persistency/kvs/docs/architecture/index.rst deleted file mode 100644 index e2ff7a5f..00000000 --- a/docs/persistency/kvs/docs/architecture/index.rst +++ /dev/null @@ -1,125 +0,0 @@ -.. - # ******************************************************************************* - # 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_PersistencyKvs: - -Architecture -============ - -.. document:: Persistency KVS Module Architecture - :id: doc__persistency_kvs_architecture_v2 - :status: valid - :safety: ASIL_B - :security: NO - :realizes: wp__component_arch - -Overview --------- -Brief summary - -Requirements Linked to Component Architecture ---------------------------------------------- - -.. code-block:: none - - .. needtable:: Overview of Component Requirements - :style: table - :columns: title;id - :filter: search("comp_arch_sta__archdes$", "fulfils_back") - :colwidths: 70,30 - -Description ------------ - -General Description - -Design Decisions - -Design Constraints - -Rationale Behind Architecture Decomposition -******************************************* -mandatory: a motivation for the decomposition or reason for not further splitting it into sub components. - -.. note:: Common decisions across components / cross cutting concepts is at the higher level. - -Static Architecture -------------------- - -The components are designed to cover the expectations from the feature architecture -(i.e. if already exists a definition it should be taken over and enriched). - -.. comp_arc_sta:: Component Name (Static View) - :id: comp_arc_sta__persistency__static_view_v2 - :security: YES - :safety: ASIL_B - :status: invalid - :implements: - :fulfils: - :includes: comp_arc_sta__persistency__2_v2 - - .. needarch:: - :scale: 50 - :align: center - - {{ draw_component(need(), needs) }} - -Dynamic Architecture --------------------- - -.. comp_arc_dyn:: Dynamic View - :id: comp_arc_dyn__persistency__dynamic_view_v2 - :security: YES - :safety: ASIL_B - :status: invalid - :fulfils: - - put here a sequence diagram - - -Interfaces ----------- - -.. code-block:: rst - - .. real_arc_int:: - :id: real_arc_int__<component>__<Title> - :security: <YES|NO> - :safety: <QM|ASIL_B|ASIL_B> - :fulfils: <link to component requirement id> - :language: cpp - -Lower Level Components ----------------------- - -.. comp_arc_sta:: Component Name 2 - :id: comp_arc_sta__persistency__2_v2 - :status: invalid - :safety: ASIL_B - :security: YES - :implements: - - no architecture but detailed design - -.. note:: - Architecture can be split into multiple files. At component level the public interfaces to be used by the user and tester to be shown. - -.. attention:: - The above directives must be updated according to your component architecture. - - - Replace the example content by the real content (according to :need:`gd_guidl__arch_design`) - - Set the status to valid and start the review/merge process - -.. needextend:: docname is not None and "persistency/kvs/docs/architecture" in docname - :+tags: kvs diff --git a/docs/persistency/kvs/docs/architecture/static_architecture.rst b/docs/persistency/kvs/docs/architecture/static_architecture.rst new file mode 100644 index 00000000..cb8be988 --- /dev/null +++ b/docs/persistency/kvs/docs/architecture/static_architecture.rst @@ -0,0 +1,85 @@ +.. + # ******************************************************************************* + # 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 + # ******************************************************************************* + +.. _feature_architecture_persistency: + +Architecture +============ + +.. document:: Persistency KVS Feature Architecture + :id: doc__persistency_architecture + :status: valid + :safety: ASIL_B + :security: NO + :realizes: wp__feature_arch + :tags: persistency + +Overview +-------- + +The Key-Value-Storage (kvs) provides the capability to efficiently store, +retrieve, and manage key-value pairs in a persistent storage system. + +Description +----------- + +- kvs organize data as pairs, where each unique key is associated with a specific value. + The key acts as a unique identifier for getting the value. +- The data is persisted in JSON format to the file system, providing a human-readable, + and widely supported way to store and manage key-value pairs. +- The JSON data persisted is according to RFC-8259. + +Rationale Behind Architecture Decomposition +******************************************* + +- The architecture is decomposed to include a dedicated JSON parser component (json) to facilitate the persistent storage of data in JSON format. +- The architecture is decomposed to include a FileStorage component (fs) to read and write to the file system. + + +Glossary +-------- + +- User: Program code that is written by a person that initiates the given + functionality call or receives a callback. + + +Static Architecture +------------------- + +.. feat_arc_sta:: Static Architecture + :id: feat_arc_sta__persistency__staticx + :security: YES + :safety: ASIL_B + :includes: logic_arc_int__persistency__interface + :fulfils: feat_req__persistency__default_value_get,feat_req__persistency__default_values,feat_req__persistency__async_completion,feat_req__persistency__integrity_check,feat_req__persistency__store_data,feat_req__persistency__load_data,feat_req__persistency__snapshot_create,feat_req__persistency__support_datatype_keys,feat_req__persistency__support_datatype_value,feat_req__persistency__variant_management,feat_req__persistency__default_value_file,feat_req__persistency__cfg,feat_req__persistency__async_api,feat_req__persistency__access_control,feat_req__persistency__concurrency + :status: valid + + .. uml:: _assets/kvs_static_view.puml + + + +Logical Interfaces +------------------ + +.. logic_arc_int:: Ikvs + :id: logic_arc_int__persistency__interfacex + :security: YES + :safety: ASIL_B + :fulfils: feat_req__persistency__async_api + :status: valid + + .. uml:: _assets/kvs_interface.puml + +.. needextend:: docname is not None and "persistency/kvs/architecture" in docname + :+tags: persistency diff --git a/docs/persistency/kvs/docs/requirements/index.rst b/docs/persistency/kvs/docs/requirements/requirements.rst similarity index 100% rename from docs/persistency/kvs/docs/requirements/index.rst rename to docs/persistency/kvs/docs/requirements/requirements.rst