This project is the TAPAS application developed by Group 1 during the ASSE FS21 course at the University of St.Gallen.
Go to file
2021-12-19 17:21:29 +01:00
.deployment humidity demo 2021-12-19 17:21:29 +01:00
.experiments chaos monkey tests 2021-11-28 18:20:36 +01:00
.github/workflows humidity demo 2021-12-19 17:21:29 +01:00
app Merge remote-tracking branch 'upstream/main' into dev 2021-11-21 12:14:26 +01:00
common Change type of ExecutorURI value to URI 2021-11-04 17:23:49 +01:00
doc Updated ADR on event driven microservices. 2021-12-02 23:39:21 +01:00
executor-base humidity demo 2021-12-19 17:21:29 +01:00
executor-computation fixes 2021-12-19 16:33:11 +01:00
executor-humidity pom fixes 2021-12-19 16:39:12 +01:00
executor-humidity-demo humidity demo 2021-12-19 17:21:29 +01:00
executor-pool Implemented the following points: 2021-12-16 20:39:14 +01:00
executor-robot fixes 2021-12-19 16:33:11 +01:00
mocks added ahCrawler and finished discovery endpoint 2021-12-06 03:32:15 +01:00
roster humidity demo 2021-12-19 17:21:29 +01:00
tapas-auction-house fixes 2021-12-19 16:33:11 +01:00
tapas-tasks bugfixes 2021-12-16 11:42:27 +01:00
.adr-dir Added the ADRs from last submission. These still need to be revised to reflect more recent design choices 2021-10-18 00:26:20 +02:00
.editorconfig edited editorconfig 2021-10-13 16:24:38 +02:00
.gitignore init 2021-10-06 10:23:17 +02:00
Californium3.properties bugfixes 2021-12-16 11:42:27 +01:00
docker-compose.yaml updates 2021-12-14 21:59:24 +01:00
LICENSE Initial commit 2021-10-04 09:13:00 +02:00
README.md added docker stuff for development 2021-10-06 10:23:57 +02:00

TAPAS

This is the main GitHub project for your implementation of the TAPAS application.

Run application in developent

We use Docker & docker-compose in development to easly start all the microservices and other needed application (db's, message-broker's) at once. All microservices have hot-reloads enabled by default!

Start

docker-compose up

Rebuild container

docker-compose up --build

Start detached

docker-compose up -d

Stop detached

docker-compose down

Available Services

Ports and debug ports of each service are listed below:

Name Port Debug Port
Tasklist 8081 5005
Assignment Service 8082 5006
Executor Pool 8083 5007
Executor 1 8084 5008
Executor 2 8085 5009

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.5.5, Jar, Java 11, 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 29-42
  • change command (see line 31) 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 lines 37-42)
    • e.g., change traefik.http.routers.tapas-tasks.rule to traefik.http.routers.<new-service-name>.rule
  • update the Traefik rule (see line 37) with the name of your new service: Host(`<new-service-name>.${PUB_IP}.nip.io`)
  • update the Traefik port (see line 39) with the port configured for your new service

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 28-30
  • update the mvn command used to build your service to point to the pom.xml file of your new service (see line 29)
  • update the cp command to point to the JAR file of your new service directive (see line 30)
    • note you will need to update the complete file path (folder structure and JAR name)

How to Run Your Service Locally

You can run and test your micro-service 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
  • Use Maven to run from the command line:
mvn spring-boot:run

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. The GitHub Organizations used in the course are on a free tier plan, which comes with various limits.
  3. Open in your browser https://app.<server-ip>.nip.io

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 20.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 you 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.