Skip to content

Commit 9762d36

Browse files
Add frontend chatbot service (ITISFoundation#1158)
* wip * Add csi-s3 and have portainer use it * Change request @Hrytsuk 1GB max portainer volume size * Arch Linux Certificates Customization * Fix pgsql exporter failure * [Kubernetes] Introduce on-prem persistent Storage (Longhorn) 🎉 (ITISFoundation#979) * Introduce longhorn chart * Further longhorn configuration * Longhorn: further settings configuration * Fix longhorn configuration bugs Extra: introduce longhorn pv vales for portainer * Add comment for deletion longhorn * Further longhorn configuration * Add README.md for Longhorn wit FAQ * Update Longhorn readme * Update readme * Futher LH configuration * Update LH's Readme * Update Longhorn Readme * Improve LH's Readme * LH: Reduce reserved default disk space to 5% Since we use a dedicated disk for LH, we can go ahead with 5% * Use values to set Longhorn storage class * Update LH's Readme * LH Readme: add requirements reference * PR Review: bring back portainer s3 pv * LH: decrease portinaer volume size * Experimental: Try to add tracing to simcore-traefik on master * Fixes ITISFoundation/osparc-simcore#7363 * Add chatbox vendor service * necessary reverts * Add resources, change names * wip * Add chat vendor service maintenanec mode * wip --------- Co-authored-by: Dustin Kaiser <[email protected]> Co-authored-by: YH <[email protected]>
1 parent e24b80d commit 9762d36

File tree

2 files changed

+49
-18
lines changed

2 files changed

+49
-18
lines changed

services/vendors/docker-compose.yml.j2

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.7"
2-
31
services:
42
manual:
53
image: ${VENDOR_MANUAL_IMAGE}
@@ -34,16 +32,16 @@ services:
3432
- traefik.http.routers.vendor_manual.middlewares=ops_gzip@swarm, authenticated_platform_user@swarm
3533
networks:
3634
- public
37-
chat:
38-
image: ${VENDOR_CHATBOT_IMAGE}
35+
chat-backend:
36+
image: ${VENDOR_CHATBOT_BACKEND_IMAGE}
3937
init: true
4038
env_file:
4139
- .env
4240
{%- raw %}
43-
hostname: "v-chat-{{.Node.Hostname}}-{{.Task.Slot}}"
41+
hostname: "v-chat-backend-{{.Node.Hostname}}-{{.Task.Slot}}"
4442
{%- endraw %}
4543
deploy:
46-
replicas: ${VENDOR_CHATBOT_REPLICAS}
44+
replicas: ${VENDOR_CHATBOT_BACKEND_REPLICAS}
4745
placement:
4846
constraints:
4947
- node.labels.simcore==true
@@ -62,13 +60,43 @@ services:
6260
labels:
6361
- traefik.enable=true
6462
- traefik.swarm.network=${PUBLIC_NETWORK}
65-
- traefik.http.services.vendor_chat.loadbalancer.server.port=${VENDOR_CHATBOT_PORT}
66-
- traefik.http.routers.vendor_chat.entrypoints=https
67-
- traefik.http.routers.vendor_chat.tls=true
68-
- traefik.http.routers.vendor_chat.rule={{ generate_vendors_traefik_rule(VENDOR_CHATBOT_PRODUCTS, VENDOR_CHATBOT_SUBDOMAIN_PREFIX) }}
69-
- traefik.http.routers.vendor_chat.middlewares=authenticated_platform_user@swarm
70-
- prometheus-job=vendor-chat
71-
- prometheus-port=8000
63+
- traefik.http.services.vendor_chat_backend.loadbalancer.server.port=${VENDOR_CHATBOT_BACKEND_PORT}
64+
- traefik.http.routers.vendor_chat_backend.entrypoints=https
65+
- traefik.http.routers.vendor_chat_backend.tls=true
66+
- traefik.http.routers.vendor_chat_backend.rule=(PathPrefix(`/v1/`) && {{ generate_vendors_traefik_rule(VENDOR_CHATBOT_FRONTEND_PRODUCTS, VENDOR_CHATBOT_FRONTEND_SUBDOMAIN_PREFIX) }})
67+
networks:
68+
- public
69+
chat-frontend:
70+
image: ${VENDOR_CHATBOT_FRONTEND_IMAGE}
71+
init: true
72+
{%- raw %}
73+
hostname: "v-chat-frontend-{{.Node.Hostname}}-{{.Task.Slot}}"
74+
{%- endraw %}
75+
deploy:
76+
replicas: ${VENDOR_CHATBOT_FRONTEND_REPLICAS}
77+
placement:
78+
constraints:
79+
- node.labels.simcore==true
80+
resources:
81+
limits:
82+
cpus: "1.0"
83+
memory: 2.5G
84+
reservations:
85+
cpus: "0.1"
86+
memory: 512M
87+
update_config:
88+
parallelism: 1
89+
order: start-first
90+
failure_action: continue
91+
delay: 10s
92+
labels:
93+
- traefik.enable=true
94+
- traefik.swarm.network=${PUBLIC_NETWORK}
95+
- traefik.http.services.vendor_chat_frontend.loadbalancer.server.port=${VENDOR_CHATBOT_FRONTEND_PORT}
96+
- traefik.http.routers.vendor_chat_frontend.entrypoints=https
97+
- traefik.http.routers.vendor_chat_frontend.tls=true
98+
- traefik.http.routers.vendor_chat_frontend.rule=(!PathPrefix(`/v1/`) && {{ generate_vendors_traefik_rule(VENDOR_CHATBOT_FRONTEND_PRODUCTS, VENDOR_CHATBOT_FRONTEND_SUBDOMAIN_PREFIX) }})
99+
- traefik.http.routers.vendor_chat_frontend.middlewares=authenticated_platform_user@swarm
72100
networks:
73101
- public
74102
networks:

services/vendors/template.env

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ VENDOR_MANUAL_REPLICAS=${VENDOR_MANUAL_REPLICAS}
33
VENDOR_MANUAL_SUBDOMAIN_PREFIX=${VENDOR_MANUAL_SUBDOMAIN_PREFIX}
44
VENDOR_MANUAL_PRODUCTS=${VENDOR_MANUAL_PRODUCTS}
55
VENDOR_MANUAL_PORT=${VENDOR_MANUAL_PORT}
6-
VENDOR_CHATBOT_IMAGE=${VENDOR_CHATBOT_IMAGE}
7-
VENDOR_CHATBOT_REPLICAS=${VENDOR_CHATBOT_REPLICAS}
8-
VENDOR_CHATBOT_SUBDOMAIN_PREFIX=${VENDOR_CHATBOT_SUBDOMAIN_PREFIX}
9-
VENDOR_CHATBOT_PRODUCTS=${VENDOR_CHATBOT_PRODUCTS}
10-
VENDOR_CHATBOT_PORT=${VENDOR_CHATBOT_PORT}
6+
VENDOR_CHATBOT_BACKEND_IMAGE=${VENDOR_CHATBOT_BACKEND_IMAGE}
7+
VENDOR_CHATBOT_BACKEND_PORT=${VENDOR_CHATBOT_BACKEND_PORT}
8+
VENDOR_CHATBOT_BACKEND_REPLICAS=${VENDOR_CHATBOT_BACKEND_REPLICAS}
9+
VENDOR_CHATBOT_FRONTEND_IMAGE=${VENDOR_CHATBOT_FRONTEND_IMAGE}
10+
VENDOR_CHATBOT_FRONTEND_PORT=${VENDOR_CHATBOT_FRONTEND_PORT}
11+
VENDOR_CHATBOT_FRONTEND_PRODUCTS=${VENDOR_CHATBOT_FRONTEND_PRODUCTS}
12+
VENDOR_CHATBOT_FRONTEND_REPLICAS=${VENDOR_CHATBOT_FRONTEND_REPLICAS}
13+
VENDOR_CHATBOT_FRONTEND_SUBDOMAIN_PREFIX=${VENDOR_CHATBOT_FRONTEND_SUBDOMAIN_PREFIX}
1114
PUBLIC_NETWORK=${PUBLIC_NETWORK}
1215
OPENAI_API_KEY=${OPENAI_API_KEY}

0 commit comments

Comments
 (0)