Move all docker and external db code to `piker.service`

service_subpkg_backup
Tyler Goodlet 2023-03-08 15:25:20 -05:00
parent bd248381ea
commit f627fedf74
6 changed files with 8 additions and 9 deletions

View File

@ -206,8 +206,8 @@ def services(config, tl, ports):
def _load_clis() -> None: def _load_clis() -> None:
from ..data import marketstore # noqa from ..service import marketstore # noqa
from ..data import elastic from ..service import elastic
from ..data import cli # noqa from ..data import cli # noqa
from ..brokers import cli # noqa from ..brokers import cli # noqa
from ..ui import cli # noqa from ..ui import cli # noqa

View File

@ -144,7 +144,7 @@ def storesh(
async with open_piker_runtime( async with open_piker_runtime(
'storesh', 'storesh',
enable_modules=['piker.data._ahab'], enable_modules=['piker.service._ahab'],
): ):
symbol = symbols[0] symbol = symbols[0]
@ -194,7 +194,7 @@ def storage(
async with open_piker_runtime( async with open_piker_runtime(
'tsdb_storage', 'tsdb_storage',
enable_modules=['piker.data._ahab'], enable_modules=['piker.service._ahab'],
): ):
symbol = symbols[0] symbol = symbols[0]
async with open_tsdb_client(symbol) as storage: async with open_tsdb_client(symbol) as storage:

View File

@ -362,8 +362,8 @@ async def open_pikerd(
Services.debug_mode = debug_mode Services.debug_mode = debug_mode
if tsdb: if tsdb:
from piker.data._ahab import start_ahab from ._ahab import start_ahab
from piker.data.marketstore import start_marketstore from .marketstore import start_marketstore
log.info('Spawning `marketstore` supervisor') log.info('Spawning `marketstore` supervisor')
ctn_ready, config, (cid, pid) = await service_nursery.start( ctn_ready, config, (cid, pid) = await service_nursery.start(

View File

@ -26,7 +26,6 @@
from __future__ import annotations from __future__ import annotations
from contextlib import asynccontextmanager as acm from contextlib import asynccontextmanager as acm
from datetime import datetime from datetime import datetime
from pprint import pformat
from typing import ( from typing import (
Any, Any,
Optional, Optional,
@ -55,7 +54,7 @@ if TYPE_CHECKING:
import docker import docker
from ._ahab import DockerContainer from ._ahab import DockerContainer
from .feed import maybe_open_feed from ..data.feed import maybe_open_feed
from ..log import get_logger, get_console_log from ..log import get_logger, get_console_log
from .._profile import Profiler from .._profile import Profiler
@ -136,7 +135,7 @@ def start_marketstore(
# create dirs when dne # create dirs when dne
if not os.path.isdir(config._config_dir): if not os.path.isdir(config._config_dir):
Path(config._config_dir).mkdir(parents=True, exist_ok=True) Path(config._config_dir).mkdir(parents=True, exist_ok=True)
if not os.path.isdir(mktsdir): if not os.path.isdir(mktsdir):
os.mkdir(mktsdir) os.mkdir(mktsdir)