Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
d1aaa472
Commit
d1aaa472
authored
Nov 27, 2018
by
Samuel GAIST
Browse files
[core] Removed almost unused message_handler file and update imports where needed
parent
81afb0c1
Changes
5
Hide whitespace changes
Inline
Side-by-side
beat/core/execution/docker.py
View file @
d1aaa472
...
...
@@ -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
...
...
beat/core/execution/local.py
View file @
d1aaa472
...
...
@@ -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
=
Algorithm
Executor
(
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
:
...
...
beat/core/execution/subprocess.py
View file @
d1aaa472
...
...
@@ -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
...
...
beat/core/message_handler.py
deleted
100644 → 0
View file @
81afb0c1
#!/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
doc/api.rst
View file @
d1aaa472
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment