File tree Expand file tree Collapse file tree 22 files changed +134
-42
lines changed
packages/service-library/src/servicelib/aiohttp
src/simcore_service_clusters_keeper
resource-usage-tracker/docker Expand file tree Collapse file tree 22 files changed +134
-42
lines changed Original file line number Diff line number Diff line change 88from common_library .error_codes import ErrorCodeStr
99from common_library .json_serialization import json_dumps
1010from models_library .rest_error import ErrorGet , ErrorItemType
11- from servicelib .rest_constants import RESPONSE_MODEL_POLICY
1211
1312from ..aiohttp .status import HTTP_200_OK
1413from ..mimetype_constants import MIMETYPE_APPLICATION_JSON
14+ from ..rest_constants import RESPONSE_MODEL_POLICY
1515from ..rest_responses import is_enveloped
1616from ..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
Original file line number Diff line number Diff line change 3232
3333if [ " ${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
3640fi
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 \
Original file line number Diff line number Diff line change 2727
2828if [ " ${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
3135fi
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
Original file line number Diff line number Diff line change 3131
3232if [ " ${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
3539fi
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
Original file line number Diff line number Diff line change 2727
2828if [ " ${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
3135fi
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
Original file line number Diff line number Diff line change 3232
3333if [ " ${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
3640fi
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
Original file line number Diff line number Diff line change 2323from ..rpc .rpc_routes import setup_rpc_routes
2424from .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
2938def 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 ,
Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff line change 77
88
99def 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
1615def get_scheduler_auth (app : FastAPI ) -> ClusterAuthentication :
Original file line number Diff line number Diff line change 3333
3434if [ " ${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
3741fi
3842
3943# RUNNING application ----------------------------------------
You can’t perform that action at this time.
0 commit comments