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
8ec24962
"mmdet3d/vscode:/vscode.git/clone" did not exist on "3fa5a430d73f33ff2f4aab07d77b72637134896b"
Commit
8ec24962
authored
Jan 16, 2025
by
Jonas Kaufmann
Browse files
symphony/runner/__main__.py: update to use reworked simulation executor
parent
9604d76d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
33 deletions
+5
-33
symphony/runner/simbricks/runner/__main__.py
symphony/runner/simbricks/runner/__main__.py
+5
-33
No files found.
symphony/runner/simbricks/runner/__main__.py
View file @
8ec24962
...
...
@@ -30,47 +30,23 @@ from simbricks import client
from
simbricks.orchestration.instantiation
import
base
as
inst_base
from
simbricks.orchestration.simulation
import
base
as
sim_base
from
simbricks.orchestration.system
import
base
as
sys_base
from
simbricks.runtime
import
command_executor
,
simulation_executor
from
simbricks.runtime
import
simulation_executor
from
simbricks.utils
import
artifatcs
as
art
from
.settings
import
runner_settings
as
runset
class
ConsoleLineListener
(
command_executor
.
OutputListener
):
def
__init__
(
self
,
rc
:
client
.
RunnerClient
,
run_id
:
int
,
prefix
:
str
=
""
):
super
().
__init__
()
self
.
_prefix
:
str
=
prefix
self
.
_rc
:
client
.
RunnerClient
=
rc
self
.
_run_id
:
int
=
run_id
async
def
handel_out
(
self
,
lines
:
list
[
str
])
->
None
:
if
len
(
lines
)
<
1
:
return
await
self
.
_rc
.
send_out
(
self
.
_run_id
,
self
.
_prefix
,
False
,
lines
)
async
def
handel_err
(
self
,
lines
:
list
[
str
])
->
None
:
if
len
(
lines
)
<
1
:
return
await
self
.
_rc
.
send_out
(
self
.
_run_id
,
self
.
_prefix
,
True
,
lines
)
def
toJSON
(
self
)
->
dict
:
json_obj
=
super
().
toJSON
()
json_obj
.
update
({
"prefix"
:
self
.
_prefix
})
return
json_obj
class
Run
:
def
__init__
(
self
,
run_id
:
int
,
inst
:
inst_base
.
Instantiation
,
runner
:
simulation_executor
.
Simulation
SimpleRunne
r
,
runner
:
simulation_executor
.
Simulation
Executo
r
,
):
self
.
run_id
:
int
=
run_id
self
.
inst
:
inst_base
.
Instantiation
=
inst
self
.
cancelled
:
bool
=
False
self
.
runner
:
simulation_executor
.
Simulation
SimpleRunne
r
=
runner
self
.
runner
:
simulation_executor
.
Simulation
Executo
r
=
runner
self
.
exec_task
:
asyncio
.
Task
|
None
=
None
...
...
@@ -123,14 +99,10 @@ class Runner:
inst
=
await
self
.
_fetch_assemble_inst
(
run_id
=
run_id
)
executor
=
command_executor
.
LocalExecutor
(
)
runner
=
simulation_executor
.
Simulation
SimpleRunner
(
e
xecutor
,
inst
,
runset
().
verbose
)
callbacks
=
simulation_executor
.
SimulationExecutorCallbacks
(
inst
)
runner
=
simulation_executor
.
Simulation
E
xecutor
(
inst
,
callbacks
,
runset
().
verbose
)
await
runner
.
prepare
()
for
sim
in
inst
.
simulation
.
all_simulators
():
listener
=
ConsoleLineListener
(
rc
=
self
.
_rc
,
run_id
=
run_id
)
runner
.
add_listener
(
sim
,
listener
)
run
=
Run
(
run_id
=
run_id
,
inst
=
inst
,
runner
=
runner
)
return
run
...
...
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