def serve_app(similarities, fragments, pharmacophores, internal_port=8084, external_url='http://localhost:8084/kripo'):
"""Serve webservice forever
Args:
similarities: Filename of similarity matrix hdf5 file
fragments: Filename of fragments database file
pharmacophores: Filename of pharmacophores hdf5 file
internal_port: TCP port on which to listen
external_url (str): URL which should be used in Swagger spec
"""
sim_matrix = open_similarity_matrix(similarities)
pharmacophores_db = PharmacophoresDb(pharmacophores)
app = wsgi_app(sim_matrix, fragments, pharmacophores_db, external_url)
LOGGER.setLevel(logging.INFO)
LOGGER.addHandler(logging.StreamHandler())
LOGGER.info(' * Swagger spec at {}/swagger.json'.format(external_url))
LOGGER.info(' * Swagger ui at {}/ui'.format(external_url))
try:
app.run(port=internal_port)
finally:
sim_matrix.close()
评论列表
文章目录