ucloud-scheduler/config.py

24 lines
691 B
Python
Raw Normal View History

2019-09-05 08:37:59 +00:00
import logging
2019-09-03 16:06:41 +00:00
from decouple import config
from etcd3_wrapper import Etcd3Wrapper
2019-09-05 08:37:59 +00:00
from ucloud_common.vm import VmPool
from ucloud_common.host import HostPool
from ucloud_common.request import RequestPool
logging.basicConfig(
level=logging.DEBUG,
filename="log.txt",
filemode="a",
format="%(asctime)s: %(levelname)s - %(message)s",
datefmt="%d-%b-%y %H:%M:%S",
)
vm_prefix = config("VM_PREFIX")
host_prefix = config("HOST_PREFIX")
request_prefix = config("REQUEST_PREFIX")
2019-09-03 16:06:41 +00:00
etcd_client = Etcd3Wrapper(host=config("ETCD_URL"))
2019-09-05 08:37:59 +00:00
vm_pool = VmPool(etcd_client, vm_prefix)
host_pool = HostPool(etcd_client, host_prefix)
request_pool = RequestPool(etcd_client, request_prefix)