Skip to content

Commit

Permalink
Release v0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
realFranco committed Jan 22, 2023
1 parent 1e24754 commit 34f632f
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 80 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,3 @@ dmypy.json

# Pyre type checker
.pyre/

# Development resources to be ignored.

dev.info
/dev.assets/
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
all:
@ echo "You must define an option: 'install', 'test', 'tuning' or 'run'.\n"
.PHONY: all

install:
@ cd web_service/backend && \
python3 -m venv venv && \
source venv/bin/activate && \
pip3 install -r requirements.in
.PHONY: install

test:
@ cd web_service/backend && \
source venv/bin/activate && \
python3 -m pytest test/
.PHONY: test

tuning:
@ cd web_service/backend && \
source venv/bin/activate && \
python3 src/tuning.py
.PHONY: tuning

run:
@ cd web_service/backend && \
source venv/bin/activate && \
uvicorn main:app --reload
.PHONY: run
47 changes: 40 additions & 7 deletions docs/INSTALL_GUIDE_ENG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ At this point, the jArchi plug-in should be installed, continue with the next se
## jArchi Plugin
----

### Download jArchi plugin
### Download jArchi plug-in
----

This plug-in (jArchi) has its source code available at:
Expand All @@ -93,7 +93,9 @@ 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.

> https://drive.google.com/file/d/1v04bh5Kk-dz6Qgv5KBOV3sYaAlPAt8nQ
> 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
![jarchi.1.png](../resources/doc_images/jarchi.1.png)

