From 545de9629de7dd6a52268a0d016c36fc5a32a32d Mon Sep 17 00:00:00 2001 From: Andrei Neagu Date: Thu, 20 Jun 2024 16:25:16 +0200 Subject: [PATCH] hotfix #5931 --- .../director-v2/tests/integration/02/utils.py | 16 ++++++++++++---- services/docker-compose.yml | 8 ++++---- .../notifications/_rabbitmq_consumers_common.py | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/services/director-v2/tests/integration/02/utils.py b/services/director-v2/tests/integration/02/utils.py index 325398ddc9f..c5b59686884 100644 --- a/services/director-v2/tests/integration/02/utils.py +++ b/services/director-v2/tests/integration/02/utils.py @@ -4,10 +4,11 @@ import json import logging import os +import re import urllib.parse from collections.abc import AsyncIterator from contextlib import asynccontextmanager, suppress -from typing import Any +from typing import Any, Final import aiodocker import httpx @@ -518,6 +519,13 @@ def run_command(command: str) -> str: return command_result +_SERVICE_CONVERGED_PATTERN: Final[str] = r"verify: Service.+converged$" + + +def _assert_service_converged(string) -> None: + assert bool(re.search(_SERVICE_CONVERGED_PATTERN, string)) is True + + async def _port_forward_legacy_service( # pylint: disable=redefined-outer-name service_name: str, internal_port: PositiveInt ) -> PositiveInt: @@ -529,13 +537,13 @@ async def _port_forward_legacy_service( # pylint: disable=redefined-outer-name # Legacy services are started --endpoint-mode dnsrr, it needs to # be changed to vip otherwise the port forward will not work result = run_command(f"docker service update {service_name} --endpoint-mode=vip") - assert "verify: Service converged" in result + _assert_service_converged(result) # Finally forward the port on a random assigned port. result = run_command( f"docker service update {service_name} --publish-add :{internal_port}" ) - assert "verify: Service converged" in result + _assert_service_converged(result) # inspect service and fetch the port async with aiodocker.Docker() as docker_client: @@ -626,4 +634,4 @@ async def sleep_for(interval: PositiveInt, reason: str) -> None: assert interval > 0 for i in range(1, interval + 1): await asyncio.sleep(1) - print(f"[{i}/{interval}]Sleeping: {reason}") + print(f"[{i}/{interval}]Sleeping: {reason}") \ No newline at end of file diff --git a/services/docker-compose.yml b/services/docker-compose.yml index 194e76769e8..184da52ef31 100644 --- a/services/docker-compose.yml +++ b/services/docker-compose.yml @@ -521,7 +521,7 @@ services: webserver: image: ${DOCKER_REGISTRY:-itisfoundation}/webserver:${DOCKER_IMAGE_TAG:-latest} init: true - hostname: "{{.Node.Hostname}}-{{.Task.Slot}}" + hostname: "wb-{{.Node.Hostname}}-{{.Task.Slot}}" # the hostname is used in conjonction with other services and must be unique see https://github.com/ITISFoundation/osparc-simcore/pull/5931 environment: &webserver_environment AIODEBUG_SLOW_DURATION_SECS: ${AIODEBUG_SLOW_DURATION_SECS} @@ -727,7 +727,7 @@ services: wb-api-server: image: ${DOCKER_REGISTRY:-itisfoundation}/webserver:${DOCKER_IMAGE_TAG:-latest} init: true - hostname: "{{.Node.Hostname}}-{{.Task.Slot}}" + hostname: "api-{{.Node.Hostname}}-{{.Task.Slot}}" # the hostname is used in conjonction with other services and must be unique see https://github.com/ITISFoundation/osparc-simcore/pull/5931 environment: <<: *webserver_environment WEBSERVER_HOST: ${WB_API_WEBSERVER_HOST} @@ -740,7 +740,7 @@ services: wb-db-event-listener: image: ${DOCKER_REGISTRY:-itisfoundation}/webserver:${DOCKER_IMAGE_TAG:-latest} init: true - hostname: "{{.Node.Hostname}}-{{.Task.Slot}}" + hostname: "db-{{.Node.Hostname}}-{{.Task.Slot}}" # the hostname is used in conjonction with other services and must be unique see https://github.com/ITISFoundation/osparc-simcore/pull/5931 environment: WEBSERVER_LOGLEVEL: ${WB_DB_EL_LOGLEVEL} @@ -824,7 +824,7 @@ services: wb-garbage-collector: image: ${DOCKER_REGISTRY:-itisfoundation}/webserver:${DOCKER_IMAGE_TAG:-latest} init: true - hostname: "{{.Node.Hostname}}-{{.Task.Slot}}" + hostname: "gc-{{.Node.Hostname}}-{{.Task.Slot}}" # the hostname is used in conjonction with other services and must be unique see https://github.com/ITISFoundation/osparc-simcore/pull/5931 environment: WEBSERVER_LOGLEVEL: ${WB_GC_LOGLEVEL} diff --git a/services/web/server/src/simcore_service_webserver/notifications/_rabbitmq_consumers_common.py b/services/web/server/src/simcore_service_webserver/notifications/_rabbitmq_consumers_common.py index 8838c26a6ef..9f033db621b 100644 --- a/services/web/server/src/simcore_service_webserver/notifications/_rabbitmq_consumers_common.py +++ b/services/web/server/src/simcore_service_webserver/notifications/_rabbitmq_consumers_common.py @@ -37,7 +37,7 @@ async def subscribe_to_rabbitmq( ) for p in exchange_to_parser_config ), - reraise=False, + reraise=True, ) return { exchange_name: queue_name