From 7f8f8d028284283d29ce0c31c52525a31b84f910 Mon Sep 17 00:00:00 2001 From: ChristopherSpelt Date: Thu, 30 May 2024 16:05:23 +0200 Subject: [PATCH 01/10] Add first draft of architecture diagrams --- docs/architecture/container_diagram.mdd | 58 +++++++++++++++++++++++++ docs/architecture/context_diagram.mmd | 31 +++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 docs/architecture/container_diagram.mdd create mode 100644 docs/architecture/context_diagram.mmd diff --git a/docs/architecture/container_diagram.mdd b/docs/architecture/container_diagram.mdd new file mode 100644 index 00000000..1362ad96 --- /dev/null +++ b/docs/architecture/container_diagram.mdd @@ -0,0 +1,58 @@ +C4Container + title Container diagram for the Algorithm Management Toolkit System + System(Repository, "Repository", "External repository where the System Card will be stored") + Boundary(b0, "Algorithm Management Toolkit") { + + Container(FrontEnd, "Front End", "htmx, jinja2", "Provides user interface for projects
and tasks") + Container(API, "API Application", "Python, FastAPI", "Provides the project and task management
functionality via HTTPS.") + Container(Business Logic, "Business Logic", "TODO", "TODO") + Container(State, "System State", "", "Provides the state of the
Algorithm Management Toolkit") + Container(Queue, "Task Queue", "Celery, Redis", "Asynchronously manages and
executes tasks") + SystemDb(Db, "Database") + Container(CLI, "CLI", "TODO", "CLI to execute measures
and instruments") + Container(Tasks, "Tasks", "Python library", "Library containing executable tasks
which are measures and instruments") + + + + } + + Person(user0, "User", "A user of the the Algorithm Management Toolkit") + + Rel(user0, CLI, "Executes tasks locally from", "Command line") + UpdateRelStyle(user0, CLI, $offsetY="-380", $offsetX="190") + + Rel(user0, FrontEnd, "Visits Algorithm Management Toolkit webpage", "HTTPS") + UpdateRelStyle(user0, FrontEnd, $offsetY="-60", $offsetX="-180") + + Rel(Queue, Tasks, "Get tasks") + UpdateRelStyle(FrontEnd, API, $offsetY="30", $offsetX="-50") + + Rel(CLI, Tasks, "Imports tasks from") + UpdateRelStyle(CLI, Tasks, $offsetY="-20", $offsetX="-48") + + Rel(FrontEnd, API, "Makes API calls to", "HTTPS, WebSocket") + UpdateRelStyle(FrontEnd, API, $offsetY="30", $offsetX="-50") + + Rel(State, Db, "Reads form and
writes to", "TODO") + UpdateRelStyle(State, Db, $offsetY="-20", $offsetX="5") + + Rel(Business Logic, Db, "Reads form and
writes to", "TODO") + UpdateRelStyle(Business Logic, Db, $offsetY="-20", $offsetX="-140") + + Rel(Business Logic, Queue, "TODO", "TODO") + UpdateRelStyle(Business Logic, Queue, $offsetY="-15", $offsetX="-50") + + Rel(Queue, Business Logic, "TODO", "TODO") + UpdateRelStyle(Business Logic, Queue, $offsetY="-15", $offsetX="-50") + + Rel(Business Logic, Repository, "Writes System Card", "TODO") + UpdateRelStyle(Business Logic, Repository, $offsetY="-150", $offsetX="-110") + + Rel(API, Business Logic, "TODO", "TODO") + UpdateRelStyle(Business Logic, Repository, $offsetY="-150", $offsetX="-110") + + Rel(Business Logic, API, "TODO", "TODO") + UpdateRelStyle(Business Logic, Repository, $offsetY="-150", $offsetX="-110") + + + UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1") diff --git a/docs/architecture/context_diagram.mmd b/docs/architecture/context_diagram.mmd new file mode 100644 index 00000000..964023a4 --- /dev/null +++ b/docs/architecture/context_diagram.mmd @@ -0,0 +1,31 @@ +C4Context + title System Context diagram for Algorithm Management Toolkit + Boundary(b0, "Government of the Netherlands") { + System(Algoritmekader, "Algoritmekader", "Defines measures and instruments") + System(TAD, "Algorithm Management Toolkit", "Provides the execution of measures and instruments") + System(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") + System(Repository, "Repository", "Contains a System Card with filled in measures and instruments") + } + + Person(user0, "User", "User wants to comply with regulations and required + ethical frameworks") + + + Rel(Algoritmekader, TAD, "Passes required measures and instruments") + UpdateRelStyle(Algoritmekader, TAD, $offsetY="50", $offsetX="-150") + UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") + + Rel(TAD, Repository, "Writes results to a System Card") + UpdateRelStyle(TAD, Repository, $offsetY="15", $offsetX="0") + UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") + + Rel(InstrumentRegister, TAD, "Specifies instructions on how to execute instruments and measures") + UpdateRelStyle(InstrumentRegister, TAD, $offsetY="50", $offsetX="-40") + UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") + + + Rel(user0, Algoritmekader, "Selects which measures and instruments need to be exectued") + UpdateRelStyle(user0, Algoritmekader, $offsetY="-30", $offsetX="-320") + + Rel(user0, TAD, "Executes the required measures and instruments") + UpdateRelStyle(user0, TAD, $offsetY="-30", $offsetX="-30") From 39a05efa027ec818f975e8608c275089ba0f8310 Mon Sep 17 00:00:00 2001 From: ChristopherSpelt Date: Thu, 30 May 2024 16:12:55 +0200 Subject: [PATCH 02/10] Change wrong file extension --- .../architecture/{container_diagram.mdd => container_diagram.mmd} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/architecture/{container_diagram.mdd => container_diagram.mmd} (100%) diff --git a/docs/architecture/container_diagram.mdd b/docs/architecture/container_diagram.mmd similarity index 100% rename from docs/architecture/container_diagram.mdd rename to docs/architecture/container_diagram.mmd From a7e6fa5a6d64fa4ac2aadb37eb895f357fd05340 Mon Sep 17 00:00:00 2001 From: ChristopherSpelt Date: Thu, 30 May 2024 17:03:27 +0200 Subject: [PATCH 03/10] Update container diagram --- description.md | 6 +++ docs/architecture/container_diagram.mmd | 55 ++++++++++++++----------- 2 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 description.md diff --git a/description.md b/description.md new file mode 100644 index 00000000..4d62df84 --- /dev/null +++ b/description.md @@ -0,0 +1,6 @@ +# Architecture decisions of Algorithm Management Toolkit + +This document describes architetural decisions related to the Algorithm Management Toolkit. + +TODO's: +- Can AI Verify be used to execute tasks? diff --git a/docs/architecture/container_diagram.mmd b/docs/architecture/container_diagram.mmd index 1362ad96..4163fa00 100644 --- a/docs/architecture/container_diagram.mmd +++ b/docs/architecture/container_diagram.mmd @@ -1,31 +1,30 @@ C4Container title Container diagram for the Algorithm Management Toolkit System + Person(user0, "User", "A user of the the Algorithm Management Toolkit") System(Repository, "Repository", "External repository where the System Card will be stored") + System(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") + Boundary(b0, "Algorithm Management Toolkit") { Container(FrontEnd, "Front End", "htmx, jinja2", "Provides user interface for projects
and tasks") Container(API, "API Application", "Python, FastAPI", "Provides the project and task management
functionality via HTTPS.") Container(Business Logic, "Business Logic", "TODO", "TODO") Container(State, "System State", "", "Provides the state of the
Algorithm Management Toolkit") - Container(Queue, "Task Queue", "Celery, Redis", "Asynchronously manages and
executes tasks") - SystemDb(Db, "Database") Container(CLI, "CLI", "TODO", "CLI to execute measures
and instruments") Container(Tasks, "Tasks", "Python library", "Library containing executable tasks
which are measures and instruments") - - - + Container(Queue, "Task Queue", "Celery, Redis", "Asynchronously manages and
executes tasks") + SystemDb(Db, "Database") } - Person(user0, "User", "A user of the the Algorithm Management Toolkit") Rel(user0, CLI, "Executes tasks locally from", "Command line") - UpdateRelStyle(user0, CLI, $offsetY="-380", $offsetX="190") + UpdateRelStyle(user0, CLI, $offsetY="-170", $offsetX="-170") Rel(user0, FrontEnd, "Visits Algorithm Management Toolkit webpage", "HTTPS") - UpdateRelStyle(user0, FrontEnd, $offsetY="-60", $offsetX="-180") + UpdateRelStyle(user0, FrontEnd, $offsetY="-60", $offsetX="10") Rel(Queue, Tasks, "Get tasks") - UpdateRelStyle(FrontEnd, API, $offsetY="30", $offsetX="-50") + UpdateRelStyle(Queue, Tasks, $offsetY="10", $offsetX="-30") Rel(CLI, Tasks, "Imports tasks from") UpdateRelStyle(CLI, Tasks, $offsetY="-20", $offsetX="-48") @@ -33,26 +32,34 @@ C4Container Rel(FrontEnd, API, "Makes API calls to", "HTTPS, WebSocket") UpdateRelStyle(FrontEnd, API, $offsetY="30", $offsetX="-50") - Rel(State, Db, "Reads form and
writes to", "TODO") - UpdateRelStyle(State, Db, $offsetY="-20", $offsetX="5") + Rel(State, Db, "Reads form and
writes to", "") + UpdateRelStyle(State, Db, $offsetY="-15", $offsetX="20") + + Rel(Business Logic, Db, "Reads form and
writes to", "") + UpdateRelStyle(Business Logic, Db, $offsetY="-20", $offsetX="-20") + + Rel(Business Logic, InstrumentRegister, "Gets instructions on how to execute tasks and
store results", "") + UpdateRelStyle(Business Logic, InstrumentRegister, $offsetY="-50", $offsetX="20") - Rel(Business Logic, Db, "Reads form and
writes to", "TODO") - UpdateRelStyle(Business Logic, Db, $offsetY="-20", $offsetX="-140") + Rel(Business Logic, Queue, "Ask for task execution", "") + UpdateRelStyle(Business Logic, Queue, $offsetY="-15", $offsetX="-130") - Rel(Business Logic, Queue, "TODO", "TODO") - UpdateRelStyle(Business Logic, Queue, $offsetY="-15", $offsetX="-50") + Rel(Queue, Business Logic, "Gives task result", "") + UpdateRelStyle(Queue, Business Logic, $offsetY="-15", $offsetX="10") - Rel(Queue, Business Logic, "TODO", "TODO") - UpdateRelStyle(Business Logic, Queue, $offsetY="-15", $offsetX="-50") + Rel(Business Logic, Repository, "Writes System Card", "") + UpdateRelStyle(Business Logic, Repository, $offsetY="-50", $offsetX="-130") - Rel(Business Logic, Repository, "Writes System Card", "TODO") - UpdateRelStyle(Business Logic, Repository, $offsetY="-150", $offsetX="-110") + Rel(API, Business Logic, "Forwards instructions", "") + UpdateRelStyle(API, Business Logic, $offsetY="-40", $offsetX="-50") - Rel(API, Business Logic, "TODO", "TODO") - UpdateRelStyle(Business Logic, Repository, $offsetY="-150", $offsetX="-110") + Rel(Business Logic, API, "Returns results", "") + UpdateRelStyle(Business Logic, API, $offsetY="20", $offsetX="-40") - Rel(Business Logic, API, "TODO", "TODO") - UpdateRelStyle(Business Logic, Repository, $offsetY="-150", $offsetX="-110") + Rel(Business Logic, State, "Updates state", "") + UpdateRelStyle(Business Logic, State, $offsetY="-30", $offsetX="-30") + Rel(State, Business Logic, "Gets state", "") + UpdateRelStyle(State, Business Logic, $offsetY="20", $offsetX="-30") - UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1") + UpdateLayoutConfig($c4ShapeInRow="4", $c4BoundaryInRow="1") From a2f7da140ea17e8a3fc1896389c08cbda999fcd3 Mon Sep 17 00:00:00 2001 From: ChristopherSpelt Date: Fri, 31 May 2024 13:00:26 +0200 Subject: [PATCH 04/10] Add architecture.md file --- docs/architecture/architecture.md | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/architecture/architecture.md diff --git a/docs/architecture/architecture.md b/docs/architecture/architecture.md new file mode 100644 index 00000000..e18fc375 --- /dev/null +++ b/docs/architecture/architecture.md @@ -0,0 +1,37 @@ +# Algorithm Management Toolkit Architecture + +This document contains architectural decisions related to the Algorithm Managment Toolkit. + +```mermaid +C4Context + title System Context diagram for Algorithm Management Toolkit + Boundary(b0, "Government of the Netherlands") { + System(Algoritmekader, "Algoritmekader", "Defines measures and instruments") + System(TAD, "Algorithm Management Toolkit", "Provides the execution of measures and instruments") + System(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") + System(Repository, "Repository", "Contains a System Card with filled in measures and instruments") + } + + Person(user0, "User", "User wants to comply with regulations and required + ethical frameworks") + + + Rel(Algoritmekader, TAD, "Passes required measures and instruments") + UpdateRelStyle(Algoritmekader, TAD, $offsetY="50", $offsetX="-150") + UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") + + Rel(TAD, Repository, "Writes results to a System Card") + UpdateRelStyle(TAD, Repository, $offsetY="15", $offsetX="0") + UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") + + Rel(InstrumentRegister, TAD, "Specifies instructions on how to execute instruments and measures") + UpdateRelStyle(InstrumentRegister, TAD, $offsetY="50", $offsetX="-40") + UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") + + + Rel(user0, Algoritmekader, "Selects which measures and instruments need to be exectued") + UpdateRelStyle(user0, Algoritmekader, $offsetY="-30", $offsetX="-320") + + Rel(user0, TAD, "Executes the required measures and instruments") + UpdateRelStyle(user0, TAD, $offsetY="-30", $offsetX="-30") +``` From 60610c95af9f2b34b1cbdf0e7ea2b59c1662e3d4 Mon Sep 17 00:00:00 2001 From: ChristopherSpelt Date: Fri, 31 May 2024 13:12:00 +0200 Subject: [PATCH 05/10] Remove loose mmd files --- docs/architecture/architecture.md | 86 +++++++++++++++++++++++++ docs/architecture/container_diagram.mmd | 65 ------------------- docs/architecture/context_diagram.mmd | 31 --------- 3 files changed, 86 insertions(+), 96 deletions(-) delete mode 100644 docs/architecture/container_diagram.mmd delete mode 100644 docs/architecture/context_diagram.mmd diff --git a/docs/architecture/architecture.md b/docs/architecture/architecture.md index e18fc375..96905491 100644 --- a/docs/architecture/architecture.md +++ b/docs/architecture/architecture.md @@ -2,6 +2,23 @@ This document contains architectural decisions related to the Algorithm Managment Toolkit. +## System Context +The Algorithm Management Toolkit is an application that users can use to complete requirements +that are specified by the algoritmekader. The diagram below sketches the broader system context +of this Algorithm Management Toolkit. + +### Example +Suppose a data science team is working on an ML-algorithm. A team member visits the Algoritmekader +website and sees that among other things an IAMA is a required to be performed. The user selects +the IAMA task from the Algoritmekader and is forwarded to the Algoritme Management Toolkit. Here +the user can login and import the IAMA task. The Algorithm Management Toolkit imports the instructions +on how to execute an IAMA and how to store the results from the Instrument Register. Now the user can +perform the IAMA from within the Algorithm Management Toolkit. Relevant stakeholders can also login +to the project page of the Algorithm Management Toolkit to answer questions from the IAMA. Relevant +discussions can be captured within the toolkit as well. Upon completion the IAMA results are written +to an Assessment Card within a System Card to a user specified location, usually a remote repository +where the source code of the algorithm resides. + ```mermaid C4Context title System Context diagram for Algorithm Management Toolkit @@ -35,3 +52,72 @@ C4Context Rel(user0, TAD, "Executes the required measures and instruments") UpdateRelStyle(user0, TAD, $offsetY="-30", $offsetX="-30") ``` + +## Container Context of the Algorithm Management Toolkit System +```mermaid +C4Container + title Container diagram for the Algorithm Management Toolkit System + Person(user0, "User", "A user of the the Algorithm Management Toolkit") + System(Repository, "Repository", "External repository where the System Card will be stored") + System(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") + + Boundary(b0, "Algorithm Management Toolkit") { + + Container(FrontEnd, "Front End", "htmx, jinja2", "Provides user interface for projects
and tasks") + Container(API, "API Application", "Python, FastAPI", "Provides the project and task management
functionality via HTTPS.") + Container(Business Logic, "Business Logic", "TODO", "TODO") + Container(State, "System State", "", "Provides the state of the
Algorithm Management Toolkit") + Container(CLI, "CLI", "TODO", "CLI to execute measures
and instruments") + Container(Tasks, "Tasks", "Python library", "Library containing executable tasks
which are measures and instruments") + Container(Queue, "Task Queue", "Celery, Redis", "Asynchronously manages and
executes tasks") + SystemDb(Db, "Database") + } + + + Rel(user0, CLI, "Executes tasks locally from", "Command line") + UpdateRelStyle(user0, CLI, $offsetY="-170", $offsetX="-170") + + Rel(user0, FrontEnd, "Visits Algorithm Management Toolkit webpage", "HTTPS") + UpdateRelStyle(user0, FrontEnd, $offsetY="-60", $offsetX="10") + + Rel(Queue, Tasks, "Get tasks") + UpdateRelStyle(Queue, Tasks, $offsetY="10", $offsetX="-30") + + Rel(CLI, Tasks, "Imports tasks from") + UpdateRelStyle(CLI, Tasks, $offsetY="-20", $offsetX="-48") + + Rel(FrontEnd, API, "Makes API calls to", "HTTPS, WebSocket") + UpdateRelStyle(FrontEnd, API, $offsetY="30", $offsetX="-50") + + Rel(State, Db, "Reads form and
writes to", "") + UpdateRelStyle(State, Db, $offsetY="-15", $offsetX="20") + + Rel(Business Logic, Db, "Reads form and
writes to", "") + UpdateRelStyle(Business Logic, Db, $offsetY="-20", $offsetX="-20") + + Rel(Business Logic, InstrumentRegister, "Gets instructions on how to execute tasks and
store results", "") + UpdateRelStyle(Business Logic, InstrumentRegister, $offsetY="-50", $offsetX="20") + + Rel(Business Logic, Queue, "Ask for task execution", "") + UpdateRelStyle(Business Logic, Queue, $offsetY="-15", $offsetX="-130") + + Rel(Queue, Business Logic, "Gives task result", "") + UpdateRelStyle(Queue, Business Logic, $offsetY="-15", $offsetX="10") + + Rel(Business Logic, Repository, "Writes System Card", "") + UpdateRelStyle(Business Logic, Repository, $offsetY="-50", $offsetX="-130") + + Rel(API, Business Logic, "Forwards instructions", "") + UpdateRelStyle(API, Business Logic, $offsetY="-40", $offsetX="-50") + + Rel(Business Logic, API, "Returns results", "") + UpdateRelStyle(Business Logic, API, $offsetY="20", $offsetX="-40") + + Rel(Business Logic, State, "Updates state", "") + UpdateRelStyle(Business Logic, State, $offsetY="-30", $offsetX="-30") + + Rel(State, Business Logic, "Gets state", "") + UpdateRelStyle(State, Business Logic, $offsetY="20", $offsetX="-30") + + UpdateLayoutConfig($c4ShapeInRow="4", $c4BoundaryInRow="1") +``` diff --git a/docs/architecture/container_diagram.mmd b/docs/architecture/container_diagram.mmd deleted file mode 100644 index 4163fa00..00000000 --- a/docs/architecture/container_diagram.mmd +++ /dev/null @@ -1,65 +0,0 @@ -C4Container - title Container diagram for the Algorithm Management Toolkit System - Person(user0, "User", "A user of the the Algorithm Management Toolkit") - System(Repository, "Repository", "External repository where the System Card will be stored") - System(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") - - Boundary(b0, "Algorithm Management Toolkit") { - - Container(FrontEnd, "Front End", "htmx, jinja2", "Provides user interface for projects
and tasks") - Container(API, "API Application", "Python, FastAPI", "Provides the project and task management
functionality via HTTPS.") - Container(Business Logic, "Business Logic", "TODO", "TODO") - Container(State, "System State", "", "Provides the state of the
Algorithm Management Toolkit") - Container(CLI, "CLI", "TODO", "CLI to execute measures
and instruments") - Container(Tasks, "Tasks", "Python library", "Library containing executable tasks
which are measures and instruments") - Container(Queue, "Task Queue", "Celery, Redis", "Asynchronously manages and
executes tasks") - SystemDb(Db, "Database") - } - - - Rel(user0, CLI, "Executes tasks locally from", "Command line") - UpdateRelStyle(user0, CLI, $offsetY="-170", $offsetX="-170") - - Rel(user0, FrontEnd, "Visits Algorithm Management Toolkit webpage", "HTTPS") - UpdateRelStyle(user0, FrontEnd, $offsetY="-60", $offsetX="10") - - Rel(Queue, Tasks, "Get tasks") - UpdateRelStyle(Queue, Tasks, $offsetY="10", $offsetX="-30") - - Rel(CLI, Tasks, "Imports tasks from") - UpdateRelStyle(CLI, Tasks, $offsetY="-20", $offsetX="-48") - - Rel(FrontEnd, API, "Makes API calls to", "HTTPS, WebSocket") - UpdateRelStyle(FrontEnd, API, $offsetY="30", $offsetX="-50") - - Rel(State, Db, "Reads form and
writes to", "") - UpdateRelStyle(State, Db, $offsetY="-15", $offsetX="20") - - Rel(Business Logic, Db, "Reads form and
writes to", "") - UpdateRelStyle(Business Logic, Db, $offsetY="-20", $offsetX="-20") - - Rel(Business Logic, InstrumentRegister, "Gets instructions on how to execute tasks and
store results", "") - UpdateRelStyle(Business Logic, InstrumentRegister, $offsetY="-50", $offsetX="20") - - Rel(Business Logic, Queue, "Ask for task execution", "") - UpdateRelStyle(Business Logic, Queue, $offsetY="-15", $offsetX="-130") - - Rel(Queue, Business Logic, "Gives task result", "") - UpdateRelStyle(Queue, Business Logic, $offsetY="-15", $offsetX="10") - - Rel(Business Logic, Repository, "Writes System Card", "") - UpdateRelStyle(Business Logic, Repository, $offsetY="-50", $offsetX="-130") - - Rel(API, Business Logic, "Forwards instructions", "") - UpdateRelStyle(API, Business Logic, $offsetY="-40", $offsetX="-50") - - Rel(Business Logic, API, "Returns results", "") - UpdateRelStyle(Business Logic, API, $offsetY="20", $offsetX="-40") - - Rel(Business Logic, State, "Updates state", "") - UpdateRelStyle(Business Logic, State, $offsetY="-30", $offsetX="-30") - - Rel(State, Business Logic, "Gets state", "") - UpdateRelStyle(State, Business Logic, $offsetY="20", $offsetX="-30") - - UpdateLayoutConfig($c4ShapeInRow="4", $c4BoundaryInRow="1") diff --git a/docs/architecture/context_diagram.mmd b/docs/architecture/context_diagram.mmd deleted file mode 100644 index 964023a4..00000000 --- a/docs/architecture/context_diagram.mmd +++ /dev/null @@ -1,31 +0,0 @@ -C4Context - title System Context diagram for Algorithm Management Toolkit - Boundary(b0, "Government of the Netherlands") { - System(Algoritmekader, "Algoritmekader", "Defines measures and instruments") - System(TAD, "Algorithm Management Toolkit", "Provides the execution of measures and instruments") - System(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") - System(Repository, "Repository", "Contains a System Card with filled in measures and instruments") - } - - Person(user0, "User", "User wants to comply with regulations and required - ethical frameworks") - - - Rel(Algoritmekader, TAD, "Passes required measures and instruments") - UpdateRelStyle(Algoritmekader, TAD, $offsetY="50", $offsetX="-150") - UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") - - Rel(TAD, Repository, "Writes results to a System Card") - UpdateRelStyle(TAD, Repository, $offsetY="15", $offsetX="0") - UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") - - Rel(InstrumentRegister, TAD, "Specifies instructions on how to execute instruments and measures") - UpdateRelStyle(InstrumentRegister, TAD, $offsetY="50", $offsetX="-40") - UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") - - - Rel(user0, Algoritmekader, "Selects which measures and instruments need to be exectued") - UpdateRelStyle(user0, Algoritmekader, $offsetY="-30", $offsetX="-320") - - Rel(user0, TAD, "Executes the required measures and instruments") - UpdateRelStyle(user0, TAD, $offsetY="-30", $offsetX="-30") From 2ed6d06dac2fdc0c33aa31f430e3742176e85c04 Mon Sep 17 00:00:00 2001 From: ChristopherSpelt Date: Fri, 31 May 2024 14:16:33 +0200 Subject: [PATCH 06/10] Add websockets and heartbeats --- docs/architecture/architecture.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/architecture/architecture.md b/docs/architecture/architecture.md index 96905491..58e127a6 100644 --- a/docs/architecture/architecture.md +++ b/docs/architecture/architecture.md @@ -10,7 +10,7 @@ of this Algorithm Management Toolkit. ### Example Suppose a data science team is working on an ML-algorithm. A team member visits the Algoritmekader website and sees that among other things an IAMA is a required to be performed. The user selects -the IAMA task from the Algoritmekader and is forwarded to the Algoritme Management Toolkit. Here +the IAMA task from the Algoritmekader and is forwarded to the Algorithm Management Toolkit. Here the user can login and import the IAMA task. The Algorithm Management Toolkit imports the instructions on how to execute an IAMA and how to store the results from the Instrument Register. Now the user can perform the IAMA from within the Algorithm Management Toolkit. Relevant stakeholders can also login @@ -53,7 +53,7 @@ C4Context UpdateRelStyle(user0, TAD, $offsetY="-30", $offsetX="-30") ``` -## Container Context of the Algorithm Management Toolkit System +## Container Diagram of the Algorithm Management Toolkit System ```mermaid C4Container title Container diagram for the Algorithm Management Toolkit System @@ -65,7 +65,7 @@ C4Container Container(FrontEnd, "Front End", "htmx, jinja2", "Provides user interface for projects
and tasks") Container(API, "API Application", "Python, FastAPI", "Provides the project and task management
functionality via HTTPS.") - Container(Business Logic, "Business Logic", "TODO", "TODO") + Container(Business Logic, "Business Logic", "Python", "Core logic of the
Algorithm Management Toolkit") Container(State, "System State", "", "Provides the state of the
Algorithm Management Toolkit") Container(CLI, "CLI", "TODO", "CLI to execute measures
and instruments") Container(Tasks, "Tasks", "Python library", "Library containing executable tasks
which are measures and instruments") @@ -86,7 +86,13 @@ C4Container Rel(CLI, Tasks, "Imports tasks from") UpdateRelStyle(CLI, Tasks, $offsetY="-20", $offsetX="-48") - Rel(FrontEnd, API, "Makes API calls to", "HTTPS, WebSocket") + Rel(Tasks, API, "Sends live update","websocket") + UpdateRelStyle(Tasks, API, $offsetY="-20", $offsetX="-100") + + Rel(API, FrontEnd, "Sends live update","websocket") + UpdateRelStyle(API, FrontEnd, $offsetY="-40", $offsetX="-50") + + Rel(FrontEnd, API, "Makes API calls to", "HTTPS") UpdateRelStyle(FrontEnd, API, $offsetY="30", $offsetX="-50") Rel(State, Db, "Reads form and
writes to", "") @@ -108,16 +114,19 @@ C4Container UpdateRelStyle(Business Logic, Repository, $offsetY="-50", $offsetX="-130") Rel(API, Business Logic, "Forwards instructions", "") - UpdateRelStyle(API, Business Logic, $offsetY="-40", $offsetX="-50") + UpdateRelStyle(API, Business Logic, $offsetY="40", $offsetX="-50") Rel(Business Logic, API, "Returns results", "") UpdateRelStyle(Business Logic, API, $offsetY="20", $offsetX="-40") Rel(Business Logic, State, "Updates state", "") - UpdateRelStyle(Business Logic, State, $offsetY="-30", $offsetX="-30") + UpdateRelStyle(Business Logic, State, $offsetY="30", $offsetX="-30") Rel(State, Business Logic, "Gets state", "") UpdateRelStyle(State, Business Logic, $offsetY="20", $offsetX="-30") + Rel(API, State, "Sends heartbeat", "HTTPS") + UpdateRelStyle(API, State, $offsetY="-30", $offsetX="-200") + UpdateLayoutConfig($c4ShapeInRow="4", $c4BoundaryInRow="1") ``` From 049fad9a0c74daf89d5e5c85a4c8965bb646af30 Mon Sep 17 00:00:00 2001 From: ChristopherSpelt Date: Fri, 31 May 2024 14:24:47 +0200 Subject: [PATCH 07/10] Add descriptive text about tasks --- docs/architecture/architecture.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/architecture/architecture.md b/docs/architecture/architecture.md index 58e127a6..2f42511f 100644 --- a/docs/architecture/architecture.md +++ b/docs/architecture/architecture.md @@ -54,6 +54,8 @@ C4Context ``` ## Container Diagram of the Algorithm Management Toolkit System +Below is a context diagram of the Algorithm Management Toolkit, with some additional remarks about +its components. ```mermaid C4Container title Container diagram for the Algorithm Management Toolkit System @@ -130,3 +132,19 @@ C4Container UpdateLayoutConfig($c4ShapeInRow="4", $c4BoundaryInRow="1") ``` + +### Tasks +The `Task` library of the system contains executable tasks that implement the measures and +instruments from the Instrument Register (which are specified in the Algoritmekader). There exists +a one-to-one correspondence between measures and instruments in the Instrument Register and the `task`'s +within the `Task` library. Each `task` within the `Tasks` library implements exactly one measure or +instrument from the Instrument Register and each such `task` knows to which measure or instrument +it corresponds to. + + +TODO: As per the information in the ticket tasks should run in a Docker container. How can we visualise +this in the above drawing? Probably we do not want that the CLI runs tasks within a container, because +it makes more sense to import tasks directly from the tasks library. + +#### Implementation of a task +TODO: Can we use AIVerify's implemenations for technical tests? From 2119c98cca01693a872ab3dc4fe41afbb441537d Mon Sep 17 00:00:00 2001 From: GuusjeJuijn Date: Tue, 4 Jun 2024 16:30:56 +0200 Subject: [PATCH 08/10] Adjusted container diagram, added component diagram, added walkthrough example text --- docs/architecture/architecture.md | 143 +++++++++++++++++------------- 1 file changed, 81 insertions(+), 62 deletions(-) diff --git a/docs/architecture/architecture.md b/docs/architecture/architecture.md index 2f42511f..e5cf176f 100644 --- a/docs/architecture/architecture.md +++ b/docs/architecture/architecture.md @@ -3,6 +3,7 @@ This document contains architectural decisions related to the Algorithm Managment Toolkit. ## System Context + The Algorithm Management Toolkit is an application that users can use to complete requirements that are specified by the algoritmekader. The diagram below sketches the broader system context of this Algorithm Management Toolkit. @@ -19,6 +20,7 @@ discussions can be captured within the toolkit as well. Upon completion the IAMA to an Assessment Card within a System Card to a user specified location, usually a remote repository where the source code of the algorithm resides. + ```mermaid C4Context title System Context diagram for Algorithm Management Toolkit @@ -52,99 +54,116 @@ C4Context Rel(user0, TAD, "Executes the required measures and instruments") UpdateRelStyle(user0, TAD, $offsetY="-30", $offsetX="-30") ``` - ## Container Diagram of the Algorithm Management Toolkit System Below is a context diagram of the Algorithm Management Toolkit, with some additional remarks about its components. ```mermaid + C4Container title Container diagram for the Algorithm Management Toolkit System - Person(user0, "User", "A user of the the Algorithm Management Toolkit") - System(Repository, "Repository", "External repository where the System Card will be stored") - System(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") + Person(user0, "User") - Boundary(b0, "Algorithm Management Toolkit") { - Container(FrontEnd, "Front End", "htmx, jinja2", "Provides user interface for projects
and tasks") - Container(API, "API Application", "Python, FastAPI", "Provides the project and task management
functionality via HTTPS.") - Container(Business Logic, "Business Logic", "Python", "Core logic of the
Algorithm Management Toolkit") - Container(State, "System State", "", "Provides the state of the
Algorithm Management Toolkit") - Container(CLI, "CLI", "TODO", "CLI to execute measures
and instruments") - Container(Tasks, "Tasks", "Python library", "Library containing executable tasks
which are measures and instruments") - Container(Queue, "Task Queue", "Celery, Redis", "Asynchronously manages and
executes tasks") - SystemDb(Db, "Database") +Boundary(b0, "Local") { + Container_Ext(CLI, "CLI", "Command Line", "CLI to execute measures
and instruments") + Container_Ext(Tasks, "Tasks", "Python library", "Library containing executable tasks
which are measures and instruments") + System_Ext(InstrumentRegister, "Instrument Register", "Contains information about
how to execute instruments and measures") + } - Rel(user0, CLI, "Executes tasks locally from", "Command line") - UpdateRelStyle(user0, CLI, $offsetY="-170", $offsetX="-170") - Rel(user0, FrontEnd, "Visits Algorithm Management Toolkit webpage", "HTTPS") - UpdateRelStyle(user0, FrontEnd, $offsetY="-60", $offsetX="10") + Boundary(b1, "Algorithm Management Toolkit") { + Container(FrontEnd, "Front End", "htmx, jinja2", "Provides user interface for projects
and tasks") + Container(Backend, "Back End", "FastAPI, Python","Includes the API application,
business logic and system state") + ComponentDb(Db, "Database") + ContainerQueue(Message queue, "Message queue", "Redis") + Component(Workers, "Workers", "Celery") + + } - Rel(Queue, Tasks, "Get tasks") - UpdateRelStyle(Queue, Tasks, $offsetY="10", $offsetX="-30") - Rel(CLI, Tasks, "Imports tasks from") - UpdateRelStyle(CLI, Tasks, $offsetY="-20", $offsetX="-48") - Rel(Tasks, API, "Sends live update","websocket") - UpdateRelStyle(Tasks, API, $offsetY="-20", $offsetX="-100") +Boundary(b2, "External"){ + System_Ext(Repository, "Repository", "External repository where the
System Card will be stored") - Rel(API, FrontEnd, "Sends live update","websocket") - UpdateRelStyle(API, FrontEnd, $offsetY="-40", $offsetX="-50") +} - Rel(FrontEnd, API, "Makes API calls to", "HTTPS") - UpdateRelStyle(FrontEnd, API, $offsetY="30", $offsetX="-50") +UpdateLayoutConfig($c4ShapeInRow="1", $c4BoundaryInRow="4") - Rel(State, Db, "Reads form and
writes to", "") - UpdateRelStyle(State, Db, $offsetY="-15", $offsetX="20") +Rel(user0, CLI, "Executes tasks locally
from", "Command line") +UpdateRelStyle(user0, CLI, $offsetY="-40", $offsetX="-140") - Rel(Business Logic, Db, "Reads form and
writes to", "") - UpdateRelStyle(Business Logic, Db, $offsetY="-20", $offsetX="-20") +Rel(user0, FrontEnd, "Visits Algorithm Management
Toolkit webpage", "HTTPS") +UpdateRelStyle(user0, FrontEnd, $offsetY="-40", $offsetX="-70") - Rel(Business Logic, InstrumentRegister, "Gets instructions on how to execute tasks and
store results", "") - UpdateRelStyle(Business Logic, InstrumentRegister, $offsetY="-50", $offsetX="20") +Rel(CLI, Tasks, "Imports tasks from") +UpdateRelStyle(CLI, Tasks, $offsetY="-5", $offsetX="-120") - Rel(Business Logic, Queue, "Ask for task execution", "") - UpdateRelStyle(Business Logic, Queue, $offsetY="-15", $offsetX="-130") +BiRel(FrontEnd, Backend, "Front End makes API calls,
Back End sends live updates", "HTTPS, websocket") +UpdateRelStyle(FrontEnd, Backend, $offsetY="-10", $offsetX="-165") - Rel(Queue, Business Logic, "Gives task result", "") - UpdateRelStyle(Queue, Business Logic, $offsetY="-15", $offsetX="10") - Rel(Business Logic, Repository, "Writes System Card", "") - UpdateRelStyle(Business Logic, Repository, $offsetY="-50", $offsetX="-130") +BiRel(Backend, Db, "Reads from and
writes to", "") +UpdateRelStyle(Backend, Db, $offsetY="-10", $offsetX="10") - Rel(API, Business Logic, "Forwards instructions", "") - UpdateRelStyle(API, Business Logic, $offsetY="40", $offsetX="-50") +BiRel(Backend, Message queue, "Submits tasks,
gets results") +UpdateRelStyle(Backend, Message queue, $offsetY="80", $offsetX="15") - Rel(Business Logic, API, "Returns results", "") - UpdateRelStyle(Business Logic, API, $offsetY="20", $offsetX="-40") - Rel(Business Logic, State, "Updates state", "") - UpdateRelStyle(Business Logic, State, $offsetY="30", $offsetX="-30") +BiRel(Message queue, Workers, "Accepts tasks,
writes progress") +UpdateRelStyle(Message queue, Workers, $offsetY="0", $offsetX="10") - Rel(State, Business Logic, "Gets state", "") - UpdateRelStyle(State, Business Logic, $offsetY="20", $offsetX="-30") - Rel(API, State, "Sends heartbeat", "HTTPS") - UpdateRelStyle(API, State, $offsetY="-30", $offsetX="-200") +Rel(Backend, Repository, "Writes System Card to", "") +UpdateRelStyle(Backend, Repository, $offsetY="20", $offsetX="-40") + +Rel(Workers, Tasks, "Imports tasks
from") +UpdateRelStyle(Workers, Tasks, $offsetY="160", $offsetX="60") + +Rel(Tasks, InstrumentRegister, "Imports instructions from", "") +UpdateRelStyle(Tasks, InstrumentRegister, $offsetY="10", $offsetX="-150") - UpdateLayoutConfig($c4ShapeInRow="4", $c4BoundaryInRow="1") ``` -### Tasks -The `Task` library of the system contains executable tasks that implement the measures and -instruments from the Instrument Register (which are specified in the Algoritmekader). There exists -a one-to-one correspondence between measures and instruments in the Instrument Register and the `task`'s -within the `Task` library. Each `task` within the `Tasks` library implements exactly one measure or -instrument from the Instrument Register and each such `task` knows to which measure or instrument -it corresponds to. +### Walkthrough +Suppose a user wants to perform a specific task from the Algoritmekader. To execute this task, the user has 2 options. + +The first option is to execute the task locally by using the command line interface tool (CLI). The CLI tool imports the task from a Python library named `Tasks`. This library contains executable tasks that implement the measures and instruments from the `Instrument Register` (which are specified in the Algoritmekader). Instructions on how to perform these tasks are imported from the Instrument Register. There exists a one-to-one correspondence between measures and instruments in the `Instrument Register` and the task's within the `Tasks` library. +The second option is to use the Algorithm Management Toolkit (AMT). The user starts by visiting the Algorithm Management Toolkit website. Here, the user encounters a front end interface showing a planning board for projects and tasks. This planning board contains 3 columns: ‘To do’, ‘Doing’ and ‘Done’. When a user drags a task from ’To do’ to ‘Doing’, the front end makes an API call to the back end of the AMT. -TODO: As per the information in the ticket tasks should run in a Docker container. How can we visualise -this in the above drawing? Probably we do not want that the CLI runs tasks within a container, because -it makes more sense to import tasks directly from the tasks library. +The backend consists of three components, showed in the component diagram at the end of this page. +1. An API application, which provides the project and tasks management functionality via HTTPS. +2. The business logic, which is the core logic of the AMT. +3. A system state, which provides the state of the AMT. -#### Implementation of a task -TODO: Can we use AIVerify's implemenations for technical tests? +When receiving an API call, the API application forwards the instruction to the business logic. The business logic, in turn, updates the system state and submits the task to the Redis message queue. The message queue stores the task messages until a Celery worker is ready to process a specific task. When a Celery worker is available, it uses the task library to execute the task. After the task is completed by the worker, the result is sent back to the business logic via the message queue. The business logic now sends an update to the system state and writes the result to the database. Finally, the business logic writes a System Card to an external repository. + +Meanwhile, the API application sends regular heartbeats to the system state to check for updates. The system state receives updates from the business logic and checks for updates by reading from the database. When a state is updated (for example, a task is "done" or "failed with error X"), the business logic returns this to the API application. Using a websocket, the API application sends live updates back to the front end, to make sure the planning board stays up to date. + +## Component diagram of the back end of the Algorithm Management Toolkit +Below is a component diagram of the back end of the Algorithm Management Toolkit, with some additional remarks about its components. +```mermaid +C4Component + title Component diagram for the back end of the Algorithm Management Toolkit System + + Boundary(b2, "Back End") { + Container(State, "System State", "", "Provides the state of the
Algorithm Management Toolkit") + Container(Business Logic, "Business Logic", "Python", "Core logic of the
Algorithm Management Toolkit") + Container(API, "API Application", "Python, FastAPI", "Provides the project and task management
functionality via HTTPS.") + } + + + +BiRel(API, Business Logic, "Forwards instructions,
returns results", "") +UpdateRelStyle(API, Business Logic, $offsetY="-20", $offsetX="-110") + +BiRel(State, Business Logic, "Gets / updates
state", "") +UpdateRelStyle(State, Business Logic, $offsetY="-25", $offsetX="-35") + +Rel(API, State, "Sends heartbeat", "HTTPS") +UpdateRelStyle(API, State, $offsetY="-10", $offsetX="-100") + +UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="3") +``` From 5b3ad0fdd44dba52cca2c5e70dfd1886bb636fa3 Mon Sep 17 00:00:00 2001 From: GuusjeJuijn <96429015+GuusjeJuijn@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:13:44 +0200 Subject: [PATCH 09/10] Add minor spelling fixes Co-authored-by: Laurens Weijs Signed-off-by: GuusjeJuijn <96429015+GuusjeJuijn@users.noreply.github.com> --- docs/architecture/architecture.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/architecture/architecture.md b/docs/architecture/architecture.md index e5cf176f..e40a02e2 100644 --- a/docs/architecture/architecture.md +++ b/docs/architecture/architecture.md @@ -138,7 +138,7 @@ The backend consists of three components, showed in the component diagram at the 2. The business logic, which is the core logic of the AMT. 3. A system state, which provides the state of the AMT. -When receiving an API call, the API application forwards the instruction to the business logic. The business logic, in turn, updates the system state and submits the task to the Redis message queue. The message queue stores the task messages until a Celery worker is ready to process a specific task. When a Celery worker is available, it uses the task library to execute the task. After the task is completed by the worker, the result is sent back to the business logic via the message queue. The business logic now sends an update to the system state and writes the result to the database. Finally, the business logic writes a System Card to an external repository. +When receiving an API call, the application forwards the instruction to the business logic. The business logic, in turn, updates the system state and submits the task to the Redis message queue. The message queue stores the task messages until a Celery worker is ready to process a specific task. When a Celery worker is available, it uses the task library to execute the task. After the task is completed by the worker, the result is sent back to the business logic via the message queue. The business logic now sends an update to the system state and writes the result to the database. Finally, the business logic writes a System Card to an external repository. Meanwhile, the API application sends regular heartbeats to the system state to check for updates. The system state receives updates from the business logic and checks for updates by reading from the database. When a state is updated (for example, a task is "done" or "failed with error X"), the business logic returns this to the API application. Using a websocket, the API application sends live updates back to the front end, to make sure the planning board stays up to date. From b75399541cca79df41c4acd0ac89c0971cde3844 Mon Sep 17 00:00:00 2001 From: GuusjeJuijn Date: Thu, 6 Jun 2024 15:22:11 +0200 Subject: [PATCH 10/10] Added Algoritmeregister to context diagram + text, fixed typo's, processed comments --- docs/architecture/architecture.md | 49 +++++++++++++++++++------------ 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/docs/architecture/architecture.md b/docs/architecture/architecture.md index e40a02e2..03cb4a66 100644 --- a/docs/architecture/architecture.md +++ b/docs/architecture/architecture.md @@ -5,7 +5,7 @@ This document contains architectural decisions related to the Algorithm Managmen ## System Context The Algorithm Management Toolkit is an application that users can use to complete requirements -that are specified by the algoritmekader. The diagram below sketches the broader system context +that are specified by the Algoritmekader. The diagram below sketches the broader system context of this Algorithm Management Toolkit. ### Example @@ -18,17 +18,21 @@ perform the IAMA from within the Algorithm Management Toolkit. Relevant stakehol to the project page of the Algorithm Management Toolkit to answer questions from the IAMA. Relevant discussions can be captured within the toolkit as well. Upon completion the IAMA results are written to an Assessment Card within a System Card to a user specified location, usually a remote repository -where the source code of the algorithm resides. +where the source code of the algorithm resides. Using the information of a System Card, an algorithm +can be published to the Algoritmeregister. Also, algorithms from the Algoritmeregister can be converted +into System Cards. ```mermaid C4Context title System Context diagram for Algorithm Management Toolkit Boundary(b0, "Government of the Netherlands") { - System(Algoritmekader, "Algoritmekader", "Defines measures and instruments") + System_Ext(Algoritmekader, "Algoritmekader", "Defines measures and instruments") System(TAD, "Algorithm Management Toolkit", "Provides the execution of measures and instruments") - System(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") - System(Repository, "Repository", "Contains a System Card with filled in measures and instruments") + System_Ext(Repository, "Repository", "Contains a System Card with filled in measures and instruments") + System_Ext(InstrumentRegister, "Instrument Register", "Contains information about how to execute instruments and measures") + System_Ext(Algoritmeregister, "Algoritmeregister", "Contains descriptions of algorithms") + } Person(user0, "User", "User wants to comply with regulations and required @@ -37,22 +41,29 @@ C4Context Rel(Algoritmekader, TAD, "Passes required measures and instruments") UpdateRelStyle(Algoritmekader, TAD, $offsetY="50", $offsetX="-150") - UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") - Rel(TAD, Repository, "Writes results to a System Card") - UpdateRelStyle(TAD, Repository, $offsetY="15", $offsetX="0") - UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") + Rel(TAD, Repository, "Writes results to
a System Card") + UpdateRelStyle(TAD, Repository, $offsetY="10", $offsetX="30") + + - Rel(InstrumentRegister, TAD, "Specifies instructions on how to execute instruments and measures") - UpdateRelStyle(InstrumentRegister, TAD, $offsetY="50", $offsetX="-40") - UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1") + Rel(InstrumentRegister, TAD, "Specifies instructions on how
to execute instruments and measures") + UpdateRelStyle(InstrumentRegister, TAD, $offsetY="10", $offsetX="80") + Rel(Repository, Algoritmeregister, "Algorithm can be
uploaded in register") + UpdateRelStyle(Repository, Algoritmeregister, $offsetY="10", $offsetX="20") - Rel(user0, Algoritmekader, "Selects which measures and instruments need to be exectued") - UpdateRelStyle(user0, Algoritmekader, $offsetY="-30", $offsetX="-320") + Rel(Algoritmeregister, Repository, "Description can be
converted to system card") + UpdateRelStyle(Algoritmeregister, Repository, $offsetY="10", $offsetX="-160") - Rel(user0, TAD, "Executes the required measures and instruments") + + Rel(user0, Algoritmekader, "Selects which measures
and instruments need to be exectued") + UpdateRelStyle(user0, Algoritmekader, $offsetY="-30", $offsetX="-200") + + Rel(user0, TAD, "Executes the required
measures and instruments") UpdateRelStyle(user0, TAD, $offsetY="-30", $offsetX="-30") + + UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="2") ``` ## Container Diagram of the Algorithm Management Toolkit System Below is a context diagram of the Algorithm Management Toolkit, with some additional remarks about @@ -131,7 +142,7 @@ Suppose a user wants to perform a specific task from the Algoritmekader. To exec The first option is to execute the task locally by using the command line interface tool (CLI). The CLI tool imports the task from a Python library named `Tasks`. This library contains executable tasks that implement the measures and instruments from the `Instrument Register` (which are specified in the Algoritmekader). Instructions on how to perform these tasks are imported from the Instrument Register. There exists a one-to-one correspondence between measures and instruments in the `Instrument Register` and the task's within the `Tasks` library. -The second option is to use the Algorithm Management Toolkit (AMT). The user starts by visiting the Algorithm Management Toolkit website. Here, the user encounters a front end interface showing a planning board for projects and tasks. This planning board contains 3 columns: ‘To do’, ‘Doing’ and ‘Done’. When a user drags a task from ’To do’ to ‘Doing’, the front end makes an API call to the back end of the AMT. +The second option is to use the Algorithm Management Toolkit (AMT). The user starts by visiting the Algorithm Management Toolkit website. Here, the user encounters a frontend interface showing a planning board for projects and tasks. This planning board contains columns which correspond to the status of a task, like ‘To do’, ‘Doing’ and ‘Done’. When a user drags a task to another column or re-orders a task, the frontend makes an API call to the backend of the AMT. The backend consists of three components, showed in the component diagram at the end of this page. 1. An API application, which provides the project and tasks management functionality via HTTPS. @@ -140,13 +151,13 @@ The backend consists of three components, showed in the component diagram at the When receiving an API call, the application forwards the instruction to the business logic. The business logic, in turn, updates the system state and submits the task to the Redis message queue. The message queue stores the task messages until a Celery worker is ready to process a specific task. When a Celery worker is available, it uses the task library to execute the task. After the task is completed by the worker, the result is sent back to the business logic via the message queue. The business logic now sends an update to the system state and writes the result to the database. Finally, the business logic writes a System Card to an external repository. -Meanwhile, the API application sends regular heartbeats to the system state to check for updates. The system state receives updates from the business logic and checks for updates by reading from the database. When a state is updated (for example, a task is "done" or "failed with error X"), the business logic returns this to the API application. Using a websocket, the API application sends live updates back to the front end, to make sure the planning board stays up to date. +Meanwhile, the API application sends regular heartbeats to the system state to check for updates. The system state receives updates from the business logic and checks for updates by reading from the database. When a state is updated (for example, a task is "done" or "failed with error X"), the business logic returns this to the API application. Using a websocket, the API application sends live updates back to the frontend, to make sure the planning board stays up to date. ## Component diagram of the back end of the Algorithm Management Toolkit -Below is a component diagram of the back end of the Algorithm Management Toolkit, with some additional remarks about its components. +Below is a component diagram of the backend of the Algorithm Management Toolkit, with some additional remarks about its components. ```mermaid C4Component - title Component diagram for the back end of the Algorithm Management Toolkit System + title Component diagram for the backend of the Algorithm Management Toolkit System Boundary(b2, "Back End") { Container(State, "System State", "", "Provides the state of the
Algorithm Management Toolkit")