Skip to content

Commit 3039c0a

Browse files
committed
added RABBIT_MQ
1 parent 7c6cf64 commit 3039c0a

File tree

2 files changed

+39
-19
lines changed

2 files changed

+39
-19
lines changed

services/dask-sidecar/src/simcore_service_dask_sidecar/settings.py

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pydantic import AliasChoices, Field, field_validator
66
from servicelib.logging_utils_filtering import LoggerName, MessageSubstring
77
from settings_library.application import BaseApplicationSettings
8+
from settings_library.rabbit import RabbitSettings
89
from settings_library.utils_logging import MixinLoggingSettings
910

1011

@@ -23,28 +24,42 @@ class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
2324

2425
DASK_SIDECAR_INTERVAL_TO_CHECK_TASK_ABORTED_S: int | None = 5
2526

26-
DASK_START_AS_SCHEDULER: bool | None = Field(
27-
default=False, description="If this env is set, then the app boots as scheduler"
28-
)
27+
DASK_START_AS_SCHEDULER: Annotated[
28+
bool | None,
29+
Field(description="If this env is set, then the app boots as scheduler"),
30+
] = False
2931

30-
DASK_SCHEDULER_HOST: str | None = Field(
31-
None,
32-
description="Address of the scheduler to register (only if started as worker )",
33-
)
32+
DASK_SCHEDULER_HOST: Annotated[
33+
str | None,
34+
Field(
35+
description="Address of the scheduler to register (only if started as worker )",
36+
),
37+
] = None
3438

35-
DASK_LOG_FORMAT_LOCAL_DEV_ENABLED: bool = Field(
36-
default=False,
37-
validation_alias=AliasChoices(
38-
"DASK_LOG_FORMAT_LOCAL_DEV_ENABLED",
39-
"LOG_FORMAT_LOCAL_DEV_ENABLED",
39+
DASK_LOG_FORMAT_LOCAL_DEV_ENABLED: Annotated[
40+
bool,
41+
Field(
42+
validation_alias=AliasChoices(
43+
"DASK_LOG_FORMAT_LOCAL_DEV_ENABLED",
44+
"LOG_FORMAT_LOCAL_DEV_ENABLED",
45+
),
46+
description="Enables local development log format. WARNING: make sure it is disabled if you want to have structured logs!",
4047
),
41-
description="Enables local development log format. WARNING: make sure it is disabled if you want to have structured logs!",
42-
)
43-
DASK_LOG_FILTER_MAPPING: dict[LoggerName, list[MessageSubstring]] = Field(
44-
default_factory=dict,
45-
validation_alias=AliasChoices("DASK_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"),
46-
description="is a dictionary that maps specific loggers (such as 'uvicorn.access' or 'gunicorn.access') to a list of log message patterns that should be filtered out.",
47-
)
48+
] = False
49+
DASK_LOG_FILTER_MAPPING: Annotated[
50+
dict[LoggerName, list[MessageSubstring]],
51+
Field(
52+
default_factory=dict,
53+
validation_alias=AliasChoices(
54+
"DASK_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
55+
),
56+
description="is a dictionary that maps specific loggers (such as 'uvicorn.access' or 'gunicorn.access') to a list of log message patterns that should be filtered out.",
57+
),
58+
]
59+
60+
DASK_SIDECAR_RABBITMQ: Annotated[
61+
RabbitSettings | None, Field(json_schema_extra={"auto_default_from_env": True})
62+
]
4863

4964
@field_validator("DASK_SIDECAR_LOGLEVEL", mode="before")
5065
@classmethod

services/docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,11 @@ services:
11521152
DASK_SIDECAR_LOGLEVEL: ${DASK_SIDECAR_LOGLEVEL}
11531153
SIDECAR_COMP_SERVICES_SHARED_VOLUME_NAME: ${SWARM_STACK_NAME}_computational_shared_data
11541154
SIDECAR_COMP_SERVICES_SHARED_FOLDER: ${SIDECAR_COMP_SERVICES_SHARED_FOLDER:-/home/scu/computational_shared_data}
1155+
RABBIT_HOST: ${RABBIT_HOST}
1156+
RABBIT_PASSWORD: ${RABBIT_PASSWORD}
1157+
RABBIT_PORT: ${RABBIT_PORT}
1158+
RABBIT_SECURE: ${RABBIT_SECURE}
1159+
RABBIT_USER: ${RABBIT_USER}
11551160
networks:
11561161
- computational_services_subnet
11571162
secrets: *dask_tls_secrets

0 commit comments

Comments
 (0)