Skip to content

Commit

Permalink
bump traefik
Browse files Browse the repository at this point in the history
  • Loading branch information
mrnicegyu11 committed Aug 12, 2024
1 parent 248fba2 commit 3fbb7ce
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def get_dynamic_proxy_spec(
f"traefik.http.routers.{scheduler_data.proxy_service_name}.entrypoints": "http",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.priority": "10",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.rule": f"hostregexp(`{scheduler_data.node_uuid}.services.{{host:.+}}`)",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.middlewares": f"{dynamic_services_scheduler_settings.SWARM_STACK_NAME}_gzip@docker, {scheduler_data.proxy_service_name}-security-headers",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.middlewares": f"{dynamic_services_scheduler_settings.SWARM_STACK_NAME}_gzip@swarm, {scheduler_data.proxy_service_name}-security-headers",
"dynamic_type": "dynamic-sidecar", # tagged as dynamic service
}
| StandardSimcoreDockerLabels(
Expand Down
2 changes: 1 addition & 1 deletion services/director/src/simcore_service_director/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ async def _create_docker_service_params(
f"traefik.http.routers.{service_name}.rule": f"PathPrefix(`/x/{node_uuid}`)",
f"traefik.http.routers.{service_name}.entrypoints": "http",
f"traefik.http.routers.{service_name}.priority": "10",
f"traefik.http.routers.{service_name}.middlewares": f"{config.SWARM_STACK_NAME}_gzip@docker",
f"traefik.http.routers.{service_name}.middlewares": f"{config.SWARM_STACK_NAME}_gzip@swarm",
},
"networks": [internal_network_id] if internal_network_id else [],
}
Expand Down
6 changes: 3 additions & 3 deletions services/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.entrypoints=http
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.rule=hostregexp(`{host:.+}`) && PathPrefix(`/dev/`)
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.priority=3
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.middlewares=${SWARM_STACK_NAME}_gzip@docker, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@docker, ${SWARM_STACK_NAME}_webserver_retry
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_retry

wb-api-server:
environment:
Expand Down Expand Up @@ -233,7 +233,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.service=api@internal
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.rule=PathPrefix(`/dashboard`) || PathPrefix(`/api`)
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.entrypoints=traefik_monitor
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.middlewares=${SWARM_STACK_NAME}_gzip@docker
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.middlewares=${SWARM_STACK_NAME}_gzip@swarm
- traefik.http.services.${SWARM_STACK_NAME}_api_internal.loadbalancer.server.port=8080

whoami:
Expand All @@ -247,4 +247,4 @@ services:
- traefik.http.services.${SWARM_STACK_NAME}_whoami.loadbalancer.server.port=80
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.rule=PathPrefix(`/whoami`)
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.entrypoints=traefik_monitor
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.middlewares=${SWARM_STACK_NAME}_gzip@docker
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.middlewares=${SWARM_STACK_NAME}_gzip@swarm
31 changes: 16 additions & 15 deletions services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.rule=hostregexp(`{host:.+}`) && (Path(`/`, `/v0`) || PathPrefix(`/v0/`) || Path(`/api/v0/openapi.json`))
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.entrypoints=simcore_api
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.priority=1
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.middlewares=${SWARM_STACK_NAME}_gzip@docker,ratelimit-${SWARM_STACK_NAME}_api-server,inflightreq-${SWARM_STACK_NAME}_api-server
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.middlewares=${SWARM_STACK_NAME}_gzip@swarm,ratelimit-${SWARM_STACK_NAME}_api-server,inflightreq-${SWARM_STACK_NAME}_api-server
networks:
- default

Expand Down Expand Up @@ -521,7 +521,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.service=${SWARM_STACK_NAME}_static_webserver
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.entrypoints=http
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.priority=2
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.middlewares=${SWARM_STACK_NAME}_gzip@docker,${SWARM_STACK_NAME}_static_webserver_retry
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.middlewares=${SWARM_STACK_NAME}_gzip@swarm,${SWARM_STACK_NAME}_static_webserver_retry
# catchall for legacy services (this happens if a backend disappears and a frontend tries to reconnect, the right return value is a 503)
- traefik.http.routers.${SWARM_STACK_NAME}_legacy_services_catchall.service=${SWARM_STACK_NAME}_legacy_services_catchall
- traefik.http.routers.${SWARM_STACK_NAME}_legacy_services_catchall.priority=1
Expand Down Expand Up @@ -749,7 +749,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.rule=hostregexp(`{host:.+}`) && (Path(`/`, `/v0`,`/socket.io/`,`/static-frontend-data.json`, `/study/{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}`, `/view`, `/#/view`, `/#/error`) || PathPrefix(`/v0/`))
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.entrypoints=http
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.priority=2
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.middlewares=${SWARM_STACK_NAME}_gzip@docker, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@docker, ${SWARM_STACK_NAME}_webserver_retry
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_retry
networks: &webserver_networks
- default
- interactive_services_subnet
Expand Down Expand Up @@ -1160,7 +1160,7 @@ services:
retries: 50

traefik:
image: "traefik:v2.9.8@sha256:553239e27c4614d0477651415205b9b119f7a98f698e6562ef383c9d8ff3b6e6"
image: "traefik:v3.1.2@sha256:ec1a82940b8e00eaeef33fb4113aa1d1573b2ebb6440e10c023743fe96f08475"
init: true
hostname: "{{.Node.Hostname}}-{{.Task.Slot}}"
command:
Expand All @@ -1169,7 +1169,7 @@ services:
- "--ping=true"
- "--entryPoints.ping.address=:9082"
- "--ping.entryPoint=ping"
- "--log.level=WARNING"
- "--log.level=WARN" # WARN, not WARNING
- "--accesslog=false"
- "--metrics.prometheus=true"
- "--metrics.prometheus.addEntryPointsLabels=true"
Expand All @@ -1182,17 +1182,18 @@ services:
- "--entryPoints.simcore_api.forwardedHeaders.insecure"
- "--entryPoints.traefik_monitor.address=:8080"
- "--entryPoints.traefik_monitor.forwardedHeaders.insecure"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.network=${SWARM_STACK_NAME}_default"
- "--providers.docker.swarmMode=true"
- "--providers.swarm.endpoint=unix:///var/run/docker.sock"
- "--providers.swarm.network=${SWARM_STACK_NAME}_default"
# https://github.com/traefik/traefik/issues/7886
- "--providers.docker.swarmModeRefreshSeconds=1"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.constraints=Label(`io.simcore.zone`, `${TRAEFIK_SIMCORE_ZONE}`)"
- "--tracing=true"
- "--tracing.jaeger=true"
- "--tracing.jaeger.samplingServerURL=http://jaeger:5778/sampling"
- "--tracing.jaeger.localAgentHostPort=jaeger:6831"
- "--providers.swarm.refreshSeconds=1"
- "--providers.swarm.exposedByDefault=false"
- "--providers.swarm.constraints=Label(`io.simcore.zone`, `${TRAEFIK_SIMCORE_ZONE}`)"
- "--core.defaultRuleSyntax=v2"
- "--tracing"
- "--tracing.addinternals"
- "--tracing.otlp=true"
- "--tracing.otlp.http=true"
# - "--tracing.otlp.http.endpoint=0.0.0.0:4318/v1/traces"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
Expand Down

0 comments on commit 3fbb7ce

Please sign in to comment.