Skip to content

Commit

Permalink
hotfix #5931
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Neagu committed Jun 20, 2024
1 parent 74d4870 commit 545de96
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
16 changes: 12 additions & 4 deletions services/director-v2/tests/integration/02/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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}")
8 changes: 4 additions & 4 deletions services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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}
Expand All @@ -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}

Expand Down Expand Up @@ -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}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 545de96

Please sign in to comment.