From af0e7815683105f32c6dce427bcc285f15a66ab9 Mon Sep 17 00:00:00 2001 From: ksgamora Date: Fri, 1 Nov 2024 21:31:30 +0300 Subject: [PATCH 1/2] NBS-5217: Allow images from different folders in tests --- .../pylibs/clusters/test_config/test_config.py | 1 + cloud/blockstore/pylibs/ycp/ycp.py | 10 ++++++---- cloud/blockstore/pylibs/ycp/ycp_wrapper.py | 4 ++++ .../tests/test-configs/cluster1.json | 3 +++ .../tools/ci/corruption_test_suite/lib/main.py | 1 + .../tests/test-configs/cluster1.json | 3 +++ .../tests/test-configs/cluster1.json | 3 +++ .../ci/migration_test/tests/test-configs/cluster1.json | 3 +++ .../relocation_test/tests/test-configs/cluster1.json | 3 +++ .../testing/eternal_tests/test_runner/lib/main.py | 2 ++ .../eternal_tests/test_runner/lib/test_configs.py | 3 +++ .../test_runner/tests/test-configs/cluster1.json | 3 +++ .../test_runner/lib/ut/test-configs/testing.json | 4 ++++ cloud/filestore/tests/build_arcadia_test/common.py | 2 ++ .../tests/xfs_suite/tests/test-configs/cluster1.json | 3 +++ 15 files changed, 44 insertions(+), 4 deletions(-) diff --git a/cloud/blockstore/pylibs/clusters/test_config/test_config.py b/cloud/blockstore/pylibs/clusters/test_config/test_config.py index d6e0d3b70cb..5d11e8aa0f5 100644 --- a/cloud/blockstore/pylibs/clusters/test_config/test_config.py +++ b/cloud/blockstore/pylibs/clusters/test_config/test_config.py @@ -15,6 +15,7 @@ class FolderDesc: subnet_name: str subnet_id: str image_name: str + image_folder_id: str filesystem_id: str platform_id: str = None service_account_id: str = None diff --git a/cloud/blockstore/pylibs/ycp/ycp.py b/cloud/blockstore/pylibs/ycp/ycp.py index e3dd3581954..f630b762c04 100644 --- a/cloud/blockstore/pylibs/ycp/ycp.py +++ b/cloud/blockstore/pylibs/ycp/ycp.py @@ -143,6 +143,7 @@ class CreateInstanceConfig: memory: int folder_id: str image_name: str + image_folder_id: str zone_id: str subnet_name: str subnet_id: str @@ -167,6 +168,7 @@ class CreateDiskConfig: placement_group_partition_count: int zone_id: str image_name: str + image_folder_id: str snapshot_name: str description: str kek_id: str @@ -315,9 +317,9 @@ def _resolve_entity_name(self, cmd, name, stderr, fail_if_not_found=True): return None - def _resolve_image_name(self, folder_id, image_name, stderr): + def _resolve_image_name(self, image_folder_id, image_name, stderr): return self._resolve_entity_name( - self._ycp.compute.image.list(folder_id=folder_id), + self._ycp.compute.image.list(folder_id=image_folder_id), image_name, stderr) @@ -377,7 +379,7 @@ def create_instance(self, config: CreateInstanceConfig) -> Instance: placement_group_id = entity['id'] image_id = self._resolve_image_name( - config.folder_id, + config.image_folder_id, config.image_name, stderr) @@ -440,7 +442,7 @@ def create_disk(self, config: CreateDiskConfig) -> Disk: snapshot_id = None if config.image_name is not None: image_id = self._resolve_image_name( - config.folder_id, + config.image_folder_id, config.image_name, stderr) elif config.snapshot_name is not None: diff --git a/cloud/blockstore/pylibs/ycp/ycp_wrapper.py b/cloud/blockstore/pylibs/ycp/ycp_wrapper.py index 9bb64aea296..2ae2ab26beb 100644 --- a/cloud/blockstore/pylibs/ycp/ycp_wrapper.py +++ b/cloud/blockstore/pylibs/ycp/ycp_wrapper.py @@ -57,6 +57,7 @@ def create_instance(self, placement_group_name: str = None, host_group: str = None, image_name: str = None, + image_folder_id: str = None, name: str = None, platform_id: str = None, auto_delete: bool = True, @@ -69,6 +70,7 @@ def create_instance(self, cores=cores, memory=memory * 1024 ** 3, image_name=image_name or self._folder_desc.image_name, + image_folder_id=image_folder_id or self._folder_desc.folder_id, zone_id=self._folder_desc.zone_id, subnet_name=self._folder_desc.subnet_name, subnet_id=self._folder_desc.subnet_id, @@ -113,6 +115,7 @@ def create_disk(self, name: str = None, kek_id: str = None, image_name: str = None, + image_folder_id: str = None, snapshot_name: str = None, auto_delete: bool = True, description: str = None) -> Ycp.Disk: @@ -129,6 +132,7 @@ def create_disk(self, folder_id=self._folder_desc.folder_id, kek_id=kek_id, image_name=image_name, + image_folder_id=image_folder_id or self._folder_desc.folder_id, snapshot_name=snapshot_name, description=description, ) diff --git a/cloud/blockstore/tools/ci/check_emptiness_test/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/check_emptiness_test/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/check_emptiness_test/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/check_emptiness_test/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/ci/corruption_test_suite/lib/main.py b/cloud/blockstore/tools/ci/corruption_test_suite/lib/main.py index d49f0b4bc75..7ae2007b654 100644 --- a/cloud/blockstore/tools/ci/corruption_test_suite/lib/main.py +++ b/cloud/blockstore/tools/ci/corruption_test_suite/lib/main.py @@ -191,6 +191,7 @@ def run_corruption_test(module_factories: common.ModuleFactories, args, logger): memory=_TEST_INSTANCE_MEMORY, compute_node=args.compute_node, image_name=image, + image_folder_id=folder.image_folder_id, description="Corruption test") as instance: server_version = module_factories.fetch_server_version( diff --git a/cloud/blockstore/tools/ci/corruption_test_suite/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/corruption_test_suite/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/corruption_test_suite/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/corruption_test_suite/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/ci/fio_performance_test_suite/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/fio_performance_test_suite/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/fio_performance_test_suite/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/fio_performance_test_suite/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/ci/migration_test/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/migration_test/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/migration_test/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/migration_test/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/ci/relocation_test/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/relocation_test/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/relocation_test/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/relocation_test/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/main.py b/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/main.py index d4d09c2ba12..4efb15de3db 100644 --- a/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/main.py +++ b/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/main.py @@ -335,6 +335,7 @@ def create_disk(self, instance: Ycp.Instance, config: DiskCreateConfig, disk_ind placement_group_name=placement_group_name, placement_group_partition_count=config.placement_group_partition_count, image_name=config.image_name, + image_folder_id=config.image_folder_id, auto_delete=False, description=f"Eternal test: {self.args.test_case}") as disk: @@ -414,6 +415,7 @@ def create_and_configure_vm(self, vm_idx=None, skip_fs_create=False) -> Ycp.Inst cores=8, memory=8, image_name=self.test_config.ycp_config.image_name, + image_folder_id=self.test_config.ycp_config.folder.image_folder_id, platform_id=self.test_config.ycp_config.folder.platform_id, compute_node=self.args.compute_node, placement_group_name=placement_group_name, diff --git a/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/test_configs.py b/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/test_configs.py index 0409634c500..2d56fb8cd1e 100644 --- a/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/test_configs.py +++ b/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/test_configs.py @@ -30,6 +30,7 @@ class DiskCreateConfig(ITestCreateConfig): encrypted: bool placement_group_name: str image_name: str + image_folder_id: str initial_size: int block_count: int @@ -43,6 +44,7 @@ def __init__( placement_group_name=None, placement_group_partition_count=None, image_name=None, + image_folder_id=None, initial_size=None, block_count=None, preferred_platform_id=None): @@ -59,6 +61,7 @@ def __init__( self.placement_group_name = placement_group_name self.placement_group_partition_count = placement_group_partition_count self.image_name = image_name + self.image_folder_id = image_folder_id self.initial_size = initial_size or size self.preferred_platform_id = preferred_platform_id diff --git a/cloud/blockstore/tools/testing/eternal_tests/test_runner/tests/test-configs/cluster1.json b/cloud/blockstore/tools/testing/eternal_tests/test_runner/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/testing/eternal_tests/test_runner/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/testing/eternal_tests/test_runner/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/disk_manager/test/acceptance/test_runner/lib/ut/test-configs/testing.json b/cloud/disk_manager/test/acceptance/test_runner/lib/ut/test-configs/testing.json index 3eab9c0afd3..46574c4be00 100644 --- a/cloud/disk_manager/test/acceptance/test_runner/lib/ut/test-configs/testing.json +++ b/cloud/disk_manager/test/acceptance/test_runner/lib/ut/test-configs/testing.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -48,3 +51,4 @@ "name": "fake-cluster1", "solomon_cluster": "fake-cluster1" } + diff --git a/cloud/filestore/tests/build_arcadia_test/common.py b/cloud/filestore/tests/build_arcadia_test/common.py index 032efc5c924..abc304c4ab3 100644 --- a/cloud/filestore/tests/build_arcadia_test/common.py +++ b/cloud/filestore/tests/build_arcadia_test/common.py @@ -104,6 +104,7 @@ def create_instance( memory: int, compute_node: str, image_name: str, + image_folder_id: str, platform_ids: list[str], description: str, logger @@ -119,6 +120,7 @@ def create_instance( memory=memory, compute_node=compute_node, image_name=image_name, + image_folder_id=image_folder_id, platform_id=platform_id, description=description) as instance: created = True diff --git a/cloud/filestore/tests/xfs_suite/tests/test-configs/cluster1.json b/cloud/filestore/tests/xfs_suite/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/filestore/tests/xfs_suite/tests/test-configs/cluster1.json +++ b/cloud/filestore/tests/xfs_suite/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, From 109915674c4efcc7b141ea0118581e6f0431a4ff Mon Sep 17 00:00:00 2001 From: ksgamora Date: Fri, 1 Nov 2024 21:31:30 +0300 Subject: [PATCH 2/2] NBS-5217: Allow images from different folders in tests --- .../clusters/test_config/test_config.py | 1 + cloud/blockstore/pylibs/ycp/ycp.py | 10 +++++--- cloud/blockstore/pylibs/ycp/ycp_wrapper.py | 4 +++ .../tests/test-configs/cluster1.json | 3 +++ .../ci/corruption_test_suite/lib/main.py | 1 + .../tests/test-configs/cluster1.json | 3 +++ .../ci/fio_performance_test_suite/lib/main.py | 25 +++++++++++++------ .../tests/test-configs/cluster1.json | 3 +++ .../tests/test-configs/cluster1.json | 3 +++ .../tests/test-configs/cluster1.json | 3 +++ .../eternal_tests/test_runner/lib/main.py | 2 ++ .../test_runner/lib/test_configs.py | 3 +++ .../tests/test-configs/cluster1.json | 3 +++ .../lib/ut/test-configs/testing.json | 4 +++ .../tests/build_arcadia_test/common.py | 2 ++ .../tests/build_arcadia_test/entrypoint.py | 13 +++++++++- cloud/filestore/tests/xfs_suite/lib/main.py | 8 +++++- .../tests/test-configs/cluster1.json | 3 +++ 18 files changed, 81 insertions(+), 13 deletions(-) diff --git a/cloud/blockstore/pylibs/clusters/test_config/test_config.py b/cloud/blockstore/pylibs/clusters/test_config/test_config.py index d6e0d3b70cb..5d11e8aa0f5 100644 --- a/cloud/blockstore/pylibs/clusters/test_config/test_config.py +++ b/cloud/blockstore/pylibs/clusters/test_config/test_config.py @@ -15,6 +15,7 @@ class FolderDesc: subnet_name: str subnet_id: str image_name: str + image_folder_id: str filesystem_id: str platform_id: str = None service_account_id: str = None diff --git a/cloud/blockstore/pylibs/ycp/ycp.py b/cloud/blockstore/pylibs/ycp/ycp.py index e3dd3581954..f630b762c04 100644 --- a/cloud/blockstore/pylibs/ycp/ycp.py +++ b/cloud/blockstore/pylibs/ycp/ycp.py @@ -143,6 +143,7 @@ class CreateInstanceConfig: memory: int folder_id: str image_name: str + image_folder_id: str zone_id: str subnet_name: str subnet_id: str @@ -167,6 +168,7 @@ class CreateDiskConfig: placement_group_partition_count: int zone_id: str image_name: str + image_folder_id: str snapshot_name: str description: str kek_id: str @@ -315,9 +317,9 @@ def _resolve_entity_name(self, cmd, name, stderr, fail_if_not_found=True): return None - def _resolve_image_name(self, folder_id, image_name, stderr): + def _resolve_image_name(self, image_folder_id, image_name, stderr): return self._resolve_entity_name( - self._ycp.compute.image.list(folder_id=folder_id), + self._ycp.compute.image.list(folder_id=image_folder_id), image_name, stderr) @@ -377,7 +379,7 @@ def create_instance(self, config: CreateInstanceConfig) -> Instance: placement_group_id = entity['id'] image_id = self._resolve_image_name( - config.folder_id, + config.image_folder_id, config.image_name, stderr) @@ -440,7 +442,7 @@ def create_disk(self, config: CreateDiskConfig) -> Disk: snapshot_id = None if config.image_name is not None: image_id = self._resolve_image_name( - config.folder_id, + config.image_folder_id, config.image_name, stderr) elif config.snapshot_name is not None: diff --git a/cloud/blockstore/pylibs/ycp/ycp_wrapper.py b/cloud/blockstore/pylibs/ycp/ycp_wrapper.py index 9bb64aea296..2ae2ab26beb 100644 --- a/cloud/blockstore/pylibs/ycp/ycp_wrapper.py +++ b/cloud/blockstore/pylibs/ycp/ycp_wrapper.py @@ -57,6 +57,7 @@ def create_instance(self, placement_group_name: str = None, host_group: str = None, image_name: str = None, + image_folder_id: str = None, name: str = None, platform_id: str = None, auto_delete: bool = True, @@ -69,6 +70,7 @@ def create_instance(self, cores=cores, memory=memory * 1024 ** 3, image_name=image_name or self._folder_desc.image_name, + image_folder_id=image_folder_id or self._folder_desc.folder_id, zone_id=self._folder_desc.zone_id, subnet_name=self._folder_desc.subnet_name, subnet_id=self._folder_desc.subnet_id, @@ -113,6 +115,7 @@ def create_disk(self, name: str = None, kek_id: str = None, image_name: str = None, + image_folder_id: str = None, snapshot_name: str = None, auto_delete: bool = True, description: str = None) -> Ycp.Disk: @@ -129,6 +132,7 @@ def create_disk(self, folder_id=self._folder_desc.folder_id, kek_id=kek_id, image_name=image_name, + image_folder_id=image_folder_id or self._folder_desc.folder_id, snapshot_name=snapshot_name, description=description, ) diff --git a/cloud/blockstore/tools/ci/check_emptiness_test/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/check_emptiness_test/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/check_emptiness_test/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/check_emptiness_test/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/ci/corruption_test_suite/lib/main.py b/cloud/blockstore/tools/ci/corruption_test_suite/lib/main.py index d49f0b4bc75..7ae2007b654 100644 --- a/cloud/blockstore/tools/ci/corruption_test_suite/lib/main.py +++ b/cloud/blockstore/tools/ci/corruption_test_suite/lib/main.py @@ -191,6 +191,7 @@ def run_corruption_test(module_factories: common.ModuleFactories, args, logger): memory=_TEST_INSTANCE_MEMORY, compute_node=args.compute_node, image_name=image, + image_folder_id=folder.image_folder_id, description="Corruption test") as instance: server_version = module_factories.fetch_server_version( diff --git a/cloud/blockstore/tools/ci/corruption_test_suite/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/corruption_test_suite/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/corruption_test_suite/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/corruption_test_suite/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/ci/fio_performance_test_suite/lib/main.py b/cloud/blockstore/tools/ci/fio_performance_test_suite/lib/main.py index 856828bd6e6..f240db4af0d 100644 --- a/cloud/blockstore/tools/ci/fio_performance_test_suite/lib/main.py +++ b/cloud/blockstore/tools/ci/fio_performance_test_suite/lib/main.py @@ -99,6 +99,11 @@ def parse_args() -> argparse.Namespace: type=str, default=None, help='use image with the specified name to create disks') + test_arguments_group.add_argument( + '--image-folder-id', + type=str, + default=None, + help='use image from the specified folder to create disks') test_arguments_group.add_argument( '--instance-cores', type=int, @@ -142,8 +147,8 @@ def __init__( self._logger = logger self._module_factories = module_factories - self._version_method_name = None - self._instance_image_name = None + def _version_method_name() -> str: + raise NotImplementedError() def _run_tests( self, @@ -193,11 +198,12 @@ def run_test_suite(self) -> None: platform_id=self._args.platform_id, compute_node=self._args.compute_node, placement_group_name=self._args.placement_group_name, - image_name=self._instance_image_name, + image_name=self._args.image_name, + image_folder_id=self._args.image_folder_id, description='fio performance test') as instance: version = self._module_factories.fetch_server_version( self._args.dry_run, - self._version_method_name, + self._version_method_name(), instance.compute_node, cluster, self._logger) @@ -335,7 +341,9 @@ def __init__( logger: logging.Logger, ) -> None: super().__init__(module_factories, args, profiler, logger) - self._version_method_name = 'get_current_nbs_version' + + def _version_method_name() -> str: + return 'get_current_nbs_version' def _teardown_parallel_run( self, @@ -425,6 +433,7 @@ def _run_sequential_tests( type_id=translate_disk_type(self._args.cluster, test_case.type), bs=test_case.device_bs, image_name=self._args.image_name, + image_folder_id=self._args.image_folder_id, description=f'fio performance test: {test_case.name}') as disk: try: with ycp.attach_disk( @@ -473,6 +482,7 @@ def _run_parallel_tests( type_id=translate_disk_type(self._args.cluster, test_case.type), bs=test_case.device_bs, image_name=self._args.image_name, + image_folder_id=self._args.image_folder_id, auto_delete=False, description=f'fio performance test: {test_case.name}') as disk: with ycp.attach_disk( @@ -557,8 +567,9 @@ def __init__( logger: logging.Logger, ) -> None: super().__init__(module_factories, args, profiler, logger) - self._version_method_name = 'get_current_nfs_version' - self._instance_image_name = 'ubuntu-2004-eternal' + + def _version_method_name() -> str: + return 'get_current_nfs_version' def _mount_fs( self, diff --git a/cloud/blockstore/tools/ci/fio_performance_test_suite/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/fio_performance_test_suite/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/fio_performance_test_suite/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/fio_performance_test_suite/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/ci/migration_test/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/migration_test/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/migration_test/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/migration_test/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/ci/relocation_test/tests/test-configs/cluster1.json b/cloud/blockstore/tools/ci/relocation_test/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/ci/relocation_test/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/ci/relocation_test/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/main.py b/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/main.py index d4d09c2ba12..4efb15de3db 100644 --- a/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/main.py +++ b/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/main.py @@ -335,6 +335,7 @@ def create_disk(self, instance: Ycp.Instance, config: DiskCreateConfig, disk_ind placement_group_name=placement_group_name, placement_group_partition_count=config.placement_group_partition_count, image_name=config.image_name, + image_folder_id=config.image_folder_id, auto_delete=False, description=f"Eternal test: {self.args.test_case}") as disk: @@ -414,6 +415,7 @@ def create_and_configure_vm(self, vm_idx=None, skip_fs_create=False) -> Ycp.Inst cores=8, memory=8, image_name=self.test_config.ycp_config.image_name, + image_folder_id=self.test_config.ycp_config.folder.image_folder_id, platform_id=self.test_config.ycp_config.folder.platform_id, compute_node=self.args.compute_node, placement_group_name=placement_group_name, diff --git a/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/test_configs.py b/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/test_configs.py index 0409634c500..2d56fb8cd1e 100644 --- a/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/test_configs.py +++ b/cloud/blockstore/tools/testing/eternal_tests/test_runner/lib/test_configs.py @@ -30,6 +30,7 @@ class DiskCreateConfig(ITestCreateConfig): encrypted: bool placement_group_name: str image_name: str + image_folder_id: str initial_size: int block_count: int @@ -43,6 +44,7 @@ def __init__( placement_group_name=None, placement_group_partition_count=None, image_name=None, + image_folder_id=None, initial_size=None, block_count=None, preferred_platform_id=None): @@ -59,6 +61,7 @@ def __init__( self.placement_group_name = placement_group_name self.placement_group_partition_count = placement_group_partition_count self.image_name = image_name + self.image_folder_id = image_folder_id self.initial_size = initial_size or size self.preferred_platform_id = preferred_platform_id diff --git a/cloud/blockstore/tools/testing/eternal_tests/test_runner/tests/test-configs/cluster1.json b/cloud/blockstore/tools/testing/eternal_tests/test_runner/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/blockstore/tools/testing/eternal_tests/test_runner/tests/test-configs/cluster1.json +++ b/cloud/blockstore/tools/testing/eternal_tests/test_runner/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, diff --git a/cloud/disk_manager/test/acceptance/test_runner/lib/ut/test-configs/testing.json b/cloud/disk_manager/test/acceptance/test_runner/lib/ut/test-configs/testing.json index 3eab9c0afd3..46574c4be00 100644 --- a/cloud/disk_manager/test/acceptance/test_runner/lib/ut/test-configs/testing.json +++ b/cloud/disk_manager/test/acceptance/test_runner/lib/ut/test-configs/testing.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -48,3 +51,4 @@ "name": "fake-cluster1", "solomon_cluster": "fake-cluster1" } + diff --git a/cloud/filestore/tests/build_arcadia_test/common.py b/cloud/filestore/tests/build_arcadia_test/common.py index 032efc5c924..abc304c4ab3 100644 --- a/cloud/filestore/tests/build_arcadia_test/common.py +++ b/cloud/filestore/tests/build_arcadia_test/common.py @@ -104,6 +104,7 @@ def create_instance( memory: int, compute_node: str, image_name: str, + image_folder_id: str, platform_ids: list[str], description: str, logger @@ -119,6 +120,7 @@ def create_instance( memory=memory, compute_node=compute_node, image_name=image_name, + image_folder_id=image_folder_id, platform_id=platform_id, description=description) as instance: created = True diff --git a/cloud/filestore/tests/build_arcadia_test/entrypoint.py b/cloud/filestore/tests/build_arcadia_test/entrypoint.py index 4a40f7b90f4..a68b8c7c1f7 100644 --- a/cloud/filestore/tests/build_arcadia_test/entrypoint.py +++ b/cloud/filestore/tests/build_arcadia_test/entrypoint.py @@ -36,6 +36,16 @@ def _parse_args(): type=str, default=None, help='run test at the specified compute node') + test_arguments_group.add_argument( + '--image-name', + type=str, + default=_IMAGE_NAME, + help='use image with the specified name to create disks') + test_arguments_group.add_argument( + '--image-folder-id', + type=str, + default=None, + help='use image from the specified folder to create disks') test_arguments_group.add_argument( '--test-case', type=str, @@ -91,7 +101,8 @@ def _run_build_test(parser, args, logger, modes: tp.Dict[tp.Callable[..., tp.Any _TEST_INSTANCE_CORES, _TEST_INSTANCE_MEMORY, args.compute_node, - _IMAGE_NAME, + args.image_name, + args.image_folder_id, args.platform_ids, None if args.dry_run else f'build arcadia test at {datetime.now()}', logger) as instance: diff --git a/cloud/filestore/tests/xfs_suite/lib/main.py b/cloud/filestore/tests/xfs_suite/lib/main.py index 42c52eefac3..bd75da807a3 100644 --- a/cloud/filestore/tests/xfs_suite/lib/main.py +++ b/cloud/filestore/tests/xfs_suite/lib/main.py @@ -75,6 +75,11 @@ def parse_args(): '--image-name', type=str, default=_DEFAULT_IMAGE_NAME) + test_arguments_group.add_argument( + '--image-folder-id', + type=str, + default=None, + help='use image from the specified folder to create disks') test_arguments_group.add_argument( '--cores', type=int, @@ -215,7 +220,8 @@ def run(module_factories, parser, args, logger): cores=args.cores, memory=args.memory, compute_node=args.compute_node, - image_name=args.image_name) as instance: + image_name=args.image_name, + image_folder_id=args.image_folder_id) as instance: logger.info( f'Waiting until instance becomes available via ssh') helpers.wait_until_instance_becomes_available_via_ssh(instance.ip) diff --git a/cloud/filestore/tests/xfs_suite/tests/test-configs/cluster1.json b/cloud/filestore/tests/xfs_suite/tests/test-configs/cluster1.json index 2a3c73ec807..46574c4be00 100644 --- a/cloud/filestore/tests/xfs_suite/tests/test-configs/cluster1.json +++ b/cloud/filestore/tests/xfs_suite/tests/test-configs/cluster1.json @@ -8,6 +8,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name1", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -20,6 +21,7 @@ "folder_id": "fake-folder", "hot_attach_fs": true, "image_name": "fake-name2", + "image_folder_id": "fake-images-folder", "platform_id": null, "service_account_id": null, "subnet_id": null, @@ -32,6 +34,7 @@ "folder_id": "nbs.tests.folder", "hot_attach_fs": true, "image_name": "fake-name3", + "image_folder_id": null, "platform_id": null, "service_account_id": null, "subnet_id": null,