Skip to content

Commit

Permalink
Merge pull request #204 from Onyxmoon/feature/readme-changes
Browse files Browse the repository at this point in the history
Feature/readme changes
  • Loading branch information
Onyxmoon authored Jan 17, 2024
2 parents dc0a535 + a2617fa commit 0694cb4
Show file tree
Hide file tree
Showing 46 changed files with 1,368 additions and 3,947 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create coverage badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Run Test
run: |
go test -v hsfl.de/group6/hsfl-master-ai-cloud-engineering/... -covermode=count -coverprofile=coverage.out
go test -v hsfl.de/group6/hsfl-master-ai-cloud-engineering/... -covermode=count -coverprofile=coverage.out --tags=integration
go tool cover -func=coverage.out -o=coverage.out
- name: Go Coverage Badge # Pass the `coverage.out` output to this action
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/run-tests-http-proxy-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ jobs:
with:
go-version: 1.21

- name: Install dependencies
working-directory: ./src/http-proxy-service
run: go mod tidy

- name: Build
working-directory: ./src/http-proxy-service
run: go build -v ./...

- name: Test Go Module
run: |
cd src/http-proxy-service
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/run-tests-lib-folder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,6 @@ jobs:
with:
go-version: 1.21

- name: Install dependencies for config
working-directory: ./lib/config
run: go mod tidy

- name: Install dependencies for router
working-directory: ./lib/router
run: go mod tidy

- name: Install dependencies for rpc
working-directory: ./lib/rpc
run: go mod tidy

- name: Build config library
working-directory: ./lib/config
run: go build -v ./...

- name: Build router library
working-directory: ./lib/router
run: go build -v ./...

- name: Build rpc library
working-directory: ./lib/rpc
run: go build -v ./...

- name: Test Go config Module
run: |
cd lib/config
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/run-tests-load-balancer-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ jobs:
with:
go-version: 1.21

- name: Install dependencies
working-directory: ./src/load-balancer-service
run: go mod tidy

- name: Build
working-directory: ./src/load-balancer-service
run: go build -v ./...

- name: Test Go Module
run: |
cd src/load-balancer-service
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/run-tests-product-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@ jobs:
with:
go-version: 1.21

- name: Install dependencies
working-directory: ./src/product-service
run: go mod tidy

- name: Build
working-directory: ./src/product-service
run: go build -v ./...

- name: Test Go Module
run: |
cd src/product-service
go test ./...
go test ./... --tags=integration
test_exit_code=$? # Capture the exit code of the go test command
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed successfully."
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/run-tests-shoppinglist-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@ jobs:
with:
go-version: 1.21

- name: Install dependencies
working-directory: ./src/shoppinglist-service
run: go mod tidy

- name: Build
working-directory: ./src/shoppinglist-service
run: go build -v ./...

- name: Test Go Module
run: |
cd src/shoppinglist-service
go test ./...
go test ./... --tags=integration
test_exit_code=$? # Capture the exit code of the go test command
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed successfully."
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/run-tests-user-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@ jobs:
with:
go-version: 1.21

- name: Install dependencies
working-directory: ./src/user-service
run: go mod tidy

- name: Build
working-directory: ./src/user-service
run: go build -v ./...

- name: Test Go Module
run: |
cd src/user-service
go test ./...
go test ./... --tags=integration
test_exit_code=$? # Capture the exit code of the go test command
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed successfully."
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/run-tests-web-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ jobs:
with:
go-version: 1.21

- name: Install dependencies
working-directory: ./src/web-service
run: go mod tidy

- name: Build
working-directory: ./src/web-service
run: go build -v ./...

