EGC-G2-tortilla / tortilla-hub

A fork of the UVLHub project by DiversoLab: tortilla-hub is a repository of feature models in UVL format integrated with Zenodo and flamapy following Open Science principles.
https://docs.uvlhub.io
0 stars 0 forks source link
Logo

TORTILLA-HUB

A fork of the UVLHub project by DiversoLab: tortilla-hub is a repository of feature models in UVL format integrated with Zenodo and flamapy following Open Science principles.



Pytest Testing Suite Commits Syntax Checker

Table of Contents


Overview

Tortilla-hub is a fork of the UVLHub project by DiversoLab, created for the Evolution and Configuration Management (Evolución y Gestión de la configuración - EGC) course in the Software Engineering degree at the University of Seville.

This project serves as a repository for feature models in UVL format, integrated with Zenodo and Flamapy. It includes various modifications made by students of the course, providing hands-on experience in a continuous integration and deployment environment. Students have practiced automating tests and checks using GitHub Actions and collaborating effectively within multiple teams.


Project Documentation

Tortilla-hub is a proyect made by two teams: tortilla-hub-1 and tortilla-hub-2. You can find all our documentation on the /docs folder in our common proyect.

There you may find our commmon working policy checking /docs/Acta fundacional.md and our specific group documentation in our respective group folder.


Project Structure

└── tortilla-hub.git/
    ├── .github/
    │   ├── ISSUE_TEMPLATE/
    │   └── workflows/
    ├── CHANGELOG.md
    ├── README.md
    ├── app/
    │   ├── modules/
    │   ├── static/
    │   └── templates/
    ├── core/
    │   ├── ...
    ├── docker/
    │   ├── ...
    ├── docs/
    │   ├── Acta fundacional.md
    │   ├── tortilla-hub-1/
    │   └── tortilla-hub-2/
    ├── migrations/
    │   ├── ...
    ├── requirements.txt
    ├── rosemary/
    │   ├── commands/
    │   └── templates/
    ├── scripts/
    │   ├── ...
    └── vagrant/
        ├── ...

Project Index

