@@ -111,6 +111,7 @@ def __init__(self, base_path, name=None, base_configs_dir=None, server_bin_path=
111111
112112 custom_dockerd_host = custom_dockerd_host or os .environ .get ('CLICKHOUSE_TESTS_DOCKERD_HOST' )
113113 self .docker_api_version = os .environ .get ("DOCKER_API_VERSION" )
114+ self .docker_base_tag = os .environ .get ("DOCKER_BASE_TAG" )
114115
115116 self .base_cmd = ['docker-compose' ]
116117 if custom_dockerd_host :
@@ -165,7 +166,7 @@ def add_instance(self, name, config_dir=None, main_configs=None, user_configs=No
165166 with_zookeeper = False , with_mysql = False , with_kafka = False , with_rabbitmq = False , clickhouse_path_dir = None ,
166167 with_odbc_drivers = False , with_postgres = False , with_hdfs = False , with_mongo = False ,
167168 with_redis = False , with_minio = False , with_cassandra = False ,
168- hostname = None , env_variables = None , image = "yandex/clickhouse-integration-test" ,
169+ hostname = None , env_variables = None , image = "yandex/clickhouse-integration-test" , tag = None ,
169170 stay_alive = False , ipv4_address = None , ipv6_address = None , with_installed_binary = False , tmpfs = None ,
170171 zookeeper_docker_compose_path = None , zookeeper_use_tmpfs = True , minio_certs_dir = None ):
171172 """Add an instance to the cluster.
@@ -183,13 +184,16 @@ def add_instance(self, name, config_dir=None, main_configs=None, user_configs=No
183184 if name in self .instances :
184185 raise Exception ("Can\' t add instance `%s': there is already an instance with the same name!" % name )
185186
187+ if tag is None :
188+ tag = self .docker_base_tag
189+
186190 instance = ClickHouseInstance (
187191 self , self .base_dir , name , config_dir , main_configs or [], user_configs or [], macros or {},
188192 with_zookeeper ,
189193 self .zookeeper_config_path , with_mysql , with_kafka , with_rabbitmq , with_mongo , with_redis , with_minio , with_cassandra ,
190194 self .base_configs_dir , self .server_bin_path ,
191195 self .odbc_bridge_bin_path , clickhouse_path_dir , with_odbc_drivers , hostname = hostname ,
192- env_variables = env_variables or {}, image = image , stay_alive = stay_alive , ipv4_address = ipv4_address ,
196+ env_variables = env_variables or {}, image = image , tag = tag , stay_alive = stay_alive , ipv4_address = ipv4_address ,
193197 ipv6_address = ipv6_address ,
194198 with_installed_binary = with_installed_binary , tmpfs = tmpfs or [])
195199
@@ -704,7 +708,7 @@ def add_zookeeper_startup_command(self, command):
704708version: '2.3'
705709services:
706710 {name}:
707- image: {image}
711+ image: {image}:{tag}
708712 hostname: {hostname}
709713 volumes:
710714 - {configs_dir}:/etc/clickhouse-server/
@@ -723,6 +727,11 @@ def add_zookeeper_startup_command(self, command):
723727 - {env_file}
724728 security_opt:
725729 - label:disable
730+ dns_opt:
731+ - attempts:2
732+ - timeout:1
733+ - inet6
734+ - rotate
726735 {networks}
727736 {app_net}
728737 {ipv4_address}
@@ -736,10 +745,10 @@ class ClickHouseInstance:
736745
737746 def __init__ (
738747 self , cluster , base_path , name , custom_config_dir , custom_main_configs , custom_user_configs , macros ,
739- with_zookeeper , zookeeper_config_path , with_mysql , with_kafka , with_rabbitmq , with_mongo , with_redis , with_minio , with_cassandra ,
740- base_configs_dir , server_bin_path , odbc_bridge_bin_path ,
748+ with_zookeeper , zookeeper_config_path , with_mysql , with_kafka , with_rabbitmq , with_mongo ,
749+ with_redis , with_minio , with_cassandra , base_configs_dir , server_bin_path , odbc_bridge_bin_path ,
741750 clickhouse_path_dir , with_odbc_drivers , hostname = None , env_variables = None ,
742- image = "yandex/clickhouse-integration-test" ,
751+ image = "yandex/clickhouse-integration-test" , tag = "latest" ,
743752 stay_alive = False , ipv4_address = None , ipv6_address = None , with_installed_binary = False , tmpfs = None ):
744753
745754 self .name = name
@@ -783,6 +792,7 @@ def __init__(
783792 self .client = None
784793 self .default_timeout = 20.0 # 20 sec
785794 self .image = image
795+ self .tag = tag
786796 self .stay_alive = stay_alive
787797 self .ipv4_address = ipv4_address
788798 self .ipv6_address = ipv6_address
@@ -1160,6 +1170,7 @@ def create_dir(self, destroy_dir=True):
11601170 with open (self .docker_compose_path , 'w' ) as docker_compose :
11611171 docker_compose .write (DOCKER_COMPOSE_TEMPLATE .format (
11621172 image = self .image ,
1173+ tag = self .tag ,
11631174 name = self .name ,
11641175 hostname = self .hostname ,
11651176 binary_volume = binary_volume ,
0 commit comments