forked from maeddes/hse-24-summer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from vivoit00/develop
Project (almost) finished
- Loading branch information
Showing
47 changed files
with
231 additions
and
1,896 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,171 +1,69 @@ | ||
# 2024-March-11 Cloud and Semester Introduction | ||
# Todo Application Setup Guide | ||
|
||
## Initial Brainstorming Session - Technologies and Motivators for Distributed Systems | ||
## Overview | ||
|
||
![Brainstorming](/pics/2024-03-11-DistributedSystemsBrainstorm.png) | ||
Application with a Thymeleaf Frontend, Django Backend and PostgreSQL Database. | ||
|
||
### Content | ||
|
||
* Why distributed systems, why container, why modern software? | ||
* What is Cloud Computing? Encounters in everyday life and history | ||
* Characteristic, advantages & challenges | ||
* Terminology - public, private, hybrid, dedicated | ||
* Abstraction layers - IaaS, PaaS, FaaS, SaaS | ||
* Overview - Hypervisors, virtual machines, containers and orchestration | ||
|
||
### Objectives and exercises | ||
_The student is able to describe the reasons for distributed systems and | ||
cloud computing in own words and list examples for offerings, topologies and technologies. Includes ability to differentiate between different abstraction layers and knowledge how those layers and according technologies interact with each other. No exercises in this module_ | ||
|
||
### Student Questions | ||
## Steps to Run | ||
|
||
* What is Polyglot Software Development? | ||
* What did the role of containers change for polyglot software? | ||
* Security and Cloud - is it safe? :-) | ||
1. Clone the repository: | ||
|
||
![Polyglot Container](/pics/2024-03-11-ContainerVsTraditional.png) | ||
```sh | ||
git clone https://github.com/vivoit00/PuVS-to-do-list | ||
cd PuVS-to-do-list/sample/otel-in-action | ||
git checkout develop | ||
``` | ||
|
||
### Outlook for Labs | ||
2. Build and run the containers: | ||
|
||
* Distributed app | ||
* Polyglot implementation | ||
* Containerisation | ||
* Kubernetes | ||
* DevOps/CICD/Observability (optional) | ||
```sh | ||
docker-compose up --build | ||
``` | ||
|
||
![Exercise Tech Stack](/pics/2024-03-11-Blackboard.jpg) | ||
3. Access the services: | ||
- Django Backend: `https://localhost:8080` | ||
- Thymeleaf Frontend: `https://localhost:8090` | ||
|
||
### Homework | ||
## Endpoints | ||
|
||
* Get a public GitHub, GitLab or Bitbucket account | ||
* Play around with GitHub codespaces and/or Gitpod | ||
|
||
# 2024-March-18 Session canceled | ||
|
||
# 2024-March-25 Cloud-based IDEs Intro & Docker/Container | ||
### Get All Todos | ||
|
||
### Content | ||
* Why do we need Containers? | ||
* Challenges for (polyglot) distributed systems in traditional IT: | ||
- **URL:** `/todos/` | ||
- **Method:** GET | ||
- **Response:** List of todo items in plain text | ||
|
||
* Each environment has to be configured manually: Servers as well as local dev environments | ||
* Configuration has to be as identical as possible: minor configuration drifts can lead to errors and the "it runs on my machine" problem | ||
* Polyglot Server Environments are a huge challenge as for each programing language a separate configuration has to be managed on all systems. | ||
* Changing Versions is tedious for local dev environment | ||
### Add a Todo | ||
|
||
![image](https://github.com/maeddes/hse-24-summer/assets/22505258/63a76e4b-cd0e-4f9d-8e6e-cb7b364d4581) | ||
- **URL:** `/todos/{toDo}` | ||
- **Method:** POST | ||
- **Path Parameter:** | ||
- `toDo`: The name of the todo item to be added | ||
- **Response:** The added todo item in plain text | ||
|
||
* Whereas containerized Applications bring their own Environment and Configuration | ||
* No need to preconfigure the local environment per programming language or application. | ||
* Only the container engine is required to run all kinds of containers. | ||
|
||
![image](https://github.com/maeddes/hse-24-summer/assets/22505258/35dfe922-1c43-46db-a419-4c602dd084dc) | ||
### Delete a Todo | ||
|
||
* How does the container engine work? | ||
* Layer-based setup of containers | ||
* Container vs Container Image | ||
* How to create a container from application to dockerfile to image to running container | ||
- **URL:** `/todos/{toDo}` | ||
- **Method:** DELETE | ||
- **Path Parameter:** | ||
- `toDo`: The name of the todo item to be deleted | ||
- **Response:** 204 No Content if successful | ||
|
||
![image](https://github.com/maeddes/hse-24-summer/assets/22505258/bcad4374-da59-429a-8272-1b42642c888c) | ||
### Example Usage | ||
|
||
### Student Questions: | ||
* Do I have to set up, build, and run the dockerfile for each container? | ||
* Can I run multiple applications inside a container? | ||
#### Get all Todos | ||
```sh | ||
curl https://localhost:8080/todos/ | ||
``` | ||
|
||
### Labs | ||
Exercises can be found [here](https://lecture.new.trainings.nvtc.io/basics/container/) | ||
#### Add a Todo | ||
```sh | ||
curl -X POST https://localhost:8080/todos/NewItem | ||
``` | ||
## Configuration | ||
The `docker-compose.yaml` file contains all the needed configurations for frontend, backend <br> | ||
and database | ||
|
||
|
||
# 2024-April-8th Spring Boot Intro & HTTP/REST | ||
|
||
## Spring Boot | ||
|
||
![Spring Boot typical flow](https://raw.githubusercontent.com/maeddes/hft-2022-winter/main/pics/spring_boot_initializr_flow_2022_10_17.png) | ||
|
||
* Background: Spring Framework - History & components | ||
* Spring ← → Spring Boot | ||
* Spring Initializr (start.spring.io) & starter dependencies | ||
* Basic project structure (folders, configuration ..) | ||
* "Hello, World!" example explained | ||
* Using Actuator | ||
|
||
### Objectives | ||
|
||
The student is able to build and configure an own Spring Boot application from scratch with the IDE of choice. The exercise is to build an own "Hello, World!" application that exposes various - endpoints and is able to execute CRUD operations on the state of the application. Optional: Add logging and testing, configure Actuator. | ||
|
||
### Review questions | ||
|
||
* "WHY Spring Boot?" Provide 3 advantages of this framework | ||
* Describe Spring Boot to somebody not familiar with it in own words () | ||
* How do you start building a Spring Boot app? Initializr & Dependencies | ||
* List 4 different starter dependencies and explain briefly what they do (old question) (4P) | ||
"I did not do my lab task with Spring Boot. I implemented using Python and I can tell you how it works there ..." | ||
|
||
### Helpful Links: | ||
|
||
- https://start.spring.io | ||
- https://www.baeldung.com/spring-requestmapping | ||
- https://www.baeldung.com/spring-boot-actuator-enable-endpoints | ||
|
||
## REST | ||
|
||
![REST, Controllers, Representations](https://github.com/maeddes/hft-23-winter/blob/main/pics/REST_stuff.png) | ||
|
||
* Synchronous communication | ||
* HTTP and REST | ||
* Verbs, Resources, Nouns | ||
* Evolution, Richardson Maturity Model | ||
* CRUD Operations | ||
* Building a REST API with Spring (Boot) | ||
* Building a data model with REST | ||
|
||
### Links: | ||
|
||
* https://restfulapi.net/idempotent-rest-apis/ | ||
* https://restfulapi.net/richardson-maturity-model/ | ||
* https://en.wikipedia.org/wiki/List_of_HTTP_status_codes | ||
|
||
* https://www.baeldung.com/spring-requestmapping | ||
* https://www.baeldung.com/spring-request-response-body | ||
* https://www.baeldung.com/spring-rest-openapi-documentation | ||
* https://www.baeldung.com/spring-cors | ||
|
||
### Review questions | ||
|
||
* Identify good and bad API examples and explain why | ||
* Describe the concepts of Verbs and Nouns | ||
* When is an invocation idempotent and safe? What does it mean? Provide examples | ||
* Describe in your own words the mapping of REST calls to database (SQL) and CRUD calls | ||
|
||
### Objectives and exercises | ||
_The student understands the concepts of an API and synchronous communication in distributed systems and can explain it in own words._ | ||
|
||
# 2024-April-15th Distributed Application Sample / Outlook Lab / Docker Advanced topics - TODO :-) | ||
|
||
# 2024-April-22nd Cloud-native Software development - Theory part | ||
|
||
Cloud-native Software development - Theory part | ||
|
||
Theory lecture - Cloud-Native Software | ||
|
||
* CAP Theorem | ||
* Conway's Law | ||
* Fallacies of distributed computing | ||
* Domain-Driven Design basics (not relevant for exam) | ||
* 12-factor application | ||
* Evolution of applications and deployments: Monolithic -> Service-Oriented Architecture -> Microservices | ||
* Introduction to serverless and FaaS terminology | ||
|
||
### Objectives and exercises | ||
_The student knows about the evolution of distributed systems (and middleware) and the drivers towards state-of-the-art implementation and deployment. She/he can explain the underlying concepts and theories and put it into practical context. No dedicated exercises for this module. Recap of basics: Spring Boot, Docker, configuration._ | ||
|
||
### Review questions | ||
|
||
* "WHY" Cloud-Native Software? What IS Cloud-Native Software? | ||
* Why "evolution" from a monolithic approach to a distributed approach? | ||
* How does the CAP Theorem/Conway's Law relate to this? | ||
* (NO Domain-Driven Design questions) | ||
* How do the 12-factor application "methodology" relate to the technologies that we covered in this semester? (important) | ||
* "WHY" is external configuration important in cloud-native software? | ||
* Where did you see aspects of external configuration in the technologies we used? Provide examples | ||
* What is the advantage of polyglot applications? Why in particular for cloud-native software? What kind of disadvantages do you see? |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.