Commit d1aaa472 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[core] Removed almost unused message_handler file and update imports where needed

parent 81afb0c1
......@@ -35,21 +35,22 @@ Execution utilities
import os
import shutil
import logging
import requests
import simplejson
import zmq
import docker
import logging
logger = logging.getLogger(__name__)
from beat.backend.python.execution import MessageHandler
from .. import stats
from .. import message_handler
from .. import utils
from .remote import RemoteExecutor
logger = logging.getLogger(__name__)
class DockerExecutor(RemoteExecutor):
"""DockerExecutor runs the code given an execution block information, externally
......@@ -309,8 +310,7 @@ class DockerExecutor(RemoteExecutor):
port = utils.find_free_port_in_range(int(min_port), int(max_port))
address += ':{}'.format(port)
self.message_handler = message_handler.MessageHandler(address,
kill_callback=_kill)
self.message_handler = MessageHandler(address, kill_callback=_kill)
#----- (If necessary) Instantiate the docker container that provide the databases
......
......@@ -52,11 +52,10 @@ from beat.backend.python.helpers import create_inputs_from_configuration
from beat.backend.python.helpers import create_outputs_from_configuration
from beat.backend.python.helpers import AccessMode
from beat.backend.python.executor import Executor
from beat.backend.python.message_handler import MessageHandler
from beat.backend.python.loop_executor import Executor as LoopExecutor
from beat.backend.python.loop_executor import LoopMessageHandler
from beat.backend.python.execution import AlgorithmExecutor
from beat.backend.python.execution import MessageHandler
from beat.backend.python.execution import LoopExecutor
from beat.backend.python.execution import LoopMessageHandler
class LocalExecutor(BaseExecutor):
......@@ -310,11 +309,11 @@ class LocalExecutor(BaseExecutor):
self.loop_executor.process()
self.executor = Executor(self.executor_socket,
self.working_dir,
database_cache=self.databases,
cache_root=self.cache,
loop_socket=self.loop_socket)
self.executor = AlgorithmExecutor(self.executor_socket,
self.working_dir,
database_cache=self.databases,
cache_root=self.cache,
loop_socket=self.loop_socket)
retval = self.executor.setup()
if not retval:
......
......@@ -38,22 +38,23 @@ from __future__ import absolute_import
import os
import shutil
import requests
import zmq
import logging
import sys
import subprocess as sp
import tempfile
import requests
import zmq
import logging
logger = logging.getLogger(__name__)
from beat.backend.python.execution import MessageHandler
from .. import stats
from .. import message_handler
from .. import utils
from .remote import RemoteExecutor
logger = logging.getLogger(__name__)
def _which(program):
'''Pythonic version of the `which` command-line application'''
......@@ -287,8 +288,8 @@ class SubprocessExecutor(RemoteExecutor):
def _kill():
algorithm_process.terminate()
self.message_handler = message_handler.MessageHandler(self.ip_address,
kill_callback=_kill)
self.message_handler = MessageHandler(self.ip_address,
kill_callback=_kill)
#----- (If necessary) Instantiate the subprocess that provide the databases
......
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
###############################################################################
# #
# Copyright (c) 2017 Idiap Research Institute, http://www.idiap.ch/ #
# Contact: beat.support@idiap.ch #
# #
# This file is part of the beat.core module of the BEAT platform. #
# #
# Commercial License Usage #
# Licensees holding valid commercial BEAT licenses may use this file in #
# accordance with the terms contained in a written agreement between you #
# and Idiap. For further information contact tto@idiap.ch #
# #
# Alternatively, this file may be used under the terms of the GNU Affero #
# Public License version 3 as published by the Free Software and appearing #
# in the file LICENSE.AGPL included in the packaging of this file. #
# The BEAT platform is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY #
# or FITNESS FOR A PARTICULAR PURPOSE. #
# #
# You should have received a copy of the GNU Affero Public License along #
# with the BEAT platform. If not, see http://www.gnu.org/licenses/. #
# #
###############################################################################
"""
===============
message_handler
===============
Forward imported from :py:mod:`beat.backend.python.message_handler`:
:py:class:`beat.backend.python.message_handler.MessageHandler`
"""
from beat.backend.python.message_handler import MessageHandler
......@@ -67,8 +67,6 @@ This section includes information for using the Python API of ``beat.core``.
.. automodule:: beat.core.loader
.. automodule:: beat.core.message_handler
.. automodule:: beat.core.outputs
.. automodule:: beat.core.plotter
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment