Skip to content

Commit 51703ab

Browse files
committed
remove Json types not needed for settings
1 parent 02f8666 commit 51703ab

File tree

2 files changed

+14
-16
lines changed
  • services
    • autoscaling/src/simcore_service_autoscaling/core
    • clusters-keeper/src/simcore_service_clusters_keeper/core

2 files changed

+14
-16
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
AliasChoices,
1414
AnyUrl,
1515
Field,
16-
Json,
1716
NonNegativeInt,
1817
PositiveInt,
1918
TypeAdapter,
@@ -59,15 +58,15 @@ class AutoscalingEC2Settings(EC2Settings):
5958

6059
class EC2InstancesSettings(BaseCustomSettings):
6160
EC2_INSTANCES_ALLOWED_TYPES: Annotated[
62-
Json[dict[str, EC2InstanceBootSpecific]],
61+
dict[str, EC2InstanceBootSpecific],
6362
Field(
6463
description="Defines which EC2 instances are considered as candidates for new EC2 instance and their respective boot specific parameters"
6564
"NOTE: minimum length >0",
6665
),
6766
]
6867

6968
EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING: Annotated[
70-
Json[list[DockerGenericTag]],
69+
list[DockerGenericTag],
7170
Field(
7271
description="List of docker images to pre-pull on cold started new EC2 instances",
7372
default_factory=list,
@@ -115,7 +114,7 @@ class EC2InstancesSettings(BaseCustomSettings):
115114
] = "autoscaling"
116115

117116
EC2_INSTANCES_SECURITY_GROUP_IDS: Annotated[
118-
Json[list[str]],
117+
list[str],
119118
Field(
120119
min_length=1,
121120
description="A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic"
@@ -124,7 +123,7 @@ class EC2InstancesSettings(BaseCustomSettings):
124123
),
125124
]
126125
EC2_INSTANCES_SUBNET_IDS: Annotated[
127-
Json[list[str]],
126+
list[str],
128127
Field(
129128
min_length=1,
130129
description="A subnet is a range of IP addresses in your VPC "
@@ -158,7 +157,7 @@ class EC2InstancesSettings(BaseCustomSettings):
158157
] = datetime.timedelta(seconds=30)
159158

160159
EC2_INSTANCES_CUSTOM_TAGS: Annotated[
161-
Json[EC2Tags],
160+
EC2Tags,
162161
Field(
163162
description="Allows to define tags that should be added to the created EC2 instance default tags. "
164163
"a tag must have a key and an optional value. see [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html]",

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from pydantic import (
1818
AliasChoices,
1919
Field,
20-
Json,
2120
NonNegativeFloat,
2221
NonNegativeInt,
2322
PositiveInt,
@@ -79,13 +78,13 @@ class ClustersKeeperSSMSettings(SSMSettings):
7978

8079
class WorkersEC2InstancesSettings(BaseCustomSettings):
8180
WORKERS_EC2_INSTANCES_ALLOWED_TYPES: Annotated[
82-
Json[dict[str, EC2InstanceBootSpecific]],
81+
dict[str, EC2InstanceBootSpecific],
8382
Field(
8483
description="Defines which EC2 instances are considered as candidates for new EC2 instance and their respective boot specific parameters",
8584
),
8685
]
8786
WORKERS_EC2_INSTANCES_COLD_START_DOCKER_IMAGES_PRE_PULLING: Annotated[
88-
Json[list[DockerGenericTag]],
87+
list[DockerGenericTag],
8988
Field(
9089
description="List of docker images to pre-pull on cold started new EC2 instances",
9190
default_factory=list,
@@ -119,7 +118,7 @@ class WorkersEC2InstancesSettings(BaseCustomSettings):
119118
] = 10
120119
# NAME PREFIX is not exposed since we override it anyway
121120
WORKERS_EC2_INSTANCES_SECURITY_GROUP_IDS: Annotated[
122-
Json[list[str]],
121+
list[str],
123122
Field(
124123
min_length=1,
125124
description="A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic"
@@ -128,7 +127,7 @@ class WorkersEC2InstancesSettings(BaseCustomSettings):
128127
),
129128
]
130129
WORKERS_EC2_INSTANCES_SUBNET_IDS: Annotated[
131-
Json[list[str]],
130+
list[str],
132131
Field(
133132
min_length=1,
134133
description="A subnet is a range of IP addresses in your VPC "
@@ -154,7 +153,7 @@ class WorkersEC2InstancesSettings(BaseCustomSettings):
154153
] = datetime.timedelta(minutes=3)
155154

156155
WORKERS_EC2_INSTANCES_CUSTOM_TAGS: Annotated[
157-
Json[EC2Tags],
156+
EC2Tags,
158157
Field(
159158
description="Allows to define tags that should be added to the created EC2 instance default tags. "
160159
"a tag must have a key and an optional value. see [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html]",
@@ -174,7 +173,7 @@ def _check_valid_instance_names(
174173

175174
class PrimaryEC2InstancesSettings(BaseCustomSettings):
176175
PRIMARY_EC2_INSTANCES_ALLOWED_TYPES: Annotated[
177-
Json[dict[str, EC2InstanceBootSpecific]],
176+
dict[str, EC2InstanceBootSpecific],
178177
Field(
179178
description="Defines which EC2 instances are considered as candidates for new EC2 instance and their respective boot specific parameters",
180179
),
@@ -186,7 +185,7 @@ class PrimaryEC2InstancesSettings(BaseCustomSettings):
186185
),
187186
] = 10
188187
PRIMARY_EC2_INSTANCES_SECURITY_GROUP_IDS: Annotated[
189-
Json[list[str]],
188+
list[str],
190189
Field(
191190
min_length=1,
192191
description="A security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic"
@@ -195,7 +194,7 @@ class PrimaryEC2InstancesSettings(BaseCustomSettings):
195194
),
196195
]
197196
PRIMARY_EC2_INSTANCES_SUBNET_IDS: Annotated[
198-
Json[list[str]],
197+
list[str],
199198
Field(
200199
min_length=1,
201200
description="A subnet is a range of IP addresses in your VPC "
@@ -214,7 +213,7 @@ class PrimaryEC2InstancesSettings(BaseCustomSettings):
214213
),
215214
]
216215
PRIMARY_EC2_INSTANCES_CUSTOM_TAGS: Annotated[
217-
Json[EC2Tags],
216+
EC2Tags,
218217
Field(
219218
description="Allows to define tags that should be added to the created EC2 instance default tags. "
220219
"a tag must have a key and an optional value. see [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html]",

0 commit comments

Comments
 (0)