Skip to content

Commit 846a3c7

Browse files
committed
update
1 parent b25545a commit 846a3c7

File tree

8 files changed

+82
-67
lines changed

8 files changed

+82
-67
lines changed

services/simcore/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.env
22
docker-compose.deploy.yml
3+
docker-compose.yml
34
dask-sidecar/**

services/simcore/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ compose-aws: .env ${TEMP_COMPOSE}-aws ## Create docker-compose.deploy for AWS
3636
.PHONY: compose-master
3737
compose-master: .env ${TEMP_COMPOSE}-master ## Create docker-compose.deploy for Master
3838

39+
.PHONY: docker-compose.yml
40+
docker-compose.yml: .venv .env
41+
@$(call jinja, docker-compose.yml.j2, .env, docker-compose.yml.unlinted) && \
42+
$(_yq) docker-compose.yml.unlinted > docker-compose.yml; \
43+
rm docker-compose.yml.unlinted >/dev/null 2>&1;
3944

4045
.PHONY: ${TEMP_COMPOSE}-local
4146
${TEMP_COMPOSE}-local: docker-compose.yml docker-compose.deploy.local.yml

services/simcore/docker-compose.yml renamed to services/simcore/docker-compose.yml.j2

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ services:
5353
agent:
5454
networks:
5555
- monitored
56+
{%- raw %}
5657
hostname: "{{.Node.Hostname}}-{{.Service.Name}}"
58+
{%- endraw %}
5759
volumes:
5860
- /var/run/docker.sock:/var/run/docker.sock
5961
environment:
@@ -270,9 +272,10 @@ services:
270272
<<: *webserver_resources
271273
extra_hosts: []
272274

273-
274275
wb-db-event-listener:
276+
{%- raw %}
275277
hostname: "{{.Service.Name}}"
278+
{%- endraw %}
276279
environment:
277280
- WEBSERVER_LOGLEVEL=${WEBSERVER_LOGLEVEL}
278281
networks:
@@ -311,7 +314,9 @@ services:
311314
- default
312315
- interactive_services_subnet
313316
- monitored
317+
{%- raw %}
314318
hostname: "{{.Service.Name}}"
319+
{%- endraw %}
315320
deploy:
316321
update_config:
317322
parallelism: 2
@@ -538,7 +543,9 @@ services:
538543
cpus: '0.1'
539544
540545
efs-guardian:
546+
{%- raw %}
541547
hostname: "{{.Service.Name}}"
548+
{% endraw %}
542549
networks:
543550
- monitored
544551
deploy:
@@ -644,7 +651,9 @@ services:
644651
networks:
645652
- monitored
646653
- public
654+
{%- raw %}
647655
hostname: "{{.Service.Name}}"
656+
{% endraw %}
648657
deploy:
649658
# NOTE: https://github.com/ITISFoundation/osparc-simcore/pull/4286
650659
# NOTE: this MUSTN'T change, or weird things might happen
@@ -768,6 +777,7 @@ services:
768777
reservations:
769778
memory: 128M
770779
cpus: '0.1'
780+
771781
traefik_api:
772782
# NOTE: this is a trick to allow to access the internal traefik REST API
773783
# A comment
@@ -813,6 +823,7 @@ services:
813823
reservations:
814824
memory: 8M
815825
cpus: '0.1'
826+
816827
whoami:
817828
image: "containous/whoami:v1.5.0"
818829
networks:
@@ -851,6 +862,7 @@ services:
851862
reservations:
852863
memory: 8M
853864
cpus: '0.1'
865+
854866
payments:
855867
deploy:
856868
placement:
@@ -894,9 +906,72 @@ services:
894906
- traefik.http.routers.${PREFIX_STACK_NAME}_dynamic_scheduler.tls=true
895907
- traefik.http.routers.${PREFIX_STACK_NAME}_dynamic_scheduler.middlewares=ops_gzip@swarm, ops_auth@swarm
896908

909+
fallback-service-web:
910+
image: nginx:1.25.1
911+
configs:
912+
- source: {{ SWARM_STACK_NAME }}_web_html
913+
target: /usr/share/nginx/html/503.html
914+
- source: {{ SWARM_STACK_NAME }}_web_nginx_config
915+
target: /etc/nginx/conf.d/default.conf
916+
networks:
917+
- public
918+
- monitored
919+
deploy:
920+
placement:
921+
constraints:
922+
- node.labels.simcore==true
923+
update_config:
924+
order: start-first
925+
labels:
926+
- io.simcore.zone=${TRAEFIK_SIMCORE_ZONE}
927+
- traefik.enable=true
928+
- traefik.http.routers.fallback_html.priority=1
929+
- traefik.http.routers.fallback_html.rule=(Path(`/`) || Path(`/v0`) || Path(`/socket.io/`) || Path(`/static-frontend-data.json`) || PathRegexp(`^/study/(?P<study_uuid>\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)`) || Path(`/view`) || Path(`/#/view`) || Path(`/#/error`) || PathPrefix(`/v0/`))
930+
- traefik.http.services.fallback_html.loadbalancer.server.port=80
931+
- traefik.http.routers.fallback_html.entrypoints=http
932+
933+
fallback-service-api:
934+
image: nginx:1.25.1
935+
configs:
936+
- source: {{ SWARM_STACK_NAME }}_api_json
937+
target: /usr/share/nginx/api/503.json
938+
- source: {{ SWARM_STACK_NAME }}_api_nginx_config
939+
target: /etc/nginx/conf.d/default.conf
940+
networks:
941+
- public
942+
- monitored
943+
deploy:
944+
placement:
945+
constraints:
946+
- node.labels.simcore==true
947+
update_config:
948+
order: start-first
949+
labels:
950+
- io.simcore.zone=${TRAEFIK_SIMCORE_ZONE}
951+
- traefik.enable=true
952+
- traefik.http.routers.fallback_api.priority=1
953+
- traefik.http.routers.fallback_api.rule=Path(`/`) || Path(`/v0`) || PathPrefix(`/v0/`) || Path(`/api/v0/openapi.json`)
954+
- traefik.http.services.fallback_api.loadbalancer.server.port=80
955+
- traefik.http.routers.fallback_api.entrypoints=simcore_api
956+
957+
configs:
958+
{{ SWARM_STACK_NAME }}_web_html:
959+
file: ./configs/fallback-service-nginx/web/503.html
960+
name: {{ SWARM_STACK_NAME}}_web_html_{{ "./configs/fallback-service-nginx/web/503.html" | sha256file | substring(0,10) }}
961+
{{ SWARM_STACK_NAME }}_api_json:
962+
file: ./configs/fallback-service-nginx/api/503.json
963+
name: {{ SWARM_STACK_NAME}}_api_json_{{ "./configs/fallback-service-nginx/api/503.json" | sha256file | substring(0,10) }}
964+
{{ SWARM_STACK_NAME }}_web_nginx_config:
965+
file: ./configs/fallback-service-nginx/web/default.conf
966+
name: {{ SWARM_STACK_NAME}}_web_nginx_config_{{ "./configs/fallback-service-nginx/web/default.conf" | sha256file | substring(0,10) }}
967+
{{ SWARM_STACK_NAME }}_api_nginx_config:
968+
file: ./configs/fallback-service-nginx/api/default.conf
969+
name: {{ SWARM_STACK_NAME}}_api_nginx_config_{{ "./configs/fallback-service-nginx/api/default.conf" | sha256file | substring(0,10) }}
970+
897971
volumes:
898972
rabbit_data:
899973
name: ${SWARM_STACK_NAME}_rabbit_data
974+
900975
networks:
901976
public:
902977
external: true

services/traefik/docker-compose.yml.j2

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -204,72 +204,6 @@ services:
204204
networks:
205205
- public
206206
207-
fallback-service-web:
208-
image: nginx:1.25.1
209-
configs:
210-
- source: web_html
211-
target: /usr/share/nginx/html/503.html
212-
- source: web_nginx_config
213-
target: /etc/nginx/conf.d/default.conf
214-
networks:
215-
- public
216-
- monitored
217-
deploy:
218-
placement:
219-
constraints:
220-
- node.labels.simcore==true
221-
update_config:
222-
order: start-first
223-
labels:
224-
- traefik.enable=true
225-
- traefik.docker.network=${PUBLIC_NETWORK}
226-
- traefik.http.routers.fallback_html.priority=3
227-
- traefik.http.routers.fallback_html.tls=true
228-
- traefik.http.routers.fallback_html.rule=Host(`fallback.osparc.local`)
229-
- traefik.http.services.fallback_html.loadbalancer.server.port=80
230-
- traefik.http.routers.fallback_html.entrypoints=https
231-
232-
fallback-service-api:
233-
image: nginx:1.25.1
234-
configs:
235-
- source: api_json
236-
target: /usr/share/nginx/api/503.json
237-
- source: api_nginx_config
238-
target: /etc/nginx/conf.d/default.conf
239-
networks:
240-
- public
241-
- monitored
242-
deploy:
243-
placement:
244-
constraints:
245-
- node.labels.simcore==true
246-
update_config:
247-
order: start-first
248-
labels:
249-
- traefik.enable=true
250-
- traefik.docker.network=${PUBLIC_NETWORK}
251-
- traefik.http.routers.fallback_api.priority=3
252-
- traefik.http.routers.fallback_api.tls=true
253-
- traefik.http.routers.fallback_api.rule=Host(`fallback-api.osparc.local`)
254-
- traefik.http.services.fallback_api.loadbalancer.server.port=80
255-
- traefik.http.routers.fallback_api.entrypoints=https
256-
257-
{%- raw %}
258-
configs:
259-
web_html:
260-
file: ./config/web/503.html
261-
name: web_html_${DOCKER_IMAGE_TAG?error} # exit with error if not defined
262-
api_json:
263-
file: ./config/api/503.json
264-
name: api_json_${DOCKER_IMAGE_TAG?error}
265-
web_nginx_config:
266-
file: ./config/web/default.conf
267-
name: web_nginx_config_${DOCKER_IMAGE_TAG?error}
268-
api_nginx_config:
269-
file: ./config/api/default.conf
270-
name: api_nginx_config_${DOCKER_IMAGE_TAG?error}
271-
{% endraw %}
272-
273207
networks:
274208
public:
275209
external: true

0 commit comments

Comments
 (0)