@@ -488,7 +488,7 @@ def get_normalized_config(self):
488
488
if self .__cluster_details .s3_proxy_resolver_config is not None :
489
489
normalized_config ["s3_proxy_resolver_config" ] = self .__cluster_details .s3_proxy_resolver_config
490
490
491
- if self .__cluster_details .blob_storage_config is not None :
491
+ if not utils . need_generate_bs_config ( self .__cluster_details .blob_storage_config ) :
492
492
normalized_config ["blob_storage_config" ] = self .__cluster_details .blob_storage_config
493
493
else :
494
494
blobstorage_config_service_set = normalized_config ["blob_storage_config" ]["service_set" ]
@@ -807,18 +807,25 @@ def __system_tablets(self):
807
807
def __generate_boot_txt (self ):
808
808
self .__proto_configs ["boot.txt" ] = bootstrap_pb2 .TBootstrap ()
809
809
810
+ # New style `config.yaml`, allow specifying bootstrap_config
811
+ if self .__cluster_details .bootstrap_config is not None :
812
+ template_proto = bootstrap_pb2 .TBootstrap ()
813
+ utils .wrap_parse_dict (self .__cluster_details .bootstrap_config , template_proto )
814
+ self .__proto_configs ["boot.txt" ].MergeFrom (template_proto )
815
+ else :
816
+ # Old style `template.yaml`, just get random fields from top-level of `template.yaml`
817
+ if self .__cluster_details .shared_cache_memory_limit is not None :
818
+ boot_txt = self .__proto_configs ["boot.txt" ]
819
+ boot_txt .SharedCacheConfig .MemoryLimit = self .__cluster_details .shared_cache_memory_limit
820
+ shared_cache_size = self .__cluster_details .pq_shared_cache_size
821
+ if shared_cache_size is not None :
822
+ boot_txt = self .__proto_configs ["boot.txt" ]
823
+ boot_txt .NodeLimits .PersQueueNodeConfig .SharedCacheSizeMb = shared_cache_size
824
+
810
825
for tablet_type , tablet_count in self .__system_tablets :
811
826
for index in range (int (tablet_count )):
812
827
self .__add_tablet (tablet_type , index , self .__cluster_details .system_tablets_node_ids )
813
828
814
- if self .__cluster_details .shared_cache_memory_limit is not None :
815
- boot_txt = self .__proto_configs ["boot.txt" ]
816
- boot_txt .SharedCacheConfig .MemoryLimit = self .__cluster_details .shared_cache_memory_limit
817
- shared_cache_size = self .__cluster_details .pq_shared_cache_size
818
- if shared_cache_size is not None :
819
- boot_txt = self .__proto_configs ["boot.txt" ]
820
- boot_txt .NodeLimits .PersQueueNodeConfig .SharedCacheSizeMb = shared_cache_size
821
-
822
829
def __generate_bs_txt (self ):
823
830
self .__proto_configs ["bs.txt" ] = config_pb2 .TBlobStorageConfig ()
824
831
bs_format_config = config_pb2 .TBlobStorageFormatConfig ()
@@ -864,7 +871,7 @@ def __generate_bs_txt(self):
864
871
dc_enumeration = {}
865
872
866
873
if not self .__cluster_details .get_service ("static_groups" ):
867
- if self .__cluster_details .blob_storage_config :
874
+ if not utils . need_generate_bs_config ( self .__cluster_details .blob_storage_config ) :
868
875
return
869
876
self .__proto_configs ["bs.txt" ] = self ._read_generated_bs_config (
870
877
str (self .__cluster_details .static_erasure ),
@@ -873,6 +880,13 @@ def __generate_bs_txt(self):
873
880
str (self .__cluster_details .fail_domain_type ),
874
881
bs_format_config ,
875
882
)
883
+
884
+ # Merging generated static group config with other keys
885
+ if self .__cluster_details .blob_storage_config is not None :
886
+ template_proto = config_pb2 .TBlobStorageConfig ()
887
+ utils .wrap_parse_dict (self .__cluster_details .blob_storage_config , template_proto )
888
+ self .__proto_configs ["bs.txt" ].MergeFrom (template_proto )
889
+
876
890
if self .__cluster_details .nw_cache_file_path is not None :
877
891
self .__proto_configs ["bs.txt" ].CacheFilePath = self .__cluster_details .nw_cache_file_path
878
892
return
0 commit comments