Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add message bus #56

Merged
merged 47 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ba4fa31
Add messagebus to docker compose file
oveldman Aug 26, 2024
4a4ed80
Add basic message bus to the projects
oveldman Aug 27, 2024
2c57224
Start with query consumer
oveldman Aug 27, 2024
0238223
Add command to the messagebus
oveldman Aug 28, 2024
4f689a6
Push events to grpc
oveldman Aug 29, 2024
06dc3ab
Update new version
oveldman Sep 23, 2024
bd5e7c1
Get Message Bus Status in Admin bff
oveldman Sep 25, 2024
905a9ac
Add Post message bus in admin bff
oveldman Sep 25, 2024
ae5c847
Start with SignalR
oveldman Sep 25, 2024
9cb8952
Send event to signalR
oveldman Sep 27, 2024
e7b3aeb
Finish events to web socket. Only frontend left
oveldman Sep 27, 2024
0f8eceb
Start with test page
oveldman Sep 27, 2024
58fa744
Add get request in the admin frontend
oveldman Sep 28, 2024
964fa56
Set post request in admin
oveldman Sep 28, 2024
0a1a715
Add SignalR
oveldman Sep 29, 2024
e410222
Fix docker compose to start up message bus status test
oveldman Sep 29, 2024
ddfe0c7
Refactor csproj files
oveldman Sep 29, 2024
7dc22e6
Update nuget packages
oveldman Sep 29, 2024
1a34f1a
Update Readme
oveldman Sep 29, 2024
50e2ed4
Start with kubernetes
oveldman Sep 29, 2024
e1e979c
Finish kubernetes
oveldman Sep 29, 2024
6d117a5
Start with test containers
oveldman Oct 3, 2024
be55c41
Can override config settings in integration tests + test containers
oveldman Oct 4, 2024
9be417d
Fix messagebus in one of the tests
oveldman Oct 4, 2024
e279e4b
Add comment
oveldman Oct 4, 2024
3129dba
Fix all integration tests
oveldman Oct 5, 2024
395f757
Try new sonarqube
oveldman Oct 5, 2024
add2b78
Fix tool
oveldman Oct 5, 2024
2ff2680
Remove powershell
oveldman Oct 5, 2024
9290669
Fix pipeline
oveldman Oct 5, 2024
2fdc9b4
Fix build on linux
oveldman Oct 5, 2024
717192f
Install android sdk
oveldman Oct 5, 2024
69a0c7d
Fix it
oveldman Oct 5, 2024
4454dbc
Fix
oveldman Oct 5, 2024
668afcf
Install android
oveldman Oct 5, 2024
bd229b0
Fix android
oveldman Oct 5, 2024
2021129
Fix again
oveldman Oct 5, 2024
c5463e1
Try again
oveldman Oct 5, 2024
73ea30c
Fix C# sonarqube
oveldman Oct 5, 2024
c4b100a
Start feedback kubernetes
oveldman Oct 5, 2024
4a0d639
RunAsync
oveldman Oct 5, 2024
1b8a5fc
Remove some feedback
oveldman Oct 5, 2024
d5d7c16
Add service account in kubernetes
oveldman Oct 6, 2024
6442bca
Feedback
oveldman Oct 6, 2024
be0bc22
Fix
oveldman Oct 6, 2024
97aa08c
Add cpu to kubernetes
oveldman Oct 6, 2024
5076cfd
Change to new version
oveldman Oct 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions .github/workflows/sonarqube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ on:
jobs:
build:
name: Build and analyze
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: Set up Docker
run: |
docker version
docker pull postgres:16 --platform=linux/amd64
docker pull rabbitmq:3.11 --platform=linux/amd64
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
Expand All @@ -18,34 +23,33 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarCloud scanner
id: cache-sonar-scanner
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Install SonarCloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
dotnet tool install --global dotnet-sonarscanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"MadWorldNL_MantaRayPlan" /o:"madworldnl" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=TestResults/*/coverage.opencover.xml /d:sonar.coverage.exclusions="**Test*.cs" /d:sonar.exclusions="**/Clients.DefaultStyle/wwwroot/lib/**, **/Clients.DefaultStyle/wwwroot/app/**"
dotnet-sonarscanner begin /k:"MadWorldNL_MantaRayPlan" /o:"madworldnl" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=TestResults/*/coverage.opencover.xml /d:sonar.coverage.exclusions="**Test*.cs" /d:sonar.exclusions="**/Clients.DefaultStyle/wwwroot/lib/**, **/Clients.DefaultStyle/wwwroot/app/**"
dotnet workload install android
dotnet workload restore ./src/MadWorldNL.MantaRayPlan.sln;
dotnet restore ./src/MadWorldNL.MantaRayPlan.sln;
dotnet build ./src/MadWorldNL.MantaRayPlan.sln --no-restore -c Release;
dotnet test ./src/MadWorldNL.MantaRayPlan.sln --no-build --no-restore -c Release --blame-hang-timeout 5min --collect:"XPlat Code Coverage" --results-directory TestResults/ -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover;
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ docker compose up

