Skip to content

Commit d0e7a06

Browse files
committed
doc
1 parent fbc1f75 commit d0e7a06

File tree

3 files changed

+13
-34
lines changed

3 files changed

+13
-34
lines changed

.env-devel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ DIRECTOR_LOGLEVEL=INFO
7777
DIRECTOR_MONITORING_ENABLED=True
7878
DIRECTOR_PORT=8000
7979
DIRECTOR_PUBLISHED_HOST_NAME="127.0.0.1:9081"
80-
DIRECTOR_REGISTRY_CACHING_TTL=900
80+
DIRECTOR_REGISTRY_CACHING_TTL=00:15:00
8181
DIRECTOR_REGISTRY_CACHING=True
8282
DIRECTOR_SERVICES_CUSTOM_CONSTRAINTS=null
8383
DIRECTOR_TRACING={}

services/director/src/simcore_service_director/core/settings.py

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@
33
from typing import cast
44

55
from fastapi import FastAPI
6-
from models_library.basic_types import (
7-
BootModeEnum,
8-
BuildTargetEnum,
9-
LogLevel,
10-
PortInt,
11-
VersionTag,
12-
)
13-
from pydantic import Field, NonNegativeInt, PositiveInt, validator
6+
from models_library.basic_types import LogLevel, PortInt, VersionTag
7+
from pydantic import Field, NonNegativeInt, validator
148
from servicelib.logging_utils_filtering import LoggerName, MessageSubstring
15-
from settings_library.base import BaseCustomSettings
9+
from settings_library.application import BaseApplicationSettings
1610
from settings_library.docker_registry import RegistrySettings
1711
from settings_library.postgres import PostgresSettings
1812
from settings_library.tracing import TracingSettings
@@ -21,32 +15,11 @@
2115
from .._meta import API_VERSION, API_VTAG, APP_NAME
2216

2317

24-
class ApplicationSettings(BaseCustomSettings, MixinLoggingSettings):
25-
# CODE STATICS ---------------------------------------------------------
18+
class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings):
2619
API_VERSION: str = API_VERSION
2720
APP_NAME: str = APP_NAME
2821
API_VTAG: VersionTag = API_VTAG
2922

30-
# IMAGE BUILDTIME ------------------------------------------------------
31-
# @Makefile
32-
SC_BUILD_DATE: str | None = None
33-
SC_BUILD_TARGET: BuildTargetEnum | None = None
34-
SC_VCS_REF: str | None = None
35-
SC_VCS_URL: str | None = None
36-
37-
# @Dockerfile
38-
SC_BOOT_MODE: BootModeEnum | None = None
39-
SC_BOOT_TARGET: BuildTargetEnum | None = None
40-
SC_HEALTHCHECK_TIMEOUT: PositiveInt | None = Field(
41-
None,
42-
description="If a single run of the check takes longer than timeout seconds "
43-
"then the check is considered to have failed."
44-
"It takes retries consecutive failures of the health check for the container to be considered unhealthy.",
45-
)
46-
SC_USER_ID: int | None = None
47-
SC_USER_NAME: str | None = None
48-
49-
# RUNTIME -----------------------------------------------------------
5023
DIRECTOR_DEBUG: bool = Field(
5124
default=False, description="Debug mode", env=["DIRECTOR_DEBUG", "DEBUG"]
5225
)

services/director/src/simcore_service_director/registry_proxy.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242

4343
logger = logging.getLogger(__name__)
4444

45+
#
46+
# NOTE: if you are refactoring this module,
47+
# please consider reusing packages/pytest-simcore/src/pytest_simcore/helpers/docker_registry.py
48+
#
49+
4550

4651
class ServiceType(enum.Enum):
4752
ALL = ""
@@ -375,10 +380,11 @@ async def get_image_details(
375380
async def get_repo_details(app: FastAPI, image_key: str) -> list[dict[str, Any]]:
376381

377382
image_tags = await list_image_tags(app, image_key)
383+
378384
results = await limited_gather(
379385
*[get_image_details(app, image_key, tag) for tag in image_tags],
380386
reraise=False,
381-
_logger=logger,
387+
log=logger,
382388
limit=_MAX_CONCURRENT_CALLS,
383389
)
384390
return [result for result in results if not isinstance(result, BaseException)]
@@ -400,7 +406,7 @@ async def list_services(app: FastAPI, service_type: ServiceType) -> list[dict]:
400406
results = await limited_gather(
401407
*[get_repo_details(app, repo) for repo in repos],
402408
reraise=False,
403-
_logger=logger,
409+
log=logger,
404410
limit=_MAX_CONCURRENT_CALLS,
405411
)
406412

0 commit comments

Comments
 (0)