Skip to content

Commit

Permalink
Added Algoritmeregister to context diagram + text, fixed typo's, proc…
Browse files Browse the repository at this point in the history
…essed comments
  • Loading branch information
GuusjeJuijn authored and laurensWe committed Jun 6, 2024
1 parent 5b3ad0f commit b753995
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions docs/architecture/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 <br/>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 <br/>to execute instruments and measures")
UpdateRelStyle(InstrumentRegister, TAD, $offsetY="10", $offsetX="80")
Rel(Repository, Algoritmeregister, "Algorithm can be <br/> 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 <br/> 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 <br/>and instruments need to be exectued")
UpdateRelStyle(user0, Algoritmekader, $offsetY="-30", $offsetX="-200")
Rel(user0, TAD, "Executes the required <br/>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
Expand Down Expand Up @@ -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.
Expand All @@ -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 <br/>Algorithm Management Toolkit")
Expand Down

0 comments on commit b753995

Please sign in to comment.