Skip to content

Commit 1b3e7be

Browse files
🎨 adding optional override of dnsrr mode for testing purpose on master (⚠️ devops) (#5363)
1 parent f23a597 commit 1b3e7be

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.env-devel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ COMPUTATIONAL_BACKEND_DEFAULT_FILE_LINK_TYPE=PRESIGNED
6060
COMPUTATIONAL_BACKEND_ON_DEMAND_CLUSTERS_FILE_LINK_TYPE=PRESIGNED
6161
DIRECTOR_V2_DEV_FEATURES_ENABLED=0
6262

63+
DYNAMIC_SIDECAR_ENDPOINT_SPECS_MODE_DNSRR_ENABLED=0
6364
DYNAMIC_SIDECAR_IMAGE=${DOCKER_REGISTRY:-itisfoundation}/dynamic-sidecar:${DOCKER_IMAGE_TAG:-latest}
6465
DYNAMIC_SIDECAR_LOG_LEVEL=DEBUG
6566
DYNAMIC_SIDECAR_PROMETHEUS_SERVICE_LABELS={}

services/director-v2/src/simcore_service_director_v2/core/dynamic_services_settings/sidecar.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ def warn_if_any_values_provided(cls, value: dict) -> dict:
9797

9898

9999
class DynamicSidecarSettings(BaseCustomSettings, MixinLoggingSettings):
100+
DYNAMIC_SIDECAR_ENDPOINT_SPECS_MODE_DNSRR_ENABLED: bool = Field( # doc: https://docs.docker.com/engine/swarm/networking/#configure-service-discovery
101+
default=False,
102+
env=["DYNAMIC_SIDECAR_ENDPOINT_SPECS_MODE_DNSRR_ENABLED"],
103+
description="dynamic-sidecar's service 'endpoint_spec' with {'Mode': 'dnsrr'}",
104+
)
100105
DYNAMIC_SIDECAR_SC_BOOT_MODE: BootModeEnum = Field(
101106
...,
102107
description="Boot mode used for the dynamic-sidecar services"

services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/sidecar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,9 @@ def get_dynamic_sidecar_spec( # pylint:disable=too-many-arguments# noqa: PLR091
448448
},
449449
}
450450

451+
if dynamic_sidecar_settings.DYNAMIC_SIDECAR_ENDPOINT_SPECS_MODE_DNSRR_ENABLED:
452+
create_service_params["endpoint_spec"] = {"Mode": "dnsrr"}
453+
451454
update_service_params_from_settings(
452455
labels_service_settings=settings,
453456
create_service_params=create_service_params,

services/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ services:
267267
- DIRECTOR_V2_DYNAMIC_SCHEDULER_IGNORE_SERVICES_SHUTDOWN_WHEN_CREDITS_LIMIT_REACHED=${DIRECTOR_V2_DYNAMIC_SCHEDULER_IGNORE_SERVICES_SHUTDOWN_WHEN_CREDITS_LIMIT_REACHED}
268268
- DIRECTOR_V2_SERVICES_CUSTOM_CONSTRAINTS=${DIRECTOR_V2_SERVICES_CUSTOM_CONSTRAINTS}
269269

270+
- DYNAMIC_SIDECAR_ENDPOINT_SPECS_MODE_DNSRR_ENABLED=${DYNAMIC_SIDECAR_ENDPOINT_SPECS_MODE_DNSRR_ENABLED}
270271
- DYNAMIC_SIDECAR_ENABLE_VOLUME_LIMITS=${DYNAMIC_SIDECAR_ENABLE_VOLUME_LIMITS}
271272
- DYNAMIC_SIDECAR_IMAGE=${DYNAMIC_SIDECAR_IMAGE}
272273
- DYNAMIC_SIDECAR_LOG_LEVEL=${DYNAMIC_SIDECAR_LOG_LEVEL}

0 commit comments

Comments
 (0)