Skip to content

Commit 532f8eb

Browse files
authored
🐛On-demand computational backend failing (#7735)
1 parent e8ce837 commit 532f8eb

File tree

22 files changed

+134
-42
lines changed

22 files changed

+134
-42
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
from common_library.error_codes import ErrorCodeStr
99
from common_library.json_serialization import json_dumps
1010
from models_library.rest_error import ErrorGet, ErrorItemType
11-
from servicelib.rest_constants import RESPONSE_MODEL_POLICY
1211

1312
from ..aiohttp.status import HTTP_200_OK
1413
from ..mimetype_constants import MIMETYPE_APPLICATION_JSON
14+
from ..rest_constants import RESPONSE_MODEL_POLICY
1515
from ..rest_responses import is_enveloped
1616
from ..status_codes_utils import get_code_description
1717

@@ -54,7 +54,7 @@ def create_http_error(
5454
http_error_cls: type[HTTPError] = web.HTTPInternalServerError,
5555
*,
5656
skip_internal_error_details: bool = False,
57-
error_code: ErrorCodeStr | None = None
57+
error_code: ErrorCodeStr | None = None,
5858
) -> HTTPError:
5959
"""
6060
- Response body conforms OAS schema model

services/agent/docker/boot.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ fi
3232

3333
if [ "${SC_BOOT_MODE}" = "debug" ]; then
3434
# NOTE: production does NOT pre-installs debugpy
35-
uv pip install debugpy
35+
if command -v uv >/dev/null 2>&1; then
36+
uv pip install debugpy
37+
else
38+
pip install debugpy
39+
fi
3640
fi
3741

3842
#
@@ -48,7 +52,7 @@ if [ "${SC_BOOT_MODE}" = "debug" ]; then
4852

4953
exec sh -c "
5054
cd services/agent/src/simcore_service_agent && \
51-
python -m debugpy --listen 0.0.0.0:${AGENT_SERVER_REMOTE_DEBUG_PORT} -m uvicorn main:the_app \
55+
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:${AGENT_SERVER_REMOTE_DEBUG_PORT} -m uvicorn main:the_app \
5256
--host 0.0.0.0 \
5357
--port 8000 \
5458
--reload \

services/api-server/docker/boot.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ fi
2727

2828
if [ "${SC_BOOT_MODE}" = "debug" ]; then
2929
# NOTE: production does NOT pre-installs debugpy
30-
uv pip install debugpy
30+
if command -v uv >/dev/null 2>&1; then
31+
uv pip install debugpy
32+
else
33+
pip install debugpy
34+
fi
3135
fi
3236

3337
# RUNNING application ----------------------------------------
@@ -40,7 +44,7 @@ if [ "${SC_BOOT_MODE}" = "debug" ]; then
4044

4145
exec sh -c "
4246
cd services/api-server/src/simcore_service_api_server && \
43-
python -m debugpy --listen 0.0.0.0:${API_SERVER_REMOTE_DEBUG_PORT} -m uvicorn main:the_app \
47+
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:${API_SERVER_REMOTE_DEBUG_PORT} -m uvicorn main:the_app \
4448
--host 0.0.0.0 \
4549
--reload \
4650
$reload_dir_packages

services/autoscaling/docker/boot.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ fi
3131

3232
if [ "${SC_BOOT_MODE}" = "debug" ]; then
3333
# NOTE: production does NOT pre-installs debugpy
34-
uv pip install debugpy
34+
if command -v uv >/dev/null 2>&1; then
35+
uv pip install debugpy
36+
else
37+
pip install debugpy
38+
fi
3539
fi
3640

3741
#
@@ -47,7 +51,7 @@ if [ "${SC_BOOT_MODE}" = "debug" ]; then
4751

4852
exec sh -c "
4953
cd services/autoscaling/src/simcore_service_autoscaling && \
50-
python -m debugpy --listen 0.0.0.0:${AUTOSCALING_REMOTE_DEBUGGING_PORT} -m uvicorn main:the_app \
54+
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:${AUTOSCALING_REMOTE_DEBUGGING_PORT} -m uvicorn main:the_app \
5155
--host 0.0.0.0 \
5256
--reload \
5357
$reload_dir_packages

services/catalog/docker/boot.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ fi
2727

2828
if [ "${SC_BOOT_MODE}" = "debug" ]; then
2929
# NOTE: production does NOT pre-installs debugpy
30-
uv pip install debugpy
30+
if command -v uv >/dev/null 2>&1; then
31+
uv pip install debugpy
32+
else
33+
pip install debugpy
34+
fi
3135
fi
3236

3337
# RUNNING application ----------------------------------------
@@ -40,7 +44,7 @@ if [ "${SC_BOOT_MODE}" = "debug" ]; then
4044

4145
exec sh -c "
4246
cd services/catalog/src/simcore_service_catalog && \
43-
python -m debugpy --listen 0.0.0.0:${CATALOG_REMOTE_DEBUGGING_PORT} -m uvicorn main:the_app \
47+
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:${CATALOG_REMOTE_DEBUGGING_PORT} -m uvicorn main:the_app \
4448
--host 0.0.0.0 \
4549
--reload \
4650
$reload_dir_packages

services/clusters-keeper/docker/boot.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ fi
3232

3333
if [ "${SC_BOOT_MODE}" = "debug" ]; then
3434
# NOTE: production does NOT pre-installs debugpy
35-
uv pip install debugpy
35+
if command -v uv >/dev/null 2>&1; then
36+
uv pip install debugpy
37+
else
38+
pip install debugpy
39+
fi
3640
fi
3741

3842
#
@@ -48,7 +52,7 @@ if [ "${SC_BOOT_MODE}" = "debug" ]; then
4852

4953
exec sh -c "
5054
cd services/clusters-keeper/src/simcore_service_clusters_keeper && \
51-
python -m debugpy --listen 0.0.0.0:${CLUSTERS_KEEPER_REMOTE_DEBUGGING_PORT} -m uvicorn main:the_app \
55+
python -Xfrozen_modules=off -m debugpy --listen 0.0.0.0:${CLUSTERS_KEEPER_REMOTE_DEBUGGING_PORT} -m uvicorn main:the_app \
5256
--host 0.0.0.0 \
5357
--reload \
5458
$reload_dir_packages

services/clusters-keeper/src/simcore_service_clusters_keeper/core/application.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,27 @@
2323
from ..rpc.rpc_routes import setup_rpc_routes
2424
from .settings import ApplicationSettings
2525

26-
logger = logging.getLogger(__name__)
26+
_LOG_LEVEL_STEP = logging.CRITICAL - logging.ERROR
27+
_NOISY_LOGGERS = (
28+
"aiobotocore",
29+
"aio_pika",
30+
"aiormq",
31+
"botocore",
32+
"werkzeug",
33+
)
34+
35+
_logger = logging.getLogger(__name__)
2736

2837

2938
def create_app(settings: ApplicationSettings) -> FastAPI:
30-
logger.info("app settings: %s", settings.model_dump_json(indent=1))
39+
# keep mostly quiet noisy loggers
40+
quiet_level: int = max(
41+
min(logging.root.level + _LOG_LEVEL_STEP, logging.CRITICAL), logging.WARNING
42+
)
43+
for name in _NOISY_LOGGERS:
44+
logging.getLogger(name).setLevel(quiet_level)
45+
46+
_logger.info("app settings: %s", settings.model_dump_json(indent=1))
3147

3248
app = FastAPI(
3349
debug=settings.CLUSTERS_KEEPER_DEBUG,

services/clusters-keeper/src/simcore_service_clusters_keeper/data/docker-compose.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
image: ${DOCKER_REGISTRY:-itisfoundation}/dask-sidecar:${DOCKER_IMAGE_TAG}
44
init: true
55
hostname: "{{.Node.Hostname}}-{{.Task.Slot}}"
6+
volumes:
7+
- computational_shared_data:${SIDECAR_COMP_SERVICES_SHARED_FOLDER:-/home/scu/computational_shared_data}
68
networks:
79
- cluster
810
environment:
@@ -15,6 +17,9 @@ services:
1517
DASK_WORKER_SATURATION: ${DASK_WORKER_SATURATION}
1618
LOG_LEVEL: ${LOG_LEVEL}
1719

20+
SIDECAR_COMP_SERVICES_SHARED_FOLDER: /home/scu/computational_shared_data
21+
SIDECAR_COMP_SERVICES_SHARED_VOLUME_NAME: computational_shared_data
22+
1823
ports:
1924
- 8786:8786 # dask-scheduler access
2025
- 8787:8787 # dashboard
@@ -110,7 +115,7 @@ services:
110115
EC2_INSTANCES_TIME_BEFORE_DRAINING: ${WORKERS_EC2_INSTANCES_TIME_BEFORE_DRAINING}
111116
EC2_INSTANCES_TIME_BEFORE_TERMINATION: ${WORKERS_EC2_INSTANCES_TIME_BEFORE_TERMINATION}
112117
LOG_FORMAT_LOCAL_DEV_ENABLED: 1
113-
LOG_LEVEL: ${LOG_LEVEL:-WARNING}
118+
LOG_LEVEL: ${LOG_LEVEL}
114119
REDIS_HOST: redis
115120
REDIS_PORT: 6379
116121
volumes:

services/clusters-keeper/src/simcore_service_clusters_keeper/utils/dask.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77

88

99
def get_scheduler_url(ec2_instance: EC2InstanceData) -> AnyUrl:
10-
url: AnyUrl = TypeAdapter(AnyUrl).validate_python(
10+
return TypeAdapter(AnyUrl).validate_python(
1111
f"tls://{ec2_instance.aws_private_dns}:8786"
1212
)
13-
return url
1413

1514

1615
def get_scheduler_auth(app: FastAPI) -> ClusterAuthentication:

services/dask-sidecar/docker/boot.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ fi
3333

3434
if [ "${SC_BOOT_MODE}" = "debug" ]; then
3535
# NOTE: production does NOT pre-installs debugpy
36-
uv pip install debugpy
36+
if command -v uv >/dev/null 2>&1; then
37+
uv pip install debugpy
38+
else
39+
pip install debugpy
40+
fi
3741
fi
3842

3943
# RUNNING application ----------------------------------------

0 commit comments

Comments
 (0)