TORTILLA-HUB.GIT/
__root__
requirements.txt - Requirements.txt specifies the project's dependencies
- It lists numerous Python packages, including Flask for web framework, SQLAlchemy for database interaction, pytest for testing, and several libraries related to feature modeling (flamapy-*)
- These packages provide the necessary tools and components for building and running the application.
setup.py - `setup.py` configures the Rosemary project for installation
- It defines the project's metadata, lists dependencies (Click and python-dotenv), and specifies the command-line interface (`rosemary`) entry point, enabling users to easily interact with the UVLHub development environment via the command line.
migrations
script.py.mako - The script generates Alembic migration scripts for database schema changes.
env.py - `env.py` configures Alembic, a database migration tool, within a Flask application
alembic.ini - The `alembic.ini` file configures Alembic, a database migration tool, for the project
versions
This folder will contain the successive versions of the migrations made for the Flask project's database. The most recent one will have the highest version number.
002.py ❯ ...
001.py ❯ ...
rosemary
cli.py - Rosemary/cli.py provides a command-line interface (CLI) for streamlining project development
- It integrates various commands, including database management, testing, environment setup, code quality checks, and deployment aids
- The CLI acts as a central access point, simplifying common development tasks and improving workflow efficiency within the larger Rosemary project.
__main__.py - Rosemary's `__main__.py` serves as the application's entry point.
templates
...
commands
...
docker
docker-compose.prod.ssl.yml - The docker-compose.prod.ssl.yml file configures a production environment using Docker Compose
- It orchestrates the deployment of a web application, a MariaDB database, an Nginx reverse proxy, and Watchtower for automated container updates
- The configuration specifies container images, environment variables, port mappings, and volume mounts for persistent data and application resources.
docker-compose.dev.yml - The `docker-compose.dev.yml` file configures a multi-container development environment
- It defines services for a web application, a MariaDB database, and an Nginx reverse proxy
- The configuration facilitates local development by linking these services, managing environment variables, and setting up necessary volumes and networks for seamless interaction
- The setup enables developers to run and test the application locally.
docker-compose.prod.webhook.yml - The `docker-compose.prod.webhook.yml` file configures a production environment for a web application using Docker Compose
- It defines services for the application itself, a MariaDB database, and an Nginx web server, orchestrating their interactions and resource allocation
- The configuration includes environment variables, port mappings, volume mounts for persistent data and scripts, and ensures automatic restarts
- The setup facilitates deployment and management of the application within a containerized infrastructure.
docker-compose.prod.yml - Docker Compose orchestrates a production environment
- It defines and manages four containers: a web application, a MariaDB database, an Nginx reverse proxy, and a Watchtower for automated container updates
- The configuration maps local directories to containers, enabling persistent storage and deployment of application code, scripts, and configurations
- The setup ensures high availability and simplified deployment.
images This folder will contain the latest Docker images of the webhoock, database, prodcution and development application, and necessary test environments.
Dockerfile.prod ❯ ...
Dockerfile.webhook ❯ ...
Dockerfile.mariadb ❯ ...
Dockerfile.render ❯ ...
Dockerfile.locust ❯ ...
Dockerfile.dev ❯ ...
nginx This folder will contain the latest Docker images of the Nginx reverse proxy, and a Watchtower for automated container updates.
...
html
...
entrypoints
...
vagrant
04_install_dependencies.yml - The Ansible playbook configures the system to support the project's Python 3.12 environment.
02_install_mariadb.yml - The Ansible playbook `02_install_mariadb.yml` sets up a MariaDB database server
- It installs MariaDB and the necessary Python library, starts and enables the service, configures the root password, and creates specified databases and a user with appropriate privileges
.
01_setup.yml - `vagrant/01_setup.yml` prepares the system for provisioning by updating the apt package cache.
03_mariadb_scripts.yml - The `vagrant/03_mariadb_scripts.yml` Ansible playbook configures and initializes the MariaDB database.
06_utilities.yml - Ansible's `06_utilities.yml` configures the Vagrant user environment.
00_main.yml ❯ ...
Vagrantfile - The Vagrantfile configures a virtual machine using Ubuntu, setting up network ports, syncing folders, and provisioning via Ansible
- It loads environment variables from a `.env` file, making them accessible to the Ansible playbook and the virtual machine's shell environment
- This ensures consistent configuration and deployment across different environments.
05_run_app.yml ❯ ...
scripts
restart_container.sh ❯ ...
wait-for-db.sh ❯ ...
init-testing-db.sh ❯ ...
ssl_renew.sh ❯ ...
git_update.sh ❯ ...
ssl_setup.sh ❯ ...
clean_docker.sh ❯ ...
core
The core folder contains the core logic of the application: application setup, configurations, selenium configuration, serialicers and decorators, base templates, etc.
bootstraps
...
selenium
...
configuration
...
blueprints
...
serialisers
...
decorators
...
locust
...
resources
...
managers
...
repositories
...
seeders
...
environment
...
services
...
app The app folder cotains all the application logic: all the data models, the repositories and servers of the differrent modules, and the html files for the applications views.
templates Base templates for the html files and common error pages.
base_template.html ❯ ...
500.html ❯ ...
404.html ❯ ...
401.html ❯ ...
400.html ❯ ...
modules
conftest.py ❯ ...
pytest.ini ❯ ...
webhook This folder contains the logic related to handling webhooks (HTTP callbacks triggered by external services to notify your of certain events).
services.py ❯ ...
models.py ❯ ...
seeders.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
webhook
index.html ❯ ...
flamapy
services.py ❯ ...
models.py ❯ ...
seeders.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
flamapy
index.html ❯ ...
auth
The auth folder is dedicated to handling authentication and authorization functionalities. It contains code that manages user login, registration, password management, and permissions.
services.py ❯ ...
models.py ❯ ...
seeders.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
auth
signup_form.html ❯ ...
provide_email.html ❯ ...
login_form.html ❯ ...
hubfile
services.py ❯ ...
models.py ❯ ...
seeders.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
hubfile
index.html ❯ ...
dataset
This folder contains all the object modelling and business logic related to the datasets, which are one of the core elements of the uvl repository.
services.py ❯ ...
models.py ❯ ...
seeders.py ❯ ...
forms.py ❯ ...
api.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
uvl_examples
file6.uvl ❯ ...
file7.uvl ❯ ...
file5.uvl ❯ ...
file4.uvl ❯ ...
file1.uvl ❯ ...
file3.uvl ❯ ...
file2.uvl ❯ ...
file9.uvl ❯ ...
file12.uvl ❯ ...
file8.uvl ❯ ...
file10.uvl ❯ ...
file11.uvl ❯ ...
templates
dataset
upload_dataset.html ❯ ...
view_dataset.html ❯ ...
list_datasets.html ❯ ...
featuremodel
This folder contains all the data modelling and business logic behind the FeatureModel objects.
services.py ❯ ...
models.py ❯ ...
seeders.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
featuremodel
index.html ❯ ...
explore
services.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
explore
index.html ❯ ...
public
routes.py ❯ ...
templates
public
index.html ❯ ...
profile
The profile folder handles user-related functionalities that allow users to view, update, and manage their personal data.
services.py ❯ ...
models.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
profile
edit.html ❯ ...
summary.html ❯ ...
team
routes.py ❯ ...
templates
team
index.html ❯ ...
community
The comunnity folder contains all the data modelling, route, business logic and views of the communities.
services.py ❯ ...
models.py ❯ ...
seeders.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
community
community_info.html ❯ ...
community_members.html ❯ ...
community.html ❯ ...
index.html ❯ ...
create_community.html ❯ ...
fakenodo
The fakenodo folder contains all the services and models necessary to works with a mocked version of Zenodo. this will help to simulate as many calls to the Zenodyo API as they are necessary to test the application.
services.py ❯ ...
models.py ❯ ...
forms.py ❯ ...
repositories.py ❯ ...
routes.py ❯ ...
templates
index.html ❯ ...
.github It contains configuration files and scripts related to continuous integration (CI) and continuous deployment (CD). It includes YAML files that define workflows for GitHub Actions.
workflows
deployment_on_dockerhub.yml ❯ ...
codacy.yml ❯ ...
render.yml ❯ ...
versioning.yml ❯ ...
lint.yml ❯ ...
commits.yml ❯ ...
merge-migrations.yml ❯ ...
tests.yml ❯ ...
automatic_pr.yml ❯ ...
ISSUE_TEMPLATE
generic_issue.yml ❯ ...
reportar_incidencia.yml ❯ ...

