Author: Franco Gil
To install the quantitative analysis tool, three (3) main components will be necessary:
- Archi application (stable version 4.10.0).
- jArchi plug-in for the Archi application (stable version 1.20.0).
- Web service defined in this project (
quantitative_analysis
) in its most recent stable version.
It will explain how to install and configure each component, as graphic elements images will be added to assist in configuration flows.
Notes:
- The Archi application and the Web Service have been tested on a Linux Operating System under the Ubuntu 20.04 distribution.
- Some of the installation steps will require interaction with a terminal (Shell).
As an initial step, you must download the Archi 4.10.0 application, for now it will be available at:
In case Archi 4.10.0 is not the most recent stable version, it can also be found here:
Once the tool has been downloaded, the resources will be extracted.
tar -xvf Archi-Linux64-4.10.0.tgz
Once the jArchi plug-in is installed within the Archi tool, the application will be executed.
Run the file "Archi".
The first time the Archi application is launched, it will appear with the following welcome interface:
At this point, the jArchi plug-in should be installed, continue with the next sections.
This plug-in (jArchi) has its source code available at:
The generation of the packages object for Java is outside the scope of this installation guide. That is why they will be used packages already available for integration with the Archi application.
jArchi v1.2.0 https://drive.google.com/file/d/1v04bh5Kk-dz6Qgv5KBOV3sYaAlPAt8nQ
jArchi v1.2.1 https://drive.google.com/file/d/1_W8uRECG_uOWJ_j64lKE-Dln7bpmsI0T
To install the jArchi plug-in, the Archi application must already be installed and running.
Select the Help -> Manage Plug-ins
option
Next, the Install New
option is selected
In the window to explore directories, look for the compressed file with extension .zip
or .archimate
downloaded in the section Download jArchi plug-in.
Select the file and click Open
.
Once the plug-in is installed, the Archi application will indicate that a restart of the application is necessary to complete the installation,
click on Yes
.
If when you select the Help -> Manage Plug-ins
option again you do not see the installed plug-in, follow the flow in the next section.
Open a shell in the directory where the jArchi plug-in has been downloaded and copy the items inside the dropins/
directory
of the Archi application.
# Debian, Ubuntu
unzip jArchi_1.2.0.202110121451.archiplugin.zip -d user.home/.archi4/dropins
# Mac
unzip jArchi_1.2.0.202110121451.archiplugin.zip -d user.home/Library/Application Support/Archi4/dropins
Once the Archi application is instantiated again, select the option to create a new diagram or continue using the application.
Repeat the Help -> Manage Plug-ins
flow and see if the plugin is installed.
In order to execute the scripts written for the plugin as expected, the plugin must be configured:
- Change the interpreter to Nashhorn 6:
- Indicate the path of scripts from where they will be executed.
At this point it will be possible to download the Web Service that contains interfaces to run the application in a more simple, display and download the results of the simulations.
The quantitative_analysis
project contains elements to deploy the "Web Service", it can be downloaded from the following link:
Since the project is hosted from the GitHub
source code versioning tool, it has several ways to download
Projects. This time we will download the project from the terminal (Shell).
git clone git@github.com:realFranco/quantitative_analysis.git
Once the project is downloaded, open a terminal in the quantitative_analysis/
directory.
As previous dependencies, the user's host must have at least Python
installed in its stable version 3.8.10
cd web_service/backend
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.in
To run the service correctly, some resources are necessary:
-
Archimate diagram valid for the Archi application. An Archi diagram can be exported from the option
File -> Save As
, this diagram and the necessary ones should be copied to theresources/archi_diagram_example/
directory -
Amazon Web Services (AWS) CloudWatch logs. It is out of the scope of this guide how to configure an architecture in AWS that generate log metrics on the AWS CloudWatch Insights service, an image will be added that reflects a little how the logs usable by the infrastructure are consulted and exported.
The following syntax is a particular AWS CloudWatch Insights language that will allow you to query and filter logs within from service.
Query to collect compute metrics:
fields request_id,@message
Query to collect execution status:
fields @requestId,code
| filter code like /.+/
The previous queries will generate logs and these must be exported in .json
format, store these
two files as they will be useful in later Web Service flows.
To expand the reference on the AWS CloudWatch Insights query syntax, see the following links:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax-examples.html
There is a Makefile
file to help during the service installation and configuration, make sure that you set the correct
environment variables (see bellow):
# Install dependencies.
make install
# Execute unit test.
make test
# Apply changes along the source code related with location resources.
make tunning
# Serve the web service on the host.
make run
You can also follow the step by step section:
-
In the section Create a virtual environment and install dependencies If you already had a terminal (Shell) available, use it again or use a new one.
-
Generate environment variables:
# Go to the web_service/backend/ directory
cd web_service/backend
# Create the file with the environment variables and edit the variables as necessary
cp dist.env .env
An example of the environment variables to be defined are the following (Linux and Mac only):
# Directory. Replace the current value with the folder container for "Archi".
# Archi runnable example on Linux.
ARCHI_RUNNABLE=/home/diuble-lig/Desktop/archi/Archi/Archi.sh
# Archi runnable example on Mac.
ARCHI_RUNNABLE=/Applications/Archi.app/Contents/MacOS/Archi
# Project name. If you change the name for the current project, also change this value.
PROJECT_NAME=quantitative_analysis
# Directory. Absolute route from the host to the project, if you change the project directory structure, also change this value.
# Project location example on Linux.
PROJECT_LOCATION=/home/diuble-lig/Desktop/archi/Archi/${PROJECT_NAME}/
# Project location example on Mac.
PROJECT_LOCATION=/Users/user.home/Documents/DEV/${PROJECT_NAME}/
# Localhost address to communicate between client and server.
PROJECT_HTTP_PROTOCOL=http
PROJECT_LOCALHOST=127.0.0.1
PROJECT_PORT=8000
PROJECT_LOCALHOST_URL=${PROJECT_HTTP_PROTOCOL}://${PROJECT_LOCALHOST}:${PROJECT_PORT}
# Location file where put the configurations for jArchi scripts.
SCRIPT_CONFIG_LOCATION=resources/jArchiConfigResources.json
# Location file for the result file after run some jArchi scripts.
COMPUTE_RESOURCE_LOCATION=resources/jArchiComputeResources.json
# Location file where put the Quantitative Analysis results.
QUANTITATIVE_ANALYSIS_RESULT_LOCATION=resources/jArchiQuantitativeAnalysisResults.json
- Go to the
web_service/backend/
directory and run themain.py
web service entry point:
cd web_service/backend
source venv/bin/activate
python3 main.py
- Informative messages about the instantiated service will appear inside the terminal, including a web address.
http://127.0.0.1:8000
(as long as the environment variables defined in.env
are kept by default) give Click it to display the Web Service interface.
Next, iconographies and information on the use of the Web Service interface will be shown.
- Click the
Search input files
button - A modal will open, select the option
Amazon Web Services
- In the
Log files
entry, "search" the log files- Locate the downloaded
.json
in the section Add necessary elements for the execution of the tool and select them
- Locate the downloaded
- Click on
Upload files
- Click the
Run Archi
button - Stop and look at the image carousel in the
Image Sequence' section to learn how to run simulations
with the objective of knowing the flows to follow before executing the Quantitative Analysis script - In the input
Select Archimate diagram
choose the corresponding diagram on which to apply the Quantitative Analysis - In the input
Select the initial object to start the simulation
choose an element of the diagram on which to start the Quantitative Analysis - Click the
Run Archi
button of the modal
-
After having executed at least one (1) time the Quantitative Analysis scripts within the Archi tool, click on the
Reload
button enabling theShow results
button -
Two sections will be displayed, a heat map next to a table and below two tables with values
-
In the table with the title
Simulations History
each row can be clicked, this action will show in the table with the titleResults Table | Tabulated
the results of that particular simulation -
Clicking on the
Clear
button will delete the simulation results and hide the results sections -
To export the results of the selected simulation or the most recent one executed, click on the
Download Results
button, this will show an interface indicating to the user that he is going to download a file