def __init__(self, process=None): self.client = docker.from_env() db = DBI() db.connect() self.CONTAINER_NAME = db.getServerConfigByName('DOCKER_CONTAINER') self.INPUT_TARGET = db.getServerConfigByName('DOCKER_INPUTDIR') self.OUTPUT_TARGET = db.getServerConfigByName('DOCKER_OUTPUTDIR') self.OUTPUT = db.getServerConfigByName('DOCKER_OUTPUTFILE') db.closeconn()
def __init__(self, process=None): self.client = docker.from_env() db = DBI() db.connect() # DEFAULTS self.CONTAINER_NAME = db.getServerConfigByName('DOCKER_CONTAINER') self.INPUT_TARGET = db.getServerConfigByName('DOCKER_INPUTDIR') self.OUTPUT_TARGET = db.getServerConfigByName('DOCKER_OUTPUTDIR') self.OUTPUT = db.getServerConfigByName('DOCKER_OUTPUTFILE') # Load specific process configs if set self.process = process if process is not None: container = db.getServerConfigByName( db.getProcessField('container', process)) if container is not None: self.CONTAINER_NAME = container input = db.getServerConfigByName( db.getProcessField('containerinputdir', process)) if input is not None: self.INPUT_TARGET = input outputd = db.getServerConfigByName( db.getProcessField('containeroutputdir', process)) if outputd is not None: self.OUTPUT_TARGET = outputd ofile = db.getServerConfigByName( db.getProcessField('filename', process)) if ofile is not None: self.OUTPUT = ofile db.closeconn()