[#171] Components versions check

Components versions check

Signed-off-by: Mikhail Kadilov m.kadilov@yadro.com
This commit is contained in:
Mikhail Kadilov 2024-01-31 15:43:24 +03:00
parent 0d7a15877c
commit 4aeb82bfae
3 changed files with 9 additions and 17 deletions

View file

@ -51,11 +51,11 @@ basic = "frostfs_testlib.healthcheck.basic_healthcheck:BasicHealthcheck"
config = "frostfs_testlib.storage.controllers.state_managers.config_state_manager:ConfigStateManager" config = "frostfs_testlib.storage.controllers.state_managers.config_state_manager:ConfigStateManager"
[project.entry-points."frostfs.testlib.services"] [project.entry-points."frostfs.testlib.services"]
s = "frostfs_testlib.storage.dataclasses.frostfs_services:StorageNode" frostfs-storage = "frostfs_testlib.storage.dataclasses.frostfs_services:StorageNode"
s3-gate = "frostfs_testlib.storage.dataclasses.frostfs_services:S3Gate" frostfs-s3 = "frostfs_testlib.storage.dataclasses.frostfs_services:S3Gate"
http-gate = "frostfs_testlib.storage.dataclasses.frostfs_services:HTTPGate" frostfs-http = "frostfs_testlib.storage.dataclasses.frostfs_services:HTTPGate"
morph-chain = "frostfs_testlib.storage.dataclasses.frostfs_services:MorphChain" neo-go = "frostfs_testlib.storage.dataclasses.frostfs_services:MorphChain"
ir = "frostfs_testlib.storage.dataclasses.frostfs_services:InnerRing" frostfs-ir = "frostfs_testlib.storage.dataclasses.frostfs_services:InnerRing"
[tool.isort] [tool.isort]
profile = "black" profile = "black"

View file

@ -105,7 +105,7 @@ class ClusterNode:
service_entry = self.class_registry.get_entry(service_type) service_entry = self.class_registry.get_entry(service_type)
service_name = service_entry["hosting_service_name"] service_name = service_entry["hosting_service_name"]
pattern = f"{service_name}{self.id:02}" pattern = f"{service_name}_{self.id:02}"
config = self.host.get_service_config(pattern) config = self.host.get_service_config(pattern)
return service_type( return service_type(
@ -120,7 +120,7 @@ class ClusterNode:
svcs_names_on_node = [svc.name for svc in self.host.config.services] svcs_names_on_node = [svc.name for svc in self.host.config.services]
for entry in self.class_registry._class_mapping.values(): for entry in self.class_registry._class_mapping.values():
hosting_svc_name = entry["hosting_service_name"] hosting_svc_name = entry["hosting_service_name"]
pattern = f"{hosting_svc_name}{self.id:02}" pattern = f"{hosting_svc_name}_{self.id:02}"
if pattern in svcs_names_on_node: if pattern in svcs_names_on_node:
config = self.host.get_service_config(pattern) config = self.host.get_service_config(pattern)
svcs.append( svcs.append(
@ -267,13 +267,13 @@ class Cluster:
service_name = service["hosting_service_name"] service_name = service["hosting_service_name"]
cls: type[NodeBase] = service["cls"] cls: type[NodeBase] = service["cls"]
pattern = f"{service_name}\d*$" pattern = f"{service_name}_\d*$"
configs = self.hosting.find_service_configs(pattern) configs = self.hosting.find_service_configs(pattern)
found_nodes = [] found_nodes = []
for config in configs: for config in configs:
# config.name is something like s3-gate01. Cut last digits to know service type # config.name is something like s3-gate01. Cut last digits to know service type
service_type = re.findall(".*\D", config.name)[0] service_type = re.findall("(.*)_\d+", config.name)[0]
# exclude unsupported services # exclude unsupported services
if service_type != service_name: if service_type != service_name:
continue continue

View file

@ -18,11 +18,3 @@ class ConfigAttributes:
UN_LOCODE = "un_locode" UN_LOCODE = "un_locode"
HTTP_HOSTNAME = "http_hostname" HTTP_HOSTNAME = "http_hostname"
S3_HOSTNAME = "s3_hostname" S3_HOSTNAME = "s3_hostname"
class _FrostfsServicesNames:
STORAGE = "s"
S3_GATE = "s3-gate"
HTTP_GATE = "http-gate"
MORPH_CHAIN = "morph-chain"
INNER_RING = "ir"