Deliver es specific ahab-super in endpoint startup config

service_subpkg
Tyler Goodlet 2023-03-08 13:00:11 -05:00
parent 959e423849
commit 8c66f066bd
1 changed files with 14 additions and 10 deletions

View File

@ -15,17 +15,11 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
from __future__ import annotations from __future__ import annotations
from contextlib import asynccontextmanager as acm
from pprint import pformat
from typing import ( from typing import (
Any, Any,
TYPE_CHECKING, TYPE_CHECKING,
) )
import pyqtgraph as pg
import numpy as np
import tractor
if TYPE_CHECKING: if TYPE_CHECKING:
import docker import docker
@ -65,14 +59,14 @@ def start_elasticsearch(
-itd \ -itd \
--rm \ --rm \
--network=host \ --network=host \
--mount type=bind,source="$(pwd)"/elastic,target=/usr/share/elasticsearch/data \ --mount type=bind,source="$(pwd)"/elastic,\
target=/usr/share/elasticsearch/data \
--env "elastic_username=elastic" \ --env "elastic_username=elastic" \
--env "elastic_password=password" \ --env "elastic_password=password" \
--env "xpack.security.enabled=false" \ --env "xpack.security.enabled=false" \
elastic elastic
''' '''
import docker
get_console_log('info', name=__name__) get_console_log('info', name=__name__)
dcntr: DockerContainer = client.containers.run( dcntr: DockerContainer = client.containers.run(
@ -86,7 +80,7 @@ def start_elasticsearch(
async def start_matcher(msg: str): async def start_matcher(msg: str):
try: try:
health = (await asks.get( health = (await asks.get(
f'http://localhost:19200/_cat/health', 'http://localhost:19200/_cat/health',
params={'format': 'json'} params={'format': 'json'}
)).json() )).json()
@ -102,7 +96,17 @@ def start_elasticsearch(
return ( return (
dcntr, dcntr,
{}, {
# apparently we're REALLY tolerant of startup latency
# for CI XD
'startup_timeout': 240.0,
# XXX: decrease http poll period bc docker
# is shite at handling fast poll rates..
'startup_query_period': 0.1,
'log_msg_key': 'message',
},
# expected startup and stop msgs # expected startup and stop msgs
start_matcher, start_matcher,
stop_matcher, stop_matcher,