Skip to content

Commit a1e36c7

Browse files
authored
Merge branch 'ITISFoundation:main' into main
2 parents d60fd0c + f4e0ba2 commit a1e36c7

File tree

12 files changed

+132
-16
lines changed

12 files changed

+132
-16
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
- [ ] Service is restartable
2020
- [ ] Service restart is zero-downtime
2121
- [ ] Service has >1 replicas in PROD
22-
- [ ] Service has docker heathlcheck enabled
22+
- [ ] Service has docker healthcheck enabled
2323
- [ ] Service is monitored (via prometheus and grafana)
2424
- [ ] Service is not bound to one specific node (e.g. via files or volumes)
2525
- [ ] Relevant OPS E2E Test are added
26+
- [ ] Grafana dashboards updated accordingly
2627
2728
If exposed via traefik
2829
- [ ] Service's Public URL is included in maintenance mode

charts/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ helmfile-sync: .check-helmfile-installed helmfile.yaml ## Syncs the helmfile con
5050
fi
5151

5252
.PHONY: configure-local-hosts
53-
configure-local-hosts: ## Adds local hosts entries for the machine
54-
@echo "Adding $(MACHINE_FQDN) hosts to /etc/hosts ..."
55-
@grep -q '127.0.0.1 k8s.monitoring.$(MACHINE_FQDN)' /etc/hosts || echo '127.0.0.1 k8s.monitoring.$(MACHINE_FQDN)' | sudo tee -a /etc/hosts
53+
configure-local-hosts: $(REPO_CONFIG_LOCATION) ## Adds local hosts entries for the machine
54+
# "Updating /etc/hosts with k8s $(MACHINE_FQDN) hosts ..."
55+
@set -a; source $(REPO_CONFIG_LOCATION); set +a; \
56+
grep -q "127.0.0.1 $$K8S_MONITORING_FQDN" /etc/hosts || echo "127.0.0.1 $$K8S_MONITORING_FQDN" | sudo tee -a /etc/hosts
57+
@set -a; source $(REPO_CONFIG_LOCATION); set +a; \
58+
grep -q "127.0.0.1 $$K8S_PRIVATE_FQDN" /etc/hosts || echo "127.0.0.1 $$K8S_PRIVATE_FQDN" | sudo tee -a /etc/hosts
5659

5760
.PHONY: helmfile-diff
5861
helmfile-diff: .check-helmfile-installed helmfile.yaml ## Shows the differences that would be applied by helmfile

scripts/deployments/deploy_everything_locally.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,9 @@ if [ "$start_simcore" -eq 0 ]; then
258258
pushd "${service_dir}"
259259
call_make "." up-"$stack_target"
260260
popd
261+
log_info "starting vendor services..."
262+
service_dir="${repo_basedir}"/services/vendors
263+
pushd "${service_dir}"
264+
call_make "." up-"$stack_target"
265+
popd
261266
fi

services/maintenance-page/docker-compose.yml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ services:
2828
- traefik.enable=true
2929
- traefik.swarm.network=${PUBLIC_NETWORK}
3030
- traefik.http.routers.{{"maintenance_" + j2item.replace('@','').replace(' ','').replace('.','').replace('-','').replace('\'','') + "_html"}}.priority={{MAINTENANCE_PAGES_TRAEFIK_PRIORITY}}
31+
- traefik.http.routers.{{"maintenance_" + j2item.replace('@','').replace(' ','').replace('.','').replace('-','').replace('\'','') + "_html"}}.rule=Host(`{{VENDOR_CHATBOT_SUBDOMAIN_PREFIX}}.{{j2item}}`) || (Host(`{{j2item}}`) && PathPrefix(`/`)) || (HostRegexp(`services.{{j2item}}`) && PathPrefix(`/`))
3132
- traefik.http.routers.{{"maintenance_" + j2item.replace('@','').replace(' ','').replace('.','').replace('-','').replace('\'','') + "_html"}}.rule=Host(`{{VENDOR_MANUAL_SUBDOMAIN_PREFIX}}.{{j2item}}`) || (Host(`{{j2item}}`) && PathPrefix(`/`)) || (HostRegexp(`services.{{j2item}}`) && PathPrefix(`/`))
3233
- traefik.http.routers.{{"maintenance_" + j2item.replace('@','').replace(' ','').replace('.','').replace('-','').replace('\'','') + "_html"}}.tls=true
3334
- traefik.http.services.{{"maintenance_" + j2item.replace('@','').replace(' ','').replace('.','').replace('-','').replace('\'','') + "_html"}}.loadbalancer.server.port=80

services/maintenance-page/template.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ MONITORED_NETWORK=${MONITORED_NETWORK}
99
REPO_CONFIG_LOCATION=${REPO_CONFIG_LOCATION}
1010
MAINTENANCE_PAGES_TRAEFIK_PRIORITY=${MAINTENANCE_PAGES_TRAEFIK_PRIORITY}
1111
VENDOR_MANUAL_SUBDOMAIN_PREFIX=${VENDOR_MANUAL_SUBDOMAIN_PREFIX}
12+
VENDOR_CHATBOT_SUBDOMAIN_PREFIX=${VENDOR_CHATBOT_SUBDOMAIN_PREFIX}

services/monitoring/prometheus/prometheus-simcore.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ scrape_configs:
113113
- "tasks.master_webserver"
114114
type: "A"
115115
port: 8080
116+
- names:
117+
- "tasks.production_wb-auth"
118+
- "tasks.staging_wb-auth"
119+
- "tasks.master_wb-auth"
120+
type: "A"
121+
port: 8080
116122
- names:
117123
- "tasks.production_wb-api-server"
118124
- "tasks.staging_wb-api-server"