Getting Started

Prerequisites

Before getting started with tortilla-hub.git, ensure your runtime environment meets the following requirements:

Installation

Install tortilla-hub.git using one of the following methods:

Deploy on Docker:

  1. Clone the tortilla-hub.git repository:

    ❯ git clone https://github.com/EGC-G2-tortilla/tortilla-hub.git
  2. Navigate to the project directory:

    ❯ cd tortilla-hub
  3. Create a local environment:

    ❯ python -m venv .evn
    ❯ cp .env.docker.example .env
    ❯ source .env/bin/activate
  4. Install the project dependencies:

Using pip  

❯ pip install -r requirements.txt
❯ deactivate
  1. Deploy in develop:
    ❯ docker compose -f docker/docker-compose.dev.yml up -d 

Deploy locally:

For more detailed information check https://docs.uvlhub.io/installation/manual_installation.

Usage

Run tortilla-hub.git using the following command: Using pip  

❯ python {entrypoint}

Testing

Unit tests Run the unit test suite using the following command:

❯ rosemary test

If you want to run specific test modules:

❯ rosemary test <module name>

Frontend tests using Selenium Run the unit test suite using the following command:

❯ rosemary selenium

If you want to run specific test modules:

❯ rosemary selenium <module name>

Load tests using Locust Run the unit test suite using the following command:

❯ rosemary locust

If you want to run specific test modules:

❯ rosemary locust <module name>

Acknowledgments

In this section you can find all the contributors of each team:

Tortilla Hub 1:

Delfín Santana Rubio
Delfín Santana Rubio
Antonio Macías Ferrera
Antonio Macías Ferrera
Guadalupe Ridruejo Pineda
Guadalupe Ridruejo Pineda
José Miguel Iborra
José Miguel Iborra
Daniel Vela Camacho
Daniel Vela Camacho
Pablo Fernández Pérez
Pablo Fernández Pérez
Benjamín Ignacio Maureira Flores
Benjamín Ignacio Maureira Flores

Tortilla Hub 2:

Daniel Fernández Caballero
Daniel Fernández Caballero
Manuel Francisco Barcia Jiménez
Manuel Francisco Barcia Jiménez
Ramón Gavira Sánchez
Ramón Gavira Sánchez
Rafael Pulido Cifuentes
Rafael Pulido Cifuentes
Daniel Ruiz López
Daniel Ruiz López
Alberto Carmona Sicre
Alberto Carmona Sicre