services
deepdataspace.services
This module wraps all service components for dds and provides a common interface to control them.
celery
deepdataspace.services.celery
The celery service manager.
config
deepdataspace.services.config
This file defines global config variables shared by all services.
- log_and_save_env(name: str, value)[source]
Save an export statement to the env file, and log it to the console. The saved statements will be loaded by ddsop command.
- load_all_env()[source]
Load environment variables from the env file. The env file is generated by dds command.
dds
deepdataspace.services.dds
The dds service manager. This is the main entry point for dds, which controls all other services.
- class DDS(*args, **kwargs)[source]
Bases:
object
- init_envs()[source]
Init all global environments. These environments will be read by subprocesses, especially celery and django.
django
deepdataspace.services.django
The django service manager.
mongodb
deepdataspace.services.mongodb
The mongodb service manager.
redis
deepdataspace.services.redis
The redis service manager.
service
deepdataspace.services.service
Base class and common interfaces for all services.
- progress_log(log_prefix: str)[source]
Print a dynamic log message while we start services in the background. So users won’t mistake that our process is dead.
- class Service(name: str, cmd_list: list)[source]
Bases:
object
- static close_process(pid: int)[source]
Close a process by pid. Try p.terminate first, then p.kill if it survives more than 1 second.
- open_process(cmd: list, wait: int = 2)[source]
Start a subprocess with cmd and argument. :param cmd: the cmd and arguments used to start the subprocess :param wait: num of seconds to wait after init the subprocess
- start_process(cmd_list: list, wait: int = 2)[source]
Start a subprocess with the command line arguments. :param cmd_list: the command line arguments to start the process :param cmd_id: the command line identifier, this must be unique enough to identify the process from all processes :param wait: how many seconds to wait after the subprocess is called
sqlite
deepdataspace.services.sqlite
The sqlite db service manager.