diff options
author | uzhas <uzhas@ydb.tech> | 2022-09-19 20:03:58 +0300 |
---|---|---|
committer | uzhas <uzhas@ydb.tech> | 2022-09-19 20:03:58 +0300 |
commit | b4009cfdfa578d7b288292cc670357d298bc575e (patch) | |
tree | 650c22fd949eff5646243d07574109872afc2182 | |
parent | c3b5c9d37a43563ea418c6d6fe40feb97c2b5c47 (diff) | |
download | ydb-b4009cfdfa578d7b288292cc670357d298bc575e.tar.gz |
fq public HTTP API lib, config generator, local ydb, part3
-rw-r--r-- | ydb/public/tools/lib/cmds/__init__.py | 2 | ||||
-rw-r--r-- | ydb/public/tools/local_ydb/__main__.py | 4 | ||||
-rw-r--r-- | ydb/tests/library/harness/kikimr_config.py | 7 | ||||
-rw-r--r-- | ydb/tests/library/harness/kikimr_port_allocator.py | 20 |
4 files changed, 32 insertions, 1 deletions
diff --git a/ydb/public/tools/lib/cmds/__init__.py b/ydb/public/tools/lib/cmds/__init__.py index da12fbf302..a7ad4915d1 100644 --- a/ydb/public/tools/lib/cmds/__init__.py +++ b/ydb/public/tools/lib/cmds/__init__.py @@ -29,6 +29,7 @@ class EmptyArguments(object): self.auth_config_path = None self.debug_logging = [] self.fixed_ports = False + self.public_http_config_path = None def ensure_path_exists(path): @@ -297,6 +298,7 @@ def deploy(arguments): port_allocator=port_allocator, use_in_memory_pdisks=use_in_memory_pdisks_flag(), yq_config_path=arguments.yq_config_path, + public_http_config_path=arguments.public_http_config_path, auth_config_path=arguments.auth_config_path, **optionals ) diff --git a/ydb/public/tools/local_ydb/__main__.py b/ydb/public/tools/local_ydb/__main__.py index b23fcb29c3..c7dd8c0f7a 100644 --- a/ydb/public/tools/local_ydb/__main__.py +++ b/ydb/public/tools/local_ydb/__main__.py @@ -128,6 +128,10 @@ To update cluster (stop + start): '--enable-datastreams', default=False, action='store_true', help='Enable datastreams service' ) + sub_parser.add_argument( + '--public-http-config-path', default=None, + help='The path to public HTTP config' + ) arguments = parser.parse_args() arguments.ydb_working_dir = cmds.wrap_path(arguments.ydb_working_dir) diff --git a/ydb/tests/library/harness/kikimr_config.py b/ydb/tests/library/harness/kikimr_config.py index 58da8523ad..7ff6e823ca 100644 --- a/ydb/tests/library/harness/kikimr_config.py +++ b/ydb/tests/library/harness/kikimr_config.py @@ -128,6 +128,8 @@ class KikimrConfigGenerator(object): enable_metering=False, grpc_tls_data_path=None, yq_config_path=None, + public_http_config_path=None, + public_http_config=None, enable_datastreams=False, auth_config_path=None, disable_mvcc=False, @@ -271,6 +273,11 @@ class KikimrConfigGenerator(object): if yq_config_path: self.yaml_config["yandex_query_config"] = _load_yaml_config(yq_config_path) + if public_http_config: + self.yaml_config["public_http_config"] = public_http_config + elif public_http_config_path: + self.yaml_config["public_http_config"] = _load_yaml_config(public_http_config_path) + self.__build() if self.grpc_ssl_enable: diff --git a/ydb/tests/library/harness/kikimr_port_allocator.py b/ydb/tests/library/harness/kikimr_port_allocator.py index ccb4654dc0..0ff3d69445 100644 --- a/ydb/tests/library/harness/kikimr_port_allocator.py +++ b/ydb/tests/library/harness/kikimr_port_allocator.py @@ -38,6 +38,10 @@ class KikimrNodePortAllocatorInterface(object): def ext_port(self): pass + @abc.abstractproperty + def public_http_port(self): + pass + class KikimrPortAllocatorInterface(object): __metaclass__ = abc.ABCMeta @@ -79,6 +83,7 @@ class KikimrPortManagerNodePortAllocator(KikimrNodePortAllocatorInterface): self.__sqs_port = None self.__grpc_ssl_port = None self.__ext_port = None + self.__public_http_port = None @property def mon_port(self): @@ -122,6 +127,12 @@ class KikimrPortManagerNodePortAllocator(KikimrNodePortAllocatorInterface): self.__ext_port = self.__port_manager.get_port() return self.__ext_port + @property + def public_http_port(self): + if self.__public_http_port is None: + self.__public_http_port = self.__port_manager.get_port() + return self.__public_http_port + class KikimrPortManagerPortAllocator(KikimrPortAllocatorInterface): def __init__(self, port_manager=None): @@ -150,7 +161,7 @@ class KikimrPortManagerPortAllocator(KikimrPortAllocatorInterface): class KikimrFixedNodePortAllocator(KikimrNodePortAllocatorInterface): def __init__(self, mon_port=8765, grpc_port=2135, mbus_port=2134, ic_port=19001, sqs_port=8771, grpc_ssl_port=2137, - ext_port=2237): + ext_port=2237, public_http_port=8766): super(KikimrFixedNodePortAllocator, self).__init__() if os.getenv('MON_PORT') is not None: self.__mon_port = int(os.getenv('MON_PORT')) @@ -174,6 +185,10 @@ class KikimrFixedNodePortAllocator(KikimrNodePortAllocatorInterface): self.__ext_port = int(os.getenv('GRPC_EXT_PORT')) else: self.__ext_port = ext_port + if os.getenv('PUBLIC_HTTP_PORT') is not None: + self.__public_http_port = int(os.getenv('PUBLIC_HTTP_PORT')) + else: + self.__public_http_port = public_http_port @property def mon_port(self): @@ -203,6 +218,9 @@ class KikimrFixedNodePortAllocator(KikimrNodePortAllocatorInterface): def ext_port(self): return self.__ext_port + def public_http_port(self): + return self.__public_http_port + class KikimrFixedPortAllocator(KikimrPortAllocatorInterface): def __init__(self, |