*This project is required to set as startup project

`dotnet workload restore` is required to install the necessary workloads for the project. You don't need to run this command if you have already installed the workloads.
`dotnet workload restore` is required to install the necessary workloads for the project. However, when you download a new update,
it may be necessary to run this command to ensure all workloads are up to date.

### Running the tests
Before running the tests, ensure Docker is up and running.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace: "manta-ray-plan-production"

image:
tag: "v0.4.7"
tag: "v0.5.0"

clusterIssuer:
enabled: true
Expand Down
27 changes: 26 additions & 1 deletion deployment/MantaRayPlanCloud/templates/admin-bff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ spec:
app: {{ .Values.admin.bff.app }}
task: {{ .Values.admin.bff.name }}
spec:
serviceAccountName: {{ .Values.serveraccount.name }}
automountServiceAccountToken: false
containers:
- name: {{ .Values.admin.bff.app }}
image: "{{ .Values.admin.bff.image }}:{{ .Values.image.tag }}"
imagePullPolicy: Always
resources:
requests:
ephemeral-storage: "1Gi"
cpu: 0.5
memory: "500Mi"
limits:
ephemeral-storage: "2Gi"
cpu: 1
memory: "1Gi"
livenessProbe:
httpGet:
path: /healthz
Expand All @@ -31,13 +42,27 @@ spec:
timeoutSeconds: 1
failureThreshold: 3
env:
- name: Api__Address
value: "{{ .Values.api.grpc.loadBalancer }}:8080"
- name: OpenTelemetry__LoggerEndpoint
value: "{{ .Values.logging.seq.host.internal }}"
- name: OpenTelemetry__LoggerApiKey
valueFrom:
secretKeyRef:
name: {{ .Values.logging.seq.secrets.name }}
key: apiKeyAdmin
key: apiKeyAdmin
- name: MessageBus__Host
value: {{ .Values.messageBus.loadBalancer }}
- name: MessageBus__Username
valueFrom:
secretKeyRef:
name: {{ .Values.messageBus.secret.name }}
key: username
- name: MessageBus__Password
valueFrom:
secretKeyRef:
name: {{ .Values.messageBus.secret.name }}
key: password
ports:
- containerPort: 8080
---
Expand Down
42 changes: 34 additions & 8 deletions deployment/MantaRayPlanCloud/templates/admin-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ metadata:
data:
default.conf: |
server {
listen 80;
listen 80;
listen [::]:80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html =404;
}