- name: Test Go Module
run: |
cd src/web-service
Expand Down
10 changes: 10 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,13 @@ packages:
interfaces:
Controller:
Repository:
hsfl.de/group6/hsfl-master-ai-cloud-engineering/user-service/auth:
config:
dir: "./src/user-service/auth/_mock"
interfaces:
TokenGenerator:
hsfl.de/group6/hsfl-master-ai-cloud-engineering/user-service/crypto:
config:
dir: "./src/user-service/crypto/_mock"
interfaces:
Hasher:
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Price Whisper
![Coverage](https://img.shields.io/badge/Coverage-75.1%25-brightgreen)
![Coverage](https://img.shields.io/badge/Coverage-83.3%25-brightgreen)
![GitHub release (by tag)](https://img.shields.io/github/v/tag/onyxmoon/hsfl-master-ai-cloud-engineering.svg?sort=semver&label=Version&color=4ccc93d)
[![Run tests (lib folder)](https://github.com/Onyxmoon/hsfl-master-ai-cloud-engineering/actions/workflows/run-tests-lib-folder.yml/badge.svg)](https://github.com/Onyxmoon/hsfl-master-ai-cloud-engineering/actions/workflows/run-tests-lib-folder.yml)
[![Run tests (http proxy service)](https://github.com/Onyxmoon/hsfl-master-ai-cloud-engineering/actions/workflows/run-tests-http-proxy-service.yml/badge.svg)](https://github.com/Onyxmoon/hsfl-master-ai-cloud-engineering/actions/workflows/run-tests-http-proxy-service.yml)
Expand Down Expand Up @@ -41,7 +41,8 @@ The complete application can be deployed within a kubernetes cluster.
```shell
kubectl apply -R -f ./kubernetes/manifests
```

5. The main page can be accessed via the public port of the `HTTP Proxy Service` container.
Monitoring can be accessed via the Grafana public port. There is an example dashboard configuration file at [kubernetes/grafana](kubernetes/grafana/dashboard-config.json).
## Setup project in Docker
### Requirements
- Docker Compose version v2.23.3
Expand Down
24 changes: 24 additions & 0 deletions kubernetes/kubernetes-cluster/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Kubernetes Cluster Setup

This README guides you through the process of setting up a Kubernetes cluster with vms using Vagrant and Ansible. Ensure that you have all necessary dependencies installed, including Ansible, Vagrant, and any SSH tools needed.

## Steps to Follow

1. First, change to the `kubernetes-cluster` directory
2. Move your ssh public key into `kubernetes-cluster/ubuntu/vagrant/id_rsa.pub`
3. Start the vm deployment with `vagrant up`
4. Change, to the `ansible_playbooks` folder
5. Optional: Sometimes you have to specify the ansible config
```shell
export ANSIBLE_CONFIG=./ansible.cfg
```
6. Run `ansible-playbook setup.yaml` to setup cluster

> The first time the manifests are automatically deployed after commissioning, the distribution of the pods may not be uniform.

## Additional Notes
Ensure that Ansible is properly installed and configured on your system.
Verify that the SSH key has the correct permissions and is recognized by your system.
If you encounter any issues, consult the official Kubernetes and Ansible documentation for troubleshooting steps.
Conclusion
Following these steps should successfully set up a Kubernetes cluster using Ansible. For more detailed instructions or advanced configurations, refer to the Kubernetes and Ansible official documentation.
21 changes: 19 additions & 2 deletions kubernetes/manifests/price-whisper/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ stringData:
config.json: |
[
{
"username": "username",
"password": "changeMe!",
"username": "db-username",
"password": "db-pw-changeMe!",
"perms": [ "all" ]
},
{
Expand All @@ -20,13 +20,30 @@ stringData:
]
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: database-data
annotations:
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de>
spec:
capacity:
storage: 1Gi
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
hostPath:
path: /var/price-whisper/database-data/
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: database-data
namespace: price-whisper
annotations:
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de>
spec:
volumeName: database-data
accessModes:
- ReadWriteOnce
resources:
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/manifests/price-whisper/products.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
annotations:
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de>
stringData:
RQLITE_USER: "username"
RQLITE_PASSWORD: "changeMe!"
RQLITE_USER: "db-username"
RQLITE_PASSWORD: "db-pw-changeMe!"
---
apiVersion: v1
kind: ConfigMap
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/manifests/price-whisper/shoppinglists.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
annotations:
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de>
stringData:
RQLITE_USER: "username"
RQLITE_PASSWORD: "changeMe!"
RQLITE_USER: "db-username"
RQLITE_PASSWORD: "db-pw-changeMe!"
---
apiVersion: v1
kind: ConfigMap
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/manifests/price-whisper/test-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
annotations:
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de>
stringData:
RQLITE_USER: "username"
RQLITE_PASSWORD: "changeMe!"
RQLITE_USER: "db-username"
RQLITE_PASSWORD: "db-pw-changeMe!"
---
apiVersion: v1
kind: ConfigMap
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/manifests/price-whisper/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ metadata:
annotations:
author: Gruppe 6 <philipp.borucki@stud.hs-flensburg.de | dorien.groenwald@stud.hs-flensburg.de | jannick.lindner@stud.hs-flensburg.de>
stringData:
RQLITE_USER: "username"
RQLITE_PASSWORD: "changeMe!"
RQLITE_USER: "db-username"
RQLITE_PASSWORD: "db-pw-changeMe!"
JWT_PRIVATE_KEY: |
# provide ecdsa private key as string or container local file path
Expand Down
Loading

0 comments on commit 0694cb4

Please sign in to comment.