services/simcore/docker-compose.yml.j2

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,34 @@ services:
337337
cpus: "1.0"
338338
memory: "512M"
339339
340+
wb-auth:
341+
networks:
342+
- monitored # traces
343+
- public # public service use auth
344+
deploy:
345+
replicas: ${WB_AUTH_REPLICAS}
346+
update_config:
347+
parallelism: 2
348+
order: start-first
349+
failure_action: rollback
350+
delay: 10s
351+
restart_policy:
352+
condition: any
353+
delay: 5s
354+
max_attempts: 3
355+
window: 120s
356+
placement:
357+
constraints:
358+
- node.labels.simcore==true
359+
resources:
360+
reservations:
361+
cpus: "0.1"
362+
memory: "256M"
363+
limits:
364+
cpus: "1"
365+
memory: "1G"
366+
# healthcheck: defined in image
367+
340368
storage:
341369
environment:
342370
- S3_ENDPOINT=${S3_ENDPOINT}

services/traefik/docker-compose.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ services:
131131
- traefik.http.middlewares.ops_ratelimit.ratelimit.sourcecriterion.ipstrategy.depth=1
132132
# Platform user auth: Use this middleware to enforce only authenticated users
133133
# https://doc.traefik.io/traefik/middlewares/http/forwardauth
134-
- traefik.http.middlewares.authenticated_platform_user.forwardauth.address=http://${WEBSERVER_HOST}:${WEBSERVER_PORT}/v0/auth:check
134+
- traefik.http.middlewares.authenticated_platform_user.forwardauth.address=http://${WB_AUTH_WEBSERVER_HOST}:${WB_AUTH_WEBSERVER_PORT}/v0/auth:check
135135
- traefik.http.middlewares.authenticated_platform_user.forwardauth.trustForwardHeader=true
136136
- traefik.http.middlewares.authenticated_platform_user.forwardauth.authResponseHeaders=Set-Cookie,osparc-sc2
137137
#

services/traefik/template.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ DEPLOYMENT_FQDNS_WWW_CAPTURE_TRAEFIK_RULE='${DEPLOYMENT_FQDNS_WWW_CAPTURE_TRAEFI
3434
PUBLIC_NETWORK=${PUBLIC_NETWORK}
3535
MONITORED_NETWORK=${MONITORED_NETWORK}
3636

37-
WEBSERVER_HOST=${WEBSERVER_HOST}
38-
WEBSERVER_PORT=${WEBSERVER_PORT}
37+
WB_AUTH_WEBSERVER_HOST=${WB_AUTH_WEBSERVER_HOST}
38+
WB_AUTH_WEBSERVER_PORT=${WB_AUTH_WEBSERVER_PORT}
3939

4040
TRAEFIK_DOMAINS_REDIRECT_FROM=${TRAEFIK_DOMAINS_REDIRECT_FROM}
4141
TRAEFIK_DOMAINS_REDIRECT_TO=${TRAEFIK_DOMAINS_REDIRECT_TO}

services/vendors/docker-compose.yml.j2

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
version: "3.7"
2-
31
services:
42
manual:
53
image: ${VENDOR_MANUAL_IMAGE}
64
init: true
75
{%- raw %}
8-
hostname: "{{.Node.Hostname}}-{{.Task.Slot}}"
6+
hostname: "v-manual-{{.Node.Hostname}}-{{.Task.Slot}}"
97
{%- endraw %}
108
deploy:
119
replicas: ${VENDOR_MANUAL_REPLICAS}
@@ -30,11 +28,77 @@ services:
3028
- traefik.http.services.vendor_manual.loadbalancer.server.port=${VENDOR_MANUAL_PORT}
3129
- traefik.http.routers.vendor_manual.entrypoints=https
3230
- traefik.http.routers.vendor_manual.tls=true
33-
- traefik.http.routers.vendor_manual.rule={{ generate_vendors_manual_traefik_rule(VENDOR_MANUAL_PRODUCTS, VENDOR_MANUAL_SUBDOMAIN_PREFIX) }}
31+
- traefik.http.routers.vendor_manual.rule={{ generate_vendors_traefik_rule(VENDOR_MANUAL_PRODUCTS, VENDOR_MANUAL_SUBDOMAIN_PREFIX) }}
3432
- traefik.http.routers.vendor_manual.middlewares=ops_gzip@swarm, authenticated_platform_user@swarm
3533
networks:
3634
- public
37-
35+
chat-backend:
36+
image: ${VENDOR_CHATBOT_BACKEND_IMAGE}
37+
init: true
38+
env_file:
39+
- .env
40+
{%- raw %}
41+
hostname: "v-chat-backend-{{.Node.Hostname}}-{{.Task.Slot}}"
42+
{%- endraw %}
43+
deploy:
44+
replicas: ${VENDOR_CHATBOT_BACKEND_REPLICAS}
45+
placement:
46+
constraints:
47+
- node.labels.simcore==true
48+
resources:
49+
limits:
50+
cpus: "1.0"
51+
memory: 2.5G
52+
reservations:
53+
cpus: "0.1"
54+
memory: 512M
55+
update_config:
56+
parallelism: 1
57+
order: start-first
58+
failure_action: continue
59+
delay: 10s
60+
labels:
61+
- traefik.enable=true
62+
- traefik.swarm.network=${PUBLIC_NETWORK}
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
100+
networks:
101+
- public
38102
networks:
39103
public:
40104
external: true

0 commit comments

Comments
 (0)