Skip to content

Commit 853d72e

Browse files
committed
base applciation settings
1 parent 503dd72 commit 853d72e

File tree

2 files changed

+13
-37
lines changed

2 files changed

+13
-37
lines changed

packages/settings-library/src/settings_library/application.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Annotated
2+
13
from pydantic import Field, PositiveInt
24

35
from .base import BaseCustomSettings
@@ -18,11 +20,13 @@ class BaseApplicationSettings(BaseCustomSettings):
1820
# @Dockerfile
1921
SC_BOOT_MODE: BootModeEnum | None = None
2022
SC_BOOT_TARGET: BuildTargetEnum | None = None
21-
SC_HEALTHCHECK_TIMEOUT: PositiveInt | None = Field(
22-
default=None,
23-
description="If a single run of the check takes longer than timeout seconds "
24-
"then the check is considered to have failed."
25-
"It takes retries consecutive failures of the health check for the container to be considered unhealthy.",
26-
)
23+
SC_HEALTHCHECK_TIMEOUT: Annotated[
24+
PositiveInt | None,
25+
Field(
26+
description="If a single run of the check takes longer than timeout seconds "
27+
"then the check is considered to have failed."
28+
"It takes retries consecutive failures of the health check for the container to be considered unhealthy.",
29+
),
30+
] = None
2731
SC_USER_ID: int | None = None
2832
SC_USER_NAME: str | None = None

services/web/server/src/simcore_service_webserver/application_settings.py

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@
55
from aiohttp import web
66
from common_library.basic_types import DEFAULT_FACTORY
77
from common_library.pydantic_fields_extension import is_nullable
8-
from models_library.basic_types import (
9-
BootModeEnum,
10-
BuildTargetEnum,
11-
LogLevel,
12-
PortInt,
13-
VersionTag,
14-
)
8+
from models_library.basic_types import LogLevel, PortInt, VersionTag
159
from models_library.utils.change_case import snake_to_camel
1610
from pydantic import (
1711
AliasChoices,
@@ -22,9 +16,8 @@
2216
model_validator,
2317
)
2418
from pydantic.fields import Field
25-
from pydantic.types import PositiveInt
2619
from servicelib.logging_utils_filtering import LoggerName, MessageSubstring
27-
from settings_library.base import BaseCustomSettings
20+
from settings_library.application import BaseApplicationSettings
2821
from settings_library.email import SMTPSettings
2922
from settings_library.postgres import PostgresSettings
3023
from settings_library.prometheus import PrometheusSettings
@@ -60,33 +53,12 @@
6053
_logger = logging.getLogger(__name__)
6154

6255

63-
class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
56+
class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
6457
# CODE STATICS ---------------------------------------------------------
6558
API_VERSION: str = API_VERSION
6659
APP_NAME: str = APP_NAME
6760
API_VTAG: VersionTag = TypeAdapter(VersionTag).validate_python(API_VTAG)
6861

69-
# IMAGE BUILDTIME ------------------------------------------------------
70-
# @Makefile
71-
SC_BUILD_DATE: str | None = None
72-
SC_BUILD_TARGET: BuildTargetEnum | None = None
73-
SC_VCS_REF: str | None = None
74-
SC_VCS_URL: str | None = None
75-
76-
# @Dockerfile
77-
SC_BOOT_MODE: BootModeEnum | None = None
78-
SC_HEALTHCHECK_TIMEOUT: Annotated[
79-
PositiveInt | None,
80-
Field(
81-
None,
82-
description="If a single run of the check takes longer than timeout seconds "
83-
"then the check is considered to have failed."
84-
"It takes retries consecutive failures of the health check for the container to be considered unhealthy.",
85-
),
86-
]
87-
SC_USER_ID: int | None = None
88-
SC_USER_NAME: str | None = None
89-
9062
# RUNTIME -----------------------------------------------------------
9163
# settings defined from environs defined when container runs
9264
#

0 commit comments

Comments
 (0)