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
e3dc66e8
"test/vscode:/vscode.git/clone" did not exist on "67008f4b320d8950803fcb14b1e5dc6e80bf75e4"
Unverified
Commit
e3dc66e8
authored
Dec 11, 2024
by
Marvin Meiers
Browse files
symphony: fix sending of console lines
parent
c9ab808d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
symphony/client/simbricks/client/client.py
symphony/client/simbricks/client/client.py
+1
-1
symphony/runner/simbricks/runner/__main__.py
symphony/runner/simbricks/runner/__main__.py
+7
-5
No files found.
symphony/client/simbricks/client/client.py
View file @
e3dc66e8
...
...
@@ -451,6 +451,6 @@ class RunnerClient:
"stderr"
:
stderr
,
"output"
:
line
,
}
objs
.
append
[
obj
]
objs
.
append
(
obj
)
async
with
self
.
post
(
url
=
f
"/
{
run_id
}
/console"
,
json
=
objs
)
as
resp
:
ret
=
await
resp
.
json
()
symphony/runner/simbricks/runner/__main__.py
View file @
e3dc66e8
...
...
@@ -37,7 +37,7 @@ verbose = True
# TODO: FIXME, create a custom listener for the runner to register + create backend endpoint to update the output etc.
async
def
periodically_update
(
rc
:
client
.
RunnerClient
,
run_id
:
int
,
listeners
:
list
[
tuple
[
str
,
simulation_executor
.
SimulationSimpleRun
ner
]])
->
None
:
listeners
:
list
[
tuple
[
str
,
command_executor
.
LegacyOutputListe
ner
]])
->
None
:
try
:
while
True
:
all_out
:
list
[
str
]
=
[]
...
...
@@ -55,6 +55,7 @@ async def periodically_update(rc: client.RunnerClient, run_id: int,
await
rc
.
update_run
(
run_id
,
"running"
,
json
.
dumps
(
all_out
))
for
sim_out
in
sim_outs
:
if
len
(
sim_out
[
2
])
>
0
:
await
rc
.
send_out
(
run_id
,
sim_out
[
0
],
sim_out
[
1
],
sim_out
[
2
])
await
asyncio
.
sleep
(
0.5
)
...
...
@@ -77,11 +78,12 @@ async def run_instantiation(sc: client.SimBricksClient, rc: client.RunnerClient,
listeners
.
append
((
sim
.
name
,
listener
))
update_task
=
asyncio
.
create_task
(
periodically_update
(
rc
=
rc
,
run_id
=
run_id
,
listeners
=
listeners
))
output
=
await
runner
.
run
()
update_task
.
cancel
()
d
,
p
=
await
asyncio
.
wait
([
asyncio
.
create_task
(
runner
.
run
()),
update_task
],
return_when
=
asyncio
.
FIRST_COMPLETED
)
for
pending
in
p
:
pending
.
cancel
()
output_path
=
inst
.
get_simulation_output_path
()
output
.
dump
(
outpath
=
output_path
)
list
(
d
)[
0
].
result
()
.
dump
(
outpath
=
output_path
)
if
inst
.
create_artifact
:
art
.
create_artifact
(
...
...
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