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

♻️(tray) split websocket and asgi apps in tray #2630

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).

- Add peertube transcript generation

### Changed

- Split websocket and asgi apps in tray

### Fixed

- Allow to change username if one is persisted on classroom join
Expand Down
29 changes: 29 additions & 0 deletions src/tray/templates/services/app/deploy_ws.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% set service_variant = "ws" %}
{% set marsha_replicas = marsha_ws_replicas %}
{% set marsha_livenessprobe = {
"httpGet": {
"path": "/__heartbeat__",
"port": "django-port",
"httpHeaders": [{
"name": "Host",
"value": marsha_hosts[0],
}],
},
"initialDelaySeconds": 60,
"periodSeconds": 30 ,
} %}
{% set marsha_readynessprobe = {
"httpGet": {
"path": "/__lbheartbeat__",
"port": "django-port",
"httpHeaders": [{
"name": "Host",
"value": marsha_hosts[0],
}],
},
"initialDelaySeconds": 10,
"periodSeconds": 5,
} %}
{% set marsha_resources = marsha_ws_resources %}

{% include "./_deploy_base.yml.j2" with context %}
20 changes: 20 additions & 0 deletions src/tray/templates/services/app/svc_ws.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: marsha
service: ws
version: "{{ marsha_image_tag }}"
deployment_stamp: "{{ deployment_stamp }}"
name: marsha-ws-{{ deployment_stamp }} # name of the service should be host name in nginx
namespace: "{{ namespace_name }}"
spec:
ports:
- name: {{ marsha_django_port }}-tcp
port: {{ marsha_django_port }}
protocol: TCP
targetPort: {{ marsha_django_port }}
selector:
app: marsha
deployment: "marsha-ws-{{ deployment_stamp }}"
type: ClusterIP
6 changes: 5 additions & 1 deletion src/tray/templates/services/nginx/configs/marsha.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ upstream marsha-backend {
server marsha-app-{{ deployment_stamp }}:{{ marsha_django_port }} fail_timeout=0;
}

upstream marsha-ws {
server marsha-ws-{{ deployment_stamp }}:{{ marsha_django_port }} fail_timeout=0;
}

upstream marsha-xapi {
server marsha-xapi-{{ deployment_stamp }}:{{ marsha_django_port }} fail_timeout=0;
}
Expand Down Expand Up @@ -62,7 +66,7 @@ server {
}

location /ws/ {
proxy_pass http://marsha-backend;
proxy_pass http://marsha-ws;

proxy_http_version 1.1;
proxy_set_header Connection "Upgrade";
Expand Down
9 changes: 9 additions & 0 deletions src/tray/vars/all/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ marsha_image_name: "fundocker/marsha"
marsha_image_tag: "3.23.0"
marsha_django_port: 8000
marsha_app_replicas: 1
marsha_ws_replicas: 1
marsha_xapi_replicas: 1
marsha_celery_replicas: 1
marsha_django_configuration: "Development"
Expand Down Expand Up @@ -123,6 +124,14 @@ marsha_app_resources:
cpu: 0.8
memory: 1Gi

marsha_ws_resources:
requests:
cpu: 0.3
memory: 500Mi
limits:
cpu: 0.8
memory: 1Gi

marsha_xapi_resources:
requests:
cpu: 0.3
Expand Down