Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
168ee22d
Commit
168ee22d
authored
Jul 15, 2021
by
Antoine Kaufmann
Browse files
experiments: add ip address attribute to executors
parent
4b2fde4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
experiments/run.py
experiments/run.py
+4
-2
experiments/simbricks/exectools.py
experiments/simbricks/exectools.py
+2
-0
No files found.
experiments/run.py
View file @
168ee22d
...
@@ -98,11 +98,13 @@ def load_executors(path):
...
@@ -98,11 +98,13 @@ def load_executors(path):
exs
=
[]
exs
=
[]
for
h
in
hosts
:
for
h
in
hosts
:
if
h
[
'type'
]
==
'local'
:
if
h
[
'type'
]
==
'local'
:
ex
s
.
append
(
exectools
.
LocalExecutor
()
)
ex
=
exectools
.
LocalExecutor
()
elif
h
[
'type'
]
==
'remote'
:
elif
h
[
'type'
]
==
'remote'
:
ex
s
.
append
(
exectools
.
RemoteExecutor
(
h
[
'host'
],
h
[
'workdir'
])
)
ex
=
exectools
.
RemoteExecutor
(
h
[
'host'
],
h
[
'workdir'
])
else
:
else
:
raise
RuntimeError
(
'invalid host type "'
+
h
[
'type'
]
+
'"'
)
raise
RuntimeError
(
'invalid host type "'
+
h
[
'type'
]
+
'"'
)
ex
.
ip
=
h
[
'ip'
]
exs
.
append
(
ex
)
return
exs
return
exs
if
args
.
hosts
is
None
:
if
args
.
hosts
is
None
:
...
...
experiments/simbricks/exectools.py
View file @
168ee22d
...
@@ -255,6 +255,8 @@ class SimpleRemoteComponent(SimpleComponent):
...
@@ -255,6 +255,8 @@ class SimpleRemoteComponent(SimpleComponent):
await
self
.
_kill_cmd
(
'KILL'
)
await
self
.
_kill_cmd
(
'KILL'
)
class
Executor
(
object
):
class
Executor
(
object
):
ip
=
None
def
create_component
(
self
,
label
,
parts
,
**
kwargs
):
def
create_component
(
self
,
label
,
parts
,
**
kwargs
):
raise
NotImplementedError
(
"Please Implement this method"
)
raise
NotImplementedError
(
"Please Implement this method"
)
...
...
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