Skip to content

Commit 24218c1

Browse files
authored
⬆️ Pydantic V2: after upstream merge -> fixes (#6651)
1 parent 1fe311d commit 24218c1

File tree

16 files changed

+50
-20
lines changed
  • services
    • agent/src/simcore_service_agent/core
    • api-server/src/simcore_service_api_server/core
    • autoscaling/src/simcore_service_autoscaling/core
    • catalog/src/simcore_service_catalog/core
    • clusters-keeper/src/simcore_service_clusters_keeper/core
    • dask-sidecar/src/simcore_service_dask_sidecar
    • datcore-adapter/src/simcore_service_datcore_adapter/core
    • director-v2/src/simcore_service_director_v2/core
    • dynamic-scheduler/src/simcore_service_dynamic_scheduler/core
    • dynamic-sidecar/src/simcore_service_dynamic_sidecar/core
    • efs-guardian/src/simcore_service_efs_guardian/core
    • invitations/src/simcore_service_invitations/core
    • payments/src/simcore_service_payments/core
    • resource-usage-tracker/src/simcore_service_resource_usage_tracker/core
    • storage/src/simcore_service_storage
    • web/server/src/simcore_service_webserver

16 files changed

+50
-20
lines changed

services/agent/src/simcore_service_agent/core/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
3535
)
3636
AGENT_VOLUMES_LOG_FILTER_MAPPING: dict[LoggerName, list[MessageSubstring]] = Field(
3737
default_factory=dict,
38-
env=["AGENT_VOLUMES_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
38+
validation_alias=AliasChoices(
39+
"AGENT_VOLUMES_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
40+
),
3941
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.",
4042
)
4143
AGENT_VOLUMES_CLEANUP_TARGET_SWARM_STACK_NAME: str = Field(

services/api-server/src/simcore_service_api_server/core/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ class BasicSettings(BaseCustomSettings, MixinLoggingSettings):
7070
)
7171
API_SERVER_LOG_FILTER_MAPPING: dict[LoggerName, list[MessageSubstring]] = Field(
7272
default_factory=dict,
73-
env=["API_SERVER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
73+
validation_alias=AliasChoices(
74+
"API_SERVER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
75+
),
7476
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.",
7577
)
7678

services/autoscaling/src/simcore_service_autoscaling/core/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
248248
)
249249
AUTOSCALING_LOG_FILTER_MAPPING: dict[LoggerName, list[MessageSubstring]] = Field(
250250
default_factory=dict,
251-
env=["AUTOSCALING_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
251+
validation_alias=AliasChoices(
252+
"AUTOSCALING_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
253+
),
252254
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.",
253255
)
254256

services/catalog/src/simcore_service_catalog/core/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
5858
)
5959
CATALOG_LOG_FILTER_MAPPING: dict[LoggerName, list[MessageSubstring]] = Field(
6060
default_factory=dict,
61-
env=["CATALOG_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
61+
validation_alias=AliasChoices(
62+
"CATALOG_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
63+
),
6264
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.",
6365
)
6466
CATALOG_DEV_FEATURES_ENABLED: bool = Field(

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
283283
LoggerName, list[MessageSubstring]
284284
] = Field(
285285
default_factory=dict,
286-
env=["CLUSTERS_KEEPER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
286+
validation_alias=AliasChoices(
287+
"CLUSTERS_KEEPER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
288+
),
287289
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.",
288290
)
289291

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Settings(BaseCustomSettings, MixinLoggingSettings):
4848
)
4949
DASK_LOG_FILTER_MAPPING: dict[LoggerName, list[MessageSubstring]] = Field(
5050
default_factory=dict,
51-
env=["DASK_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
51+
validation_alias=AliasChoices("DASK_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"),
5252
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.",
5353
)
5454

services/datcore-adapter/src/simcore_service_datcore_adapter/core/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
4949
LoggerName, list[MessageSubstring]
5050
] = Field(
5151
default_factory=dict,
52-
env=["DATCORE_ADAPTER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
52+
validation_alias=AliasChoices(
53+
"DATCORE_ADAPTER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
54+
),
5355
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.",
5456
)
5557
DATCORE_ADAPTER_PROMETHEUS_INSTRUMENTATION_ENABLED: bool = True

services/director-v2/src/simcore_service_director_v2/core/settings.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
ClusterTypeInModel,
2121
NoAuthentication,
2222
)
23-
from pydantic import AnyHttpUrl, AnyUrl, Field, NonNegativeInt, validator
23+
from pydantic import AliasChoices, AnyHttpUrl, AnyUrl, Field, NonNegativeInt, validator
2424
from servicelib.logging_utils_filtering import LoggerName, MessageSubstring
2525
from settings_library.base import BaseCustomSettings
2626
from settings_library.catalog import CatalogSettings
@@ -123,19 +123,21 @@ class AppSettings(BaseCustomSettings, MixinLoggingSettings):
123123

124124
LOG_LEVEL: LogLevel = Field(
125125
LogLevel.INFO.value,
126-
env=["DIRECTOR_V2_LOGLEVEL", "LOG_LEVEL", "LOGLEVEL"],
126+
validation_alias=AliasChoices("DIRECTOR_V2_LOGLEVEL", "LOG_LEVEL", "LOGLEVEL"),
127127
)
128128
DIRECTOR_V2_LOG_FORMAT_LOCAL_DEV_ENABLED: bool = Field(
129129
default=False,
130-
env=[
130+
validation_alias=AliasChoices(
131131
"DIRECTOR_V2_LOG_FORMAT_LOCAL_DEV_ENABLED",
132132
"LOG_FORMAT_LOCAL_DEV_ENABLED",
133-
],
133+
),
134134
description="Enables local development log format. WARNING: make sure it is disabled if you want to have structured logs!",
135135
)
136136
DIRECTOR_V2_LOG_FILTER_MAPPING: dict[LoggerName, list[MessageSubstring]] = Field(
137137
default_factory=dict,
138-
env=["DIRECTOR_V2_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
138+
validation_alias=AliasChoices(
139+
"DIRECTOR_V2_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
140+
),
139141
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.",
140142
)
141143
DIRECTOR_V2_DEV_FEATURES_ENABLED: bool = False

services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ class _BaseApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
4141
LoggerName, list[MessageSubstring]
4242
] = Field(
4343
default_factory=dict,
44-
env=["DYNAMIC_SCHEDULER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
44+
validation_alias=AliasChoices(
45+
"DYNAMIC_SCHEDULER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
46+
),
4547
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.",
4648
)
4749

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/core/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
154154
)
155155
DY_SIDECAR_LOG_FILTER_MAPPING: dict[LoggerName, list[MessageSubstring]] = Field(
156156
default={},
157-
env=["DY_SIDECAR_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"],
157+
validation_alias=AliasChoices(
158+
"DY_SIDECAR_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING"
159+
),
158160
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.",
159161
)
160162
DY_SIDECAR_USER_ID: UserID

0 commit comments

Comments
 (0)