mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Merge remote-tracking branch 'upstream/master' into fix3
This commit is contained in:
commit
62f98ee0cf
@ -2,13 +2,19 @@ import errno
|
||||
import subprocess as sp
|
||||
from threading import Timer
|
||||
import tempfile
|
||||
import os
|
||||
|
||||
|
||||
class Client:
|
||||
def __init__(self, host, port=9000, command='/usr/bin/clickhouse-client'):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.command = [command, '--host', self.host, '--port', str(self.port), '--stacktrace']
|
||||
self.command = [command]
|
||||
|
||||
if os.path.basename(command) == 'clickhouse':
|
||||
self.command.append('client')
|
||||
|
||||
self.command += ['--host', self.host, '--port', str(self.port), '--stacktrace']
|
||||
|
||||
|
||||
def query(self, sql, stdin=None, timeout=None, settings=None, user=None, ignore_error=False):
|
||||
|
@ -40,7 +40,7 @@ class ClickHouseCluster:
|
||||
"""
|
||||
|
||||
def __init__(self, base_path, name=None, base_configs_dir=None, server_bin_path=None, client_bin_path=None,
|
||||
zookeeper_config_path=None):
|
||||
zookeeper_config_path=None, custom_dockerd_host=None):
|
||||
self.base_dir = p.dirname(base_path)
|
||||
self.name = name if name is not None else ''
|
||||
|
||||
@ -54,7 +54,13 @@ class ClickHouseCluster:
|
||||
self.project_name = re.sub(r'[^a-z0-9]', '', self.project_name.lower())
|
||||
self.instances_dir = p.join(self.base_dir, '_instances' + ('' if not self.name else '_' + self.name))
|
||||
|
||||
self.base_cmd = ['docker-compose', '--project-directory', self.base_dir, '--project-name', self.project_name]
|
||||
custom_dockerd_host = custom_dockerd_host or os.environ.get('CLICKHOUSE_TESTS_DOCKERD_HOST')
|
||||
|
||||
self.base_cmd = ['docker-compose']
|
||||
if custom_dockerd_host:
|
||||
self.base_cmd += ['--host', custom_dockerd_host]
|
||||
|
||||
self.base_cmd += ['--project-directory', self.base_dir, '--project-name', self.project_name]
|
||||
self.base_zookeeper_cmd = None
|
||||
self.base_mysql_cmd = []
|
||||
self.base_kafka_cmd = []
|
||||
|
Loading…
Reference in New Issue
Block a user