Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

BC-6683 - poc board collaboration server #1

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7672fb8
add ingress configuration
hoeppner-dataport Mar 1, 2024
a643e25
fix changed source of deploy
hoeppner-dataport Mar 1, 2024
c8aa20f
claim more ressources on pod
Metauriel Mar 1, 2024
56943e7
Delete dist directory
hoeppner-dataport Mar 1, 2024
b92146a
run productive mode in dockerfile
Metauriel Mar 1, 2024
e23ac61
add path to web-socket-server-gateway
hoeppner-dataport Mar 1, 2024
f289208
Merge branch 'BC-6683-poc-board-collaboration-server' of github.com:h…
hoeppner-dataport Mar 1, 2024
60acad3
empty commit
hoeppner-dataport Mar 1, 2024
337af55
Merge branch 'main' into BC-6683-poc-board-collaboration-server
Metauriel Mar 1, 2024
39377a7
chore: update readme.md
hoeppner-dataport Mar 1, 2024
be9da0f
Merge branch 'BC-6683-poc-board-collaboration-server' of github.com:h…
hoeppner-dataport Mar 1, 2024
53cff06
empty commit 2
hoeppner-dataport Mar 1, 2024
ce6ec4e
chore: try extended cors configuration
hoeppner-dataport Mar 4, 2024
357c188
chore: activate cors for app
hoeppner-dataport Mar 4, 2024
1133ad0
set global prefix (aka base path)
hoeppner-dataport Mar 4, 2024
029fe7b
change port settings
hoeppner-dataport Mar 4, 2024
724f980
add delete-card feature
muratmerdoglu-dp Mar 4, 2024
98a0720
add create-card feature
NFriedo Mar 5, 2024
57a225e
add moveCard handler
muratmerdoglu-dp Mar 6, 2024
9d385e3
add move column handler
muratmerdoglu-dp Mar 8, 2024
60103fa
add redis adapter
Metauriel Mar 27, 2024
6bfaf04
force multiple replicas to be deployed for testing
Metauriel Mar 27, 2024
43fc1b1
use ioredis instead of redis
Metauriel Mar 28, 2024
4fc7357
chore: remove connect-calls for ioredis
hoeppner-dataport Apr 2, 2024
829df12
use redis instead of ioredis
hoeppner-dataport Apr 3, 2024
ebebb2e
use ioredis again
hoeppner-dataport Apr 3, 2024
91d840c
remove second connect call
hoeppner-dataport Apr 3, 2024
1006e4d
Merge branch 'main' into BC-6683-poc-board-collaboration-server
hoeppner-dataport Apr 3, 2024
fcb47d3
remove unneeded connect calls
hoeppner-dataport Apr 3, 2024
f5c05bb
add hostname to payload
hoeppner-dataport Apr 3, 2024
b6e4bd5
add default for servername in success actions
hoeppner-dataport Apr 3, 2024
64e6c47
chore: redeploy
hoeppner-dataport Apr 3, 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
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

- name: test image exists
run: |
echo "IMAGE_EXISTS=$(docker manifest inspect ghcr.io/${{ github.repository }}:${{ github.sha }} > /dev/null && echo 1 || echo 0)" >> $GITHUB_ENV
echo "IMAGE_EXISTS=$(docker manifest inspect ghcr.io/${{ github.repository }}:${{ github.sha }} > /dev/null && echo 1 || echo 0)" >> $GITHUB_ENV

- name: Build and push ${{ github.repository }}
if: ${{ env.IMAGE_EXISTS == 0 }}
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
needs:
- build_and_push
- branch_meta
uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/deploy.yml@main
uses: hpi-schul-cloud/dof_app_deploy/.github/workflows/deploy.yml@BC-6683-poc-board-collaboration-server
with:
branch: ${{ needs.branch_meta.outputs.branch }}
secrets:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ RUN npm run build

ENV NODE_ENV=production
ENV NO_COLOR="true"
CMD npm run start
CMD npm run start:prod
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

Proof of Concept for implementing a websocket-server that enables collaboration on column boards between different users.


## Installation

