@@ -1421,24 +1421,26 @@ def setup_minio_cmd(self, instance, env_variables, docker_compose_yml_dir):
14211421 return self .base_minio_cmd
14221422
14231423 def setup_glue_catalog_cmd (self , instance , env_variables , docker_compose_yml_dir ):
1424+ self .with_glue_catalog = True
14241425 self .base_cmd .extend (
14251426 [
14261427 "--file" ,
14271428 p .join (docker_compose_yml_dir , "docker_compose_glue_catalog.yml" ),
14281429 ]
14291430 )
1430- self .base_iceberg_catalog_cmd = self .compose_cmd (
1431+ self .base_glue_catalog_cmd = self .compose_cmd (
14311432 "--env-file" ,
14321433 instance .env_file ,
14331434 "--file" ,
14341435 p .join (docker_compose_yml_dir , "docker_compose_glue_catalog.yml" ),
14351436 )
1436- return self .base_iceberg_catalog_cmd
1437+ return self .base_glue_catalog_cmd
14371438
14381439
14391440 def setup_hms_catalog_cmd (
14401441 self , instance , env_variables , docker_compose_yml_dir
14411442 ):
1443+ self .with_hms_catalog = True
14421444 self .base_cmd .extend (
14431445 [
14441446 "--file" ,
@@ -1460,6 +1462,7 @@ def setup_hms_catalog_cmd(
14601462 def setup_iceberg_catalog_cmd (
14611463 self , instance , env_variables , docker_compose_yml_dir
14621464 ):
1465+ self .with_iceberg_catalog = True
14631466 self .base_cmd .extend (
14641467 [
14651468 "--file" ,
@@ -2591,6 +2594,34 @@ def wait_mongo_to_start(self, timeout=30, secure=False):
25912594 logging .debug ("Can't connect to Mongo " + str (ex ))
25922595 time .sleep (1 )
25932596
2597+
2598+ def wait_custom_minio_to_start (self , buckets , host , port , timeout = 180 ):
2599+ ip = self .get_instance_ip (host )
2600+ minio_client = Minio (
2601+ f"{ ip } :{ port } " ,
2602+ access_key = minio_access_key ,
2603+ secret_key = minio_secret_key ,
2604+ secure = False ,
2605+ http_client = urllib3 .PoolManager (cert_reqs = "CERT_NONE" ),
2606+ )
2607+ start = time .time ()
2608+ while time .time () - start < timeout :
2609+ try :
2610+ minio_client .list_buckets ()
2611+
2612+ logging .debug ("Connected to Minio." )
2613+
2614+ if all (minio_client .bucket_exists (bucket ) for bucket in buckets ):
2615+ return
2616+
2617+ time .sleep (1 )
2618+ except Exception as ex :
2619+ logging .debug ("Can't connect to Minio: %s" , str (ex ))
2620+ time .sleep (1 )
2621+
2622+
2623+ raise Exception ("Can't wait Minio to start" )
2624+
25942625 def wait_minio_to_start (self , timeout = 180 , secure = False ):
25952626 self .minio_ip = self .get_instance_ip (self .minio_host )
25962627 self .minio_redirect_ip = self .get_instance_ip (self .minio_redirect_host )
@@ -3126,6 +3157,24 @@ def get_feature_flag_value(feature_flag):
31263157 logging .info ("Trying to connect to Minio..." )
31273158 self .wait_minio_to_start (secure = self .minio_certs_dir is not None )
31283159
3160+ if self .with_glue_catalog and self .base_glue_catalog_cmd :
3161+ logging .info ("Trying to connect to Minio for glue catalog..." )
3162+ subprocess_check_call (self .base_glue_catalog_cmd + common_opts )
3163+ self .up_called = True
3164+ self .wait_custom_minio_to_start (['warehouse-glue' ], 'minio' , 9000 )
3165+
3166+ if self .with_hms_catalog and self .base_iceberg_hms_cmd :
3167+ logging .info ("Trying to connect to Minio for hms catalog..." )
3168+ subprocess_check_call (self .base_iceberg_hms_cmd + common_opts )
3169+ self .up_called = True
3170+ self .wait_custom_minio_to_start (['warehouse-hms' ], 'minio' , 9000 )
3171+
3172+ if self .with_iceberg_catalog and self .base_iceberg_catalog_cmd :
3173+ logging .info ("Trying to connect to Minio for Iceberg catalog..." )
3174+ subprocess_check_call (self .base_iceberg_catalog_cmd + common_opts )
3175+ self .up_called = True
3176+ self .wait_custom_minio_to_start (['warehouse-rest' ], 'minio' , 9000 )
3177+
31293178 if self .with_azurite and self .base_azurite_cmd :
31303179 azurite_start_cmd = self .base_azurite_cmd + common_opts
31313180 logging .info (
0 commit comments