Skip to content

Commit 948310d

Browse files
authored
Merge branch 'master' into feature/mock-job-manager
2 parents cc39821 + 85e24e8 commit 948310d

File tree

36 files changed

+141
-109
lines changed

36 files changed

+141
-109
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Makefile @pcrespov @sanderegg
2929
/services/clusters-keeper/ @sanderegg
3030
/services/datcore-adapter/ @sanderegg
3131
/services/director*/ @sanderegg @pcrespov @GitHK
32-
/services/docker-compose*.yml @sanderegg @mrnicegyu11 @YuryHrytsuk
32+
/services/docker-compose.yml @sanderegg @mrnicegyu11 @YuryHrytsuk
33+
/services/docker-compose.*.yml @sanderegg
3334
/services/dynamic-sidecar/ @GitHK
3435
/services/efs-guardian/ @matusdrobuliak66
3536
/services/invitations/ @pcrespov

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ endef
357357
show-endpoints:
358358
@$(_show_endpoints)
359359

360+
export HOST_UV_CACHE_DIR := $(shell uv cache dir)
361+
360362
up-devel: .stack-simcore-development.yml .init-swarm $(CLIENT_WEB_OUTPUT) ## Deploys local development stack, qx-compile+watch and ops stack (pass 'make ops_disabled=1 up-...' to disable)
361363
# Start compile+watch front-end container [front-end]
362364
@$(MAKE_C) services/static-webserver/client down compile-dev flags=--watch

packages/service-library/src/servicelib/aiohttp/rest_middlewares.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
from .typing_extension import Handler, Middleware
2525