```bash
Expand Down Expand Up @@ -37,8 +36,8 @@ $ npm run test:cov

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support)..

## License

GNU AFFERO GENERAL PUBLIC LICENSE V3 (see LICENSE)
GNU AFFERO GENERAL PUBLIC LICENSE V3 (see LICENSE-file)
2 changes: 1 addition & 1 deletion ansible/group_vars/all/poc-board-collaboration-server.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
POC_BOARD_COLLABORATION_SERVER_PORT: 8080
POC_BOARD_COLLABORATION_SERVER_PORT: 3000
POC_BOARD_COLLABORATION_SERVER_IMAGE: quay.io/schulcloudverbund/poc-board-collaboration-server
4 changes: 2 additions & 2 deletions ansible/roles/poc-board-collaboration-server/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
galaxy_info:
role_name: version-aggregator
role_name: poc-board-collaboration-server
author: Schul-Cloud Verbund
description: role for the version-aggregator
description: role for the poc-board-collaboration-server
company: Schul-Cloud Verbund
license: license (AGPLv3)
min_ansible_version: 2.8
Expand Down
37 changes: 22 additions & 15 deletions ansible/roles/poc-board-collaboration-server/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
- name: poc-board-collaboration-server configmap
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: configmap.yml.j2
- name: poc-board-collaboration-server configmap
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: '{{ NAMESPACE }}'
template: configmap.yml.j2

- name: poc-board-collaboration-server deployment
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: deployment.yml.j2
- name: poc-board-collaboration-server deployment
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: '{{ NAMESPACE }}'
template: deployment.yml.j2

- name: poc-board-collaboration-server service
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: "{{ NAMESPACE }}"
template: service.yml.j2
- name: poc-board-collaboration-server service
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: '{{ NAMESPACE }}'
template: service.yml.j2

- name: poc-board-collaboration-server ingress
kubernetes.core.k8s:
kubeconfig: ~/.kube/config
namespace: '{{ NAMESPACE }}'
template: ingress.yml.j2
apply: yes
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
git.branch: {{ POC_BOARD_COLLABORATION_SERVER_BRANCH_NAME }}
git.repo: {{ POC_BOARD_COLLABORATION_SERVER_REPO_NAME }}
spec:
replicas: {{ POC_BOARD_COLLABORATION_SERVER_REPLICAS|default("1", true) }}
replicas: {{ POC_BOARD_COLLABORATION_SERVER_REPLICAS|default("3", true) }}
strategy:
type: RollingUpdate
rollingUpdate:
Expand Down Expand Up @@ -52,13 +52,15 @@ spec:
envFrom:
- configMapRef:
name: poc-board-collaboration-server-configmap
- secretRef:
name: api-secret
resources:
limits:
cpu: {{ POC_BOARD_COLLABORATION_SERVER__CPU_LIMITS|default("1000m", true) }}
memory: {{ POC_BOARD_COLLABORATION_SERVER__MEMORY_LIMITS|default("32Mi", true) }}
memory: {{ POC_BOARD_COLLABORATION_SERVER__MEMORY_LIMITS|default("2Gi", true) }}
requests:
cpu: {{ POC_BOARD_COLLABORATION_SERVER__CPU_REQUESTS|default("100m", true) }}
memory: {{ POC_BOARD_COLLABORATION_SERVER__MEMORY_REQUESTS|default("32Mi", true) }}
memory: {{ POC_BOARD_COLLABORATION_SERVER__MEMORY_REQUESTS|default("128Mi", true) }}
{% if AFFINITY_ENABLE is defined and AFFINITY_ENABLE|bool %}
affinity:
podAffinity:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ NAMESPACE }}-poc-board-collaboration-server-ingress
namespace: {{ NAMESPACE }}
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "{{ TLS_ENABELD|default("false") }}"
nginx.ingress.kubernetes.io/proxy-body-size: "{{ INGRESS_MAX_BODY_SIZE|default("2560") }}m"
nginx.org/client-max-body-size: "{{ INGRESS_MAX_BODY_SIZE|default("2560") }}m"
# The following properties added with BC-3606.
# The header size of the request is too big. For e.g. state and the permanent growing jwt.
# Nginx throws away the Location header, resulting in the 502 Bad Gateway.
nginx.ingress.kubernetes.io/client-header-buffer-size: 100k
nginx.ingress.kubernetes.io/http2-max-header-size: 96k
nginx.ingress.kubernetes.io/large-client-header-buffers: 4 100k
nginx.ingress.kubernetes.io/proxy-buffer-size: 96k
{% if CLUSTER_ISSUER is defined %}
cert-manager.io/cluster-issuer: {{ CLUSTER_ISSUER }}
{% endif %}

spec:
ingressClassName: {{ INGRESS_CLASS }}
{% if CLUSTER_ISSUER is defined or (TLS_ENABELD is defined and TLS_ENABELD|bool) %}
tls:
- hosts:
- {{ DOMAIN }}
{% if CLUSTER_ISSUER is defined %}
secretName: {{ DOMAIN }}-tls
{% endif %}
{% endif %}
rules:
- host: {{ DOMAIN }}
http:
paths:
- path: /poc-board-collaboration-server
backend:
service:
name: poc-board-collaboration-server-svc
port:
number: {{ POC_BOARD_COLLABORATION_SERVER_PORT }}
pathType: Prefix
109 changes: 109 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"@nestjs/platform-express": "^10.0.0",
"@nestjs/platform-socket.io": "^10.3.3",
"@nestjs/websockets": "^10.3.3",
"@socket.io/redis-adapter": "^8.3.0",
"ioredis": "^5.3.2",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1",
"socket.io": "^4.7.4",
Expand Down
11 changes: 10 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { RedisIoAdapter } from './socket/socket/redis-adapter';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create(AppModule, {
cors: true,
});
app.setGlobalPrefix('bc-6683-poc-board-collaboration');

const redisIoAdapter = new RedisIoAdapter(app);
await redisIoAdapter.connectToRedis();

app.useWebSocketAdapter(redisIoAdapter);
await app.listen(3000); // TODO: use env variable
}
bootstrap();
Loading