add_header X-Frame-Options "DENY" always;
Expand All @@ -27,6 +22,19 @@ data:
add_header content-security-policy "default-src 'self' https://{{ .Values.admin.bff.host }}; img-src 'self' data: ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://{{ .Values.admin.bff.host }}; upgrade-insecure-requests; frame-ancestors 'self'";
}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ .Values.admin.web.app }}-appsetting-config"
namespace: {{ .Values.namespace }}
data:
default.conf: |
{
"Api": {
"Address": "https://{{ .Values.admin.bff.host }}/"
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -47,10 +55,21 @@ spec:
app: {{ .Values.admin.web.app }}
task: {{ .Values.admin.web.name }}
spec:
serviceAccountName: {{ .Values.serveraccount.name }}
automountServiceAccountToken: false
containers:
- name: {{ .Values.admin.web.app }}
image: "{{ .Values.admin.web.image }}:{{ .Values.image.tag }}"
imagePullPolicy: Always
resources:
requests:
ephemeral-storage: "1Gi"
cpu: 0.5
memory: "500Mi"
limits:
ephemeral-storage: "2Gi"
cpu: 1
memory: "1Gi"
livenessProbe:
httpGet:
path: /healthz.txt
Expand All @@ -64,12 +83,19 @@ spec:
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
readOnly: true
- name: "{{ .Values.admin.web.app }}-appsettings-config-volume"
mountPath: /usr/share/nginx/html/appsettings.json
subPath: appsettings.json
readOnly: true
ports:
- containerPort: 80
volumes:
- name: "{{ .Values.admin.web.app }}-nginx-config-volume"
configMap:
name: "{{ .Values.admin.web.app }}-nginx-config"
- name: "{{ .Values.admin.web.app }}-appsettings-config-volume"
configMap:
name: "{{ .Values.admin.web.app }}-appsettings-config"
---
apiVersion: v1
kind: Service
Expand Down
25 changes: 24 additions & 1 deletion deployment/MantaRayPlanCloud/templates/api-grpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ spec:
app: {{ .Values.api.grpc.app }}
task: {{ .Values.api.grpc.name }}
spec:
serviceAccountName: {{ .Values.serveraccount.name }}
automountServiceAccountToken: false
containers:
- name: {{ .Values.api.grpc.app }}
image: "{{ .Values.api.grpc.image }}:{{ .Values.image.tag }}"
imagePullPolicy: Always
resources:
requests:
ephemeral-storage: "1Gi"
cpu: 0.5
memory: "500Mi"
limits:
ephemeral-storage: "2Gi"
cpu: 1
memory: "1Gi"
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -55,7 +66,19 @@ spec:
name: {{ .Values.logging.seq.secrets.name }}
key: apiKeyGrpc
- name: Kestrel__EndpointDefaults__Protocols
value: "Http1AndHttp2"
value: "Http1AndHttp2"
- name: MessageBus__Host
value: {{ .Values.messageBus.loadBalancer }}
- name: MessageBus__Username
valueFrom:
secretKeyRef:
name: {{ .Values.messageBus.secret.name }}
key: username
- name: MessageBus__Password
valueFrom:
secretKeyRef:
name: {{ .Values.messageBus.secret.name }}
key: password
ports:
- containerPort: 8080
---
Expand Down
23 changes: 23 additions & 0 deletions deployment/MantaRayPlanCloud/templates/api-message-bus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ spec:
app: {{ .Values.api.messageBus.app }}
task: {{ .Values.api.messageBus.name }}
spec:
serviceAccountName: {{ .Values.serveraccount.name }}
automountServiceAccountToken: false
containers:
- name: {{ .Values.api.messageBus.app }}
image: "{{ .Values.api.messageBus.image }}:{{ .Values.image.tag }}"
imagePullPolicy: Always
resources:
requests:
ephemeral-storage: "1Gi"
cpu: 0.5
memory: "500Mi"
limits:
ephemeral-storage: "2Gi"
cpu: 1
memory: "1Gi"
livenessProbe:
httpGet:
path: /healthz
Expand Down Expand Up @@ -56,5 +67,17 @@ spec:
key: apiKeyMessageBus
- name: Kestrel__EndpointDefaults__Protocols
value: "Http1AndHttp2"
- name: MessageBus__Host
value: {{ .Values.messageBus.loadBalancer }}
- name: MessageBus__Username
valueFrom:
secretKeyRef:
name: {{ .Values.messageBus.secret.name }}
key: username
- name: MessageBus__Password
valueFrom:
secretKeyRef:
name: {{ .Values.messageBus.secret.name }}
key: password
ports:
- containerPort: 8080
Loading
Loading