Skip to content

Commit a215b0d

Browse files
committed
added EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING
1 parent e04c848 commit a215b0d

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
from typing import Annotated, Final, Self, cast
44

55
from aws_library.ec2 import EC2InstanceBootSpecific, EC2Tags
6+
from common_library.basic_types import DEFAULT_FACTORY
67
from common_library.logging.logging_utils_filtering import LoggerName, MessageSubstring
78
from fastapi import FastAPI
89
from models_library.basic_types import LogLevel, PortInt, VersionTag
910
from models_library.clusters import ClusterAuthentication
10-
from models_library.docker import DockerLabelKey
11+
from models_library.docker import DockerGenericTag, DockerLabelKey
1112
from pydantic import (
1213
AliasChoices,
1314
AnyUrl,
@@ -63,6 +64,14 @@ class EC2InstancesSettings(BaseCustomSettings):
6364
),
6465
]
6566

67+
EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING: Annotated[
68+
list[DockerGenericTag],
69+
Field(
70+
description="List of docker images to pre-pull on cold started new EC2 instances",
71+
default_factory=list,
72+
),
73+
] = DEFAULT_FACTORY
74+
6675
EC2_INSTANCES_KEY_NAME: Annotated[
6776
str,
6877
Field(

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
VersionTag,
1414
)
1515
from models_library.clusters import ClusterAuthentication
16+
from models_library.docker import DockerGenericTag
1617
from pydantic import (
1718
AliasChoices,
1819
Field,
@@ -82,6 +83,13 @@ class WorkersEC2InstancesSettings(BaseCustomSettings):
8283
description="Defines which EC2 instances are considered as candidates for new EC2 instance and their respective boot specific parameters",
8384
),
8485
]
86+
WORKERS_EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING: Annotated[
87+
list[DockerGenericTag],
88+
Field(
89+
description="List of docker images to pre-pull on cold started new EC2 instances",
90+
default_factory=list,
91+
),
92+
] = DEFAULT_FACTORY
8593

8694
WORKERS_EC2_INSTANCES_KEY_NAME: Annotated[
8795
str,
@@ -170,7 +178,6 @@ class PrimaryEC2InstancesSettings(BaseCustomSettings):
170178
description="Defines which EC2 instances are considered as candidates for new EC2 instance and their respective boot specific parameters",
171179
),
172180
]
173-
174181
PRIMARY_EC2_INSTANCES_MAX_INSTANCES: Annotated[
175182
int,
176183
Field(

services/clusters-keeper/src/simcore_service_clusters_keeper/data/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ services:
104104
DASK_MONITORING_URL: tls://dask-scheduler:8786
105105
DASK_SCHEDULER_AUTH: '{"type":"tls","tls_ca_file":"${DASK_TLS_CA_FILE}","tls_client_cert":"${DASK_TLS_CERT}","tls_client_key":"${DASK_TLS_KEY}"}'
106106
EC2_INSTANCES_ALLOWED_TYPES: ${WORKERS_EC2_INSTANCES_ALLOWED_TYPES}
107+
EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING: ${WORKERS_EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING}
107108
EC2_INSTANCES_CUSTOM_TAGS: ${WORKERS_EC2_INSTANCES_CUSTOM_TAGS}
108109
EC2_INSTANCES_ATTACHED_IAM_PROFILE: ""
109110
EC2_INSTANCES_KEY_NAME: ${WORKERS_EC2_INSTANCES_KEY_NAME}

services/clusters-keeper/src/simcore_service_clusters_keeper/utils/clusters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def _convert_to_env_dict(entries: dict[str, Any]) -> str:
9999
f"EC2_INSTANCES_NAME_PREFIX={cluster_machines_name_prefix}",
100100
f"LOG_LEVEL={app_settings.log_level}",
101101
f"WORKERS_EC2_INSTANCES_ALLOWED_TYPES={_convert_to_env_dict(app_settings.CLUSTERS_KEEPER_WORKERS_EC2_INSTANCES.WORKERS_EC2_INSTANCES_ALLOWED_TYPES)}",
102+
f"WORKERS_EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING={_convert_to_env_list(app_settings.CLUSTERS_KEEPER_WORKERS_EC2_INSTANCES.WORKERS_EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING)}",
102103
f"WORKERS_EC2_INSTANCES_CUSTOM_TAGS={_convert_to_env_dict(app_settings.CLUSTERS_KEEPER_WORKERS_EC2_INSTANCES.WORKERS_EC2_INSTANCES_CUSTOM_TAGS | additional_custom_tags)}",
103104
f"WORKERS_EC2_INSTANCES_KEY_NAME={app_settings.CLUSTERS_KEEPER_WORKERS_EC2_INSTANCES.WORKERS_EC2_INSTANCES_KEY_NAME}",
104105
f"WORKERS_EC2_INSTANCES_MAX_INSTANCES={app_settings.CLUSTERS_KEEPER_WORKERS_EC2_INSTANCES.WORKERS_EC2_INSTANCES_MAX_INSTANCES}",

services/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ services:
131131

132132
AUTOSCALING_EC2_INSTANCES: ${AUTOSCALING_EC2_INSTANCES} # used to enable/disable
133133
EC2_INSTANCES_ALLOWED_TYPES: ${EC2_INSTANCES_ALLOWED_TYPES}
134+
EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING: ${EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING}
134135
EC2_INSTANCES_MACHINES_BUFFER: ${EC2_INSTANCES_MACHINES_BUFFER}
135136
EC2_INSTANCES_MAX_INSTANCES: ${EC2_INSTANCES_MAX_INSTANCES}
136137
EC2_INSTANCES_MAX_START_TIME: ${EC2_INSTANCES_MAX_START_TIME}

0 commit comments

Comments
 (0)