2626
DEFAULT_API_VERSION = "v0"
27-
_FMSG_INTERNAL_ERROR_USER_FRIENDLY_WITH_OEC = (
27+
_FMSG_INTERNAL_ERROR_USER_FRIENDLY = (
2828
"We apologize for the inconvenience. "
29-
"Our team has recorded the issue [SupportID={error_code}]. "
30-
"If the issue persists please report it."
29+
"The issue has been recorded, please report it if it persists."
3130
)
3231

3332

@@ -52,7 +51,7 @@ def _process_and_raise_unexpected_error(request: web.BaseRequest, err: Exception
5251
"request.path": f"{request.path}",
5352
}
5453

55-
user_error_msg = _FMSG_INTERNAL_ERROR_USER_FRIENDLY_WITH_OEC.format(
54+
user_error_msg = _FMSG_INTERNAL_ERROR_USER_FRIENDLY.format(
5655
error_code=error_code
5756
)
5857
http_error = create_http_error(

packages/service-library/src/servicelib/fastapi/cancellation_middleware.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ async def _message_poller(
2020
while True:
2121
message = await receive()
2222
if message["type"] == "http.disconnect":
23-
_logger.info("client disconnected, terminating request to %s!", request.url)
23+
_logger.debug(
24+
"client disconnected, terminating request to %s!", request.url
25+
)
2426
raise _TerminateTaskGroupError
2527

2628
# Puts the message in the queue
@@ -57,7 +59,6 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
5759

5860
# Let's make a shared queue for the request messages
5961
queue: asyncio.Queue[Message] = asyncio.Queue()
60-
6162
request = Request(scope)
6263

6364
with log_context(_logger, logging.DEBUG, f"cancellable request {request.url}"):
@@ -72,6 +73,8 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
7273
await handler_task
7374
poller_task.cancel()
7475
except* _TerminateTaskGroupError:
75-
_logger.info(
76-
"The client disconnected. request to %s was cancelled.", request.url
77-
)
76+
if not handler_task.done():
77+
_logger.info(
78+
"The client disconnected. request to %s was cancelled.",
79+
request.url,
80+
)

packages/service-library/tests/aiohttp/test_rest_middlewares.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
import pytest
1414
from aiohttp import web
1515
from aiohttp.test_utils import TestClient
16-
from common_library.error_codes import parse_error_codes
1716
from common_library.json_serialization import json_dumps
1817
from servicelib.aiohttp import status
1918
from servicelib.aiohttp.rest_middlewares import (
20-
_FMSG_INTERNAL_ERROR_USER_FRIENDLY_WITH_OEC,
2119
envelope_middleware_factory,
2220
error_middleware_factory,
2321
)
@@ -234,14 +232,6 @@ async def test_raised_unhandled_exception(
234232
assert not data
235233
assert error
236234

237-
# user friendly message with OEC reference
238-
assert "OEC" in error["message"]
239-
parsed_oec = parse_error_codes(error["message"]).pop()
240-
assert (
241-
_FMSG_INTERNAL_ERROR_USER_FRIENDLY_WITH_OEC.format(error_code=parsed_oec)
242-
== error["message"]
243-
)
244-
245235
# avoids details
246236
assert not error.get("errors")
247237
assert not error.get("logs")

packages/service-library/tests/test_logging_errors.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import logging
44

55
import pytest
6-
7-
from common_library.error_codes import create_error_code
6+
from common_library.error_codes import create_error_code, parse_error_code_parts
87
from common_library.errors_classes import OsparcErrorMixin
98
from servicelib.logging_errors import (
109
create_troubleshotting_log_kwargs,
@@ -22,7 +21,11 @@ class MyError(OsparcErrorMixin, RuntimeError):
2221
exc = exc_info.value
2322
error_code = create_error_code(exc)
2423

25-
assert exc.error_code() == error_code
24+
eoc1_fingerprint, eoc1_snapshot = parse_error_code_parts(error_code)
25+
eoc2_fingerprint, eoc2_snapshot = parse_error_code_parts(exc.error_code())
26+
27+
assert eoc1_fingerprint == eoc2_fingerprint
28+
assert eoc1_snapshot <= eoc2_snapshot
2629

2730
msg = f"Nice message to user [{error_code}]"
2831

@@ -45,7 +48,7 @@ class MyError(OsparcErrorMixin, RuntimeError):
4548
assert log_kwargs["extra"] is not None
4649
assert (
4750
# pylint: disable=unsubscriptable-object
48-
log_kwargs["extra"]["log_uid"]
51+
log_kwargs["extra"].get("log_uid")
4952
== "123"
5053
), "user_id is injected as extra from context"
5154

services/agent/docker/boot.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
2424
command -v python | sed 's/^/ /'
2525

2626
cd services/agent
27-
uv pip --quiet --no-cache-dir sync requirements/dev.txt
27+
uv pip --quiet sync requirements/dev.txt
2828
cd -
2929
echo "$INFO" "PIP :"
3030
uv pip list
3131
fi
3232

3333
if [ "${SC_BOOT_MODE}" = "debug" ]; then
3434
# NOTE: production does NOT pre-installs debugpy
35-
uv pip install --no-cache-dir debugpy
35+
uv pip install debugpy
3636
fi
3737

3838
#

services/api-server/docker/boot.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
1919
command -v python | sed 's/^/ /'
2020

2121
cd services/api-server
22-
uv pip --quiet --no-cache-dir sync requirements/dev.txt
22+
uv pip --quiet sync requirements/dev.txt
2323
cd -
2424
echo "$INFO" "PIP :"
2525
uv pip list
2626
fi
2727

2828
if [ "${SC_BOOT_MODE}" = "debug" ]; then
2929
# NOTE: production does NOT pre-installs debugpy
30-
uv pip install --no-cache-dir debugpy
30+
uv pip install debugpy
3131
fi
3232

3333
# RUNNING application ----------------------------------------

services/autoscaling/docker/boot.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
2424
command -v python | sed 's/^/ /'
2525

2626
cd services/autoscaling
27-
uv pip --quiet --no-cache-dir sync requirements/dev.txt
27+
uv pip --quiet sync requirements/dev.txt
2828
cd -
2929
uv pip list
3030
fi
3131

3232
if [ "${SC_BOOT_MODE}" = "debug" ]; then
3333
# NOTE: production does NOT pre-installs debugpy
34-
uv pip install --no-cache-dir debugpy
34+
uv pip install debugpy
3535
fi
3636

3737
#

services/catalog/docker/boot.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ if [ "${SC_BUILD_TARGET}" = "development" ]; then
1919
command -v python | sed 's/^/ /'
2020

2121
cd services/catalog
22-
uv pip --quiet --no-cache-dir sync requirements/dev.txt
22+
uv pip --quiet sync requirements/dev.txt
2323
cd -
2424
echo "$INFO" "PIP :"
2525
uv pip list
2626
fi
2727

2828
if [ "${SC_BOOT_MODE}" = "debug" ]; then
2929
# NOTE: production does NOT pre-installs debugpy
30-
uv pip install --no-cache-dir debugpy
30+
uv pip install debugpy
3131
fi
3232

3333
# RUNNING application ----------------------------------------

0 commit comments

Comments
 (0)