Expand All @@ -110,7 +112,7 @@ 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](#download-plug-in-jarchi).
In the window to explore directories, look for the compressed file with extension `.zip` or `.archimate` downloaded in the section [Download jArchi plug-in](#download-jarchi-plug-in).

![arch.10.png](../resources/doc_images/archi.10.png)

Expand All @@ -124,11 +126,15 @@ If when you select the `Help -> Manage Plug-ins` option again you do not see the
### Install jArchi plug-in (alternative method)
----

Open a shell in the directory where the jArchi plug-in has been downloaded and copy the items to the `Archi/plugins/` directory
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.

```shell
unzip jArchi_1.2.0.202110121451.archiplugin.zip -d Archi/plugins/
# 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.
Expand Down Expand Up @@ -244,7 +250,24 @@ To expand the reference on the AWS CloudWatch Insights query syntax, see the fol
#### Execute Web Service
----

The following steps will allow the Web Service to be executed:
There is a `Makefile` file to help during the service installation and configuration, make sure that you set the correct
environment variables (see bellow):

```shell
# 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](#create-a-virtual-environment-and-install-dependencies)
If you already had a terminal (Shell) available, use it again or use a new one.
Expand All @@ -260,18 +283,28 @@ The following steps will allow the Web Service to be executed:
cp dist.env .env
```

An example of the environment variables to be defined are the following (tested on an Ubuntu-based Linux Operating System):
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
Expand Down
59 changes: 46 additions & 13 deletions docs/INSTALL_GUIDE_ESP.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Se explicará cómo instalar y configurar cada componente, como elementos gráfi
para ayudar en los flujos de configuración.

> Notas:
> 1. La aplicación Archi y el Servicio Web se han probado en un Sistema Operativo Linux bajo la distribuión Ubuntu 20.04.
> 1. La aplicación Archi y el Servicio Web se han probado en un Sistema Operativo Linux bajo la distribución Ubuntu 20.04.
> 2. Algunos de los pasos de instalación requerirán interacción con un terminal (Shell).
## Aplicación Archi
Expand All @@ -45,15 +45,15 @@ para ayudar en los flujos de configuración.
### Instalar Aplicación Archi
----

Como paso inicial se debe descargar la aplicacion Archi 4.10.0, de momento estará disponible en:
Como paso inicial se debe descargar la aplicación Archi 4.10.0, de momento estará disponible en:

> https://www.archimatetool.com/download/
![archi.1.png](../resources/doc_images/archi.1.png)

![archi.2.png](../resources/doc_images/archi.2.png)

En caso de que la versión de Archi 4.10.0 no sea la versión estable más reciente, esta también se podrá encontrar aqui:
En caso de que la versión de Archi 4.10.0 no sea la versión estable más reciente, esta también se podrá encontrar aquí:

> https://www.archimatetool.com/archive/
Expand Down Expand Up @@ -93,7 +93,9 @@ Este plug-in (jArchi) tiene su código fuente disponible en:
La generación del objeto packages para Java está fuera del alcance esta guía de instalación. Es por ello que se utilizarán
packages ya disponibles para su integración con la aplicación Archi.

> https://drive.google.com/file/d/1v04bh5Kk-dz6Qgv5KBOV3sYaAlPAt8nQ
> 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
![jarchi.1.png](../resources/doc_images/jarchi.1.png)

Expand Down Expand Up @@ -124,14 +126,18 @@ Si al seleccionar nuevamente la opción `Help -> Manage Plug-ins` no se observa
### Instalar plug-in jArchi (método alternativo)
----

Abrir un terminal (Shell) en el directorio donde se ha descargado el plug-in jArchi y copiar los elementos en el directorio `Archi/plugins/`
Abrir un terminal (Shell) en el directorio donde se ha descargado el plug-in jArchi y copiar los elementos en el directorio `dropins/`
de la aplicación Archi.

```shell
unzip jArchi_1.2.0.202110121451.archiplugin.zip -d Archi/plugins/
# 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
```

Una vez que la aplicacion Archi vuelva a instanciarse, seleccionar la opción de crear un nuevo diagrama o continuar con la utilización de la aplicación.
Una vez que la aplicación Archi vuelva a ejecutarse, seleccionar la opción de crear un nuevo diagrama o continuar con la utilización de la aplicación.

Repetir el flujo `Help -> Manage Plug-ins` y observar si el plugin está instalado.

Expand All @@ -155,7 +161,7 @@ Con el objetivo de ejecutar los scripts escritos para el plugin de forma esperad
![archi.16.png](../resources/doc_images/archi.16.png)
- Se abrirá un explorador de directorios, seleccionar el directorio `scripts/` del proyecto `quantitative_analysis` y luego click en `Open`
![archi.17.png](../resources/doc_images/archi.17.png)
- En la ventana de `Preferences` dar clcick en `Apply and Close` para confirmar cambios
- En la ventana de `Preferences` dar click en `Apply and Close` para confirmar cambios

En este punto ya se podrá descargar el Servicio Web que contiene interfaces para ejecutar la aplicación de manera más
sencilla, mostrar y descargar los resultados de las simulaciones.
Expand All @@ -170,7 +176,7 @@ El proyecto `quantitative_analysis` contiene elementos para desplegar el "Servic
### Descargar Servicio Web
----

El proyecto al estar hosteado desde la herramienta para versionado de código fuente `GitHub` posee varias maneras de descargar
El proyecto al estar disponible desde la herramienta para versionado de código fuente `GitHub` posee varias maneras de descargar
proyectos. Esta vez descargaremos el proyecto desde la terminal (Shell).

![web.1.png](../resources/doc_images/web.1.png)
Expand Down Expand Up @@ -236,15 +242,32 @@ dos archivos ya que serán útiles en flujos posteriores del Servicio Web.

![aws.2.png](../resources/doc_images/aws.2.png)

Para ampliar las referencia sobre la sintáxis de consulta de AWS CloudWatch Insights observar los siguientes enlaces:
Para ampliar las referencia sobre la sintaxis de consulta de AWS CloudWatch Insights observar los siguientes enlaces:

> https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html
> https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax-examples.html
#### Ejecutar Servicio Web
----

Los siguientes pasos van a permitir ejecutar el Servicio Web:
Existe un archivo `Makefile` para ayudar en la instalación y configuración, como precondición define de manera correcta
las variables de entorno (observe en las siguientes secciones):

```shell
# 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
```

También puedes seguir la instalación y configuración paso a paso:

- En la sección [Crear un entorno virtual e instalar dependencias](#crear-un-entorno-virtual-e-instalar-dependencias)
ya se tenía un terminal (Shell) disponible, volver a utilizarlo o bien utilizar uno nuevo.
Expand All @@ -260,18 +283,28 @@ Los siguientes pasos van a permitir ejecutar el Servicio Web:
cp dist.env .env
```

Un ejemplo de las variables de entorno a ser definidas son las siguientes (probado en un Sistema Operativo Linux basado en Ubuntu):
Un ejemplo de las variables de entorno a ser definidas son las siguientes (válido para Linux y Mac):

```
# 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
Expand All @@ -298,7 +331,7 @@ Los siguientes pasos van a permitir ejecutar el Servicio Web:
python3 main.py
```

- Dentro del terminal aparecerán mensajes informativos sobre el servicio instanciado, entre ellos aparecerá una dirección web.
- Dentro del terminal aparecerán mensajes informativos sobre el servicio ejecutado, entre ellos aparecerá una dirección web.
`http://127.0.0.1:8000` (siempre y cuando las variables de entorno definidas en `.env` se mantengan por defecto) dar
click en ella para mostrar la interfaz del Servicio Web.

Expand Down
1 change: 1 addition & 0 deletions resources/archi_diagram_example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.bak
Loading

0 comments on commit 34f632f

Please sign in to comment.