ucloud-{api,scheduler,host,filescanner,imagescanner,metadata} combined
This commit is contained in:
commit
da77ac65eb
29 changed files with 3941 additions and 0 deletions
25
scheduler/config.py
Executable file
25
scheduler/config.py
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
import logging
|
||||
|
||||
from decouple import config
|
||||
from etcd3_wrapper import Etcd3Wrapper
|
||||
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")
|
||||
|
||||
etcd_client = Etcd3Wrapper(host=config("ETCD_URL"))
|
||||
|
||||
vm_pool = VmPool(etcd_client, vm_prefix)
|
||||
host_pool = HostPool(etcd_client, host_prefix)
|
||||
request_pool = RequestPool(etcd_client, request_prefix)
|
||||
Loading…
Add table
Add a link
Reference in a new issue