Skip to content

fabian-gubler/tapas

Repository files navigation

tapas-fs22

The master repository for the TAPAS application developed in Fall Semester 2022.

Project Description

Tapas is a practical software application developed as part of the Advanced Software and Systems Engineering course. It is a distributed system that allows teams to offer auctions for tasks, and other teams can bid on these auctions through an auction house. The project was designed to give students hands-on experience in using architectural patterns and state-of-the-art software engineering practices to conceive, build, test, and deploy a large-scale software-based system.

Project Structure

This project is structured as follows:

How to Add a New Service with Spring Boot

Create a new Spring Boot project

  • Recommended: use Spring Initialzr (Maven, Spring Boot 2.7.4, Jar, Java 17, dependencies as needed)
  • Set the Spring application properties for your service (e.g., port of the web server) in src/resources/application.properties

Update the Docker Compose file

Your TAPAS application is a multi-container Docker application ran with Docker Compose. To add your newly created service to the Docker Compose configuration file, you need to create a new service definition in docker-compose.yml:

  • copy and edit the tapas-tasks service definition from lines 44-57
  • change command (see line 46) to use the name of the JAR file generated by Maven for your service
    • note: if you change the version of your service, you need to update this line to reflect the change
  • update the Traefik label names to reflect the name of your new service (see line 52)
    • e.g., change traefik.http.routers.tapas-tasks.rule to traefik.http.routers.<new-service-name>.rule
  • update the Traefik rule (see line 53) with the name of your new service: Host(`<new-service-name>.${PUB_IP}.asse.scs.unisg.ch`)
  • update the Traefik port (see line 54) with the port configured for your new service

Update the local Docker Compose file

In the local docker compose file you need to copy and adjust lines 18-28.

Update the GitHub Actions Workflow

This project uses GitHub Actions to build and deploy your TAPAS application whenever a new commit is pushed on the main branch. You can add your new service to the GitHub Actions workflow defined in .github/workflows/build-and-deploy.yml:

  • copy and edit the definition for tapas-tasks from line 27-29
  • update the mvn command used to build your service to point to the pom.xml file of your new service (see line 28)
  • update the cp command to point to the JAR file of your new service directive (see line 29)
    • note you will need to update the complete file path (folder structure and JAR name)

How to Run the TAPAS Tasks Service Locally

You can run your micro-services on your local machine just like a regular Maven project:

  • Run from IntelliJ:
    • Reload pom.xml if necessary
    • Run the micro-service's main class from IntelliJ for all required projects
    • Adapt the run configuration for the main file to include the VM argument: -Dspring.profiles.active=local to let Spring Boot use the application-local.properties file (if available).
  • Use Maven to run from the command line:
mvn spring-boot:run -D"Spring-boot.run.profiles=local"
  • Run with local Docker:
docker compose -f docker-compose-local.yml up --build

How to Deploy on your VM

  1. Start your Ubuntu VM on Switch.
  2. Push new code to the main branch
    • Check the status of the workflow on the Actions page of the GitHub project
    • We recommend to test your project locally before pushing the code to GitHub.
  3. Open in your browser https://app.${PUB_IP}.asse.scs.unisg.ch

For the server IP address (see below), you should use dashes instead of dots, e.g.: 127.0.0.1 becomes 127-0-0-1.

VM Configurations

Specs (we can upgrade if needed):

  • 1 CPU
  • 2 GB RAM
  • 20 GB HD
  • Ubuntu 22.04
Name Server IP
SCS-ASSE-VM-Group1 86.119.35.40
SCS-ASSE-VM-Group2 86.119.35.213
SCS-ASSE-VM-Group3 86.119.34.242
SCS-ASSE-VM-Group4 86.119.35.199
SCS-ASSE-VM-Group5 86.119.35.72

Architecture Decision Records

We recommend to use adr-tools to manage your ADRs here in this GitHub project in a dedicated folder. The tool works best on a Mac OS or Linux machine.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9