Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
ab9146be
Commit
ab9146be
authored
Sep 28, 2018
by
Samuel GAIST
Browse files
[execution][docker] Added support for custom port from range
parent
5e596c3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
beat/core/execution/docker.py
View file @
ab9146be
...
...
@@ -216,7 +216,14 @@ class DockerExecutor(RemoteExecutor):
def
_kill
():
self
.
host
.
kill
(
algorithm_container
)
self
.
message_handler
=
message_handler
.
MessageHandler
(
self
.
host
.
ip
,
address
=
self
.
host
.
ip
port_range
=
self
.
data
.
pop
(
'port_range'
,
None
)
if
port_range
:
min_port
,
max_port
=
port_range
.
split
(
':'
)
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
)
...
...
beat/core/test/test_docker_execution.py
View file @
ab9146be
...
...
@@ -70,6 +70,13 @@ class TestDockerExecution(BaseExecutionMixIn):
assert
result
is
None
@
slow
def
test_custom_port_range
(
self
):
result
=
self
.
execute
(
'user/user/integers_addition/1/integers_addition'
,
[{
'sum'
:
495
,
'nb'
:
9
}],
port_range
=
"50000:50100"
)
assert
result
is
None
# NOT COMPATIBLE YET WITH THE NEW API
# @slow
# def test_cxx_double_1(self):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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