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
87cc567a
"git@developer.sourcefind.cn:gaoqiong/composable_kernel.git" did not exist on "3bbd5988fe3cfa5ecda392e9b7d4457ce900d154"
Unverified
Commit
87cc567a
authored
Dec 10, 2024
by
Jakob Görgen
Browse files
symphony/runner: fixed runner code + proper artifact creation
parent
9f7caffa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
symphony/runner/simbricks/runner/__main__.py
symphony/runner/simbricks/runner/__main__.py
+18
-9
No files found.
symphony/runner/simbricks/runner/__main__.py
View file @
87cc567a
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
import
asyncio
import
asyncio
import
json
import
json
import
pathlib
import
pathlib
import
rich
from
rich.console
import
Console
from
rich.console
import
Console
from
simbricks.runtime
import
simulation_executor
from
simbricks.runtime
import
simulation_executor
from
simbricks.orchestration.instantiation
import
base
as
inst_base
from
simbricks.orchestration.instantiation
import
base
as
inst_base
...
@@ -31,6 +30,7 @@ from simbricks.orchestration.system import base as sys_base
...
@@ -31,6 +30,7 @@ from simbricks.orchestration.system import base as sys_base
from
simbricks.orchestration.simulation
import
base
as
sim_base
from
simbricks.orchestration.simulation
import
base
as
sim_base
from
simbricks.runtime
import
command_executor
from
simbricks.runtime
import
command_executor
from
simbricks
import
client
from
simbricks
import
client
from
simbricks.utils
import
artifatcs
as
art
verbose
=
True
verbose
=
True
...
@@ -53,10 +53,14 @@ async def periodically_update(rc: client.RunnerClient, run_id: int,
...
@@ -53,10 +53,14 @@ async def periodically_update(rc: client.RunnerClient, run_id: int,
except
asyncio
.
CancelledError
:
except
asyncio
.
CancelledError
:
pass
pass
async
def
run_instantiation
(
rc
:
client
.
RunnerClient
,
run_id
:
int
,
inst
:
inst_base
.
Instantiation
)
->
dict
:
async
def
run_instantiation
(
sc
:
client
.
SimBricksClient
,
rc
:
client
.
RunnerClient
,
run_id
:
int
,
inst
:
inst_base
.
Instantiation
)
->
None
:
await
rc
.
update_run
(
run_id
,
"running"
,
""
)
executor
=
command_executor
.
LocalExecutor
()
executor
=
command_executor
.
LocalExecutor
()
runner
=
simulation_executor
.
SimulationSimpleRunner
(
executor
,
inst
,
verbose
)
runner
=
simulation_executor
.
SimulationSimpleRunner
(
executor
,
inst
,
verbose
)
await
runner
.
prepare
()
await
runner
.
prepare
()
listeners
=
[]
listeners
=
[]
for
sim
in
inst
.
simulation
.
all_simulators
():
for
sim
in
inst
.
simulation
.
all_simulators
():
listener
=
command_executor
.
LegacyOutputListener
()
listener
=
command_executor
.
LegacyOutputListener
()
...
@@ -67,11 +71,19 @@ async def run_instantiation(rc: client.RunnerClient, run_id: int, inst: inst_bas
...
@@ -67,11 +71,19 @@ async def run_instantiation(rc: client.RunnerClient, run_id: int, inst: inst_bas
output
=
await
runner
.
run
()
output
=
await
runner
.
run
()
update_task
.
cancel
()
update_task
.
cancel
()
return
output
.
toJSON
()
output_path
=
inst
.
get_simulation_output_path
()
output
.
dump
(
outpath
=
output_path
)
if
inst
.
create_artifact
:
art
.
create_artifact
(
artifact_name
=
inst
.
artifact_name
,
paths_to_include
=
inst
.
artifact_paths
)
await
sc
.
set_run_artifact
(
run_id
,
inst
.
artifact_name
)
await
rc
.
update_run
(
run_id
,
"completed"
,
json
.
dumps
(
output
.
toJSON
()))
async
def
amain
():
async
def
amain
():
base_client
=
client
.
BaseClient
(
base_url
=
"http://1
27.0
.0.1:8000"
)
base_client
=
client
.
BaseClient
(
base_url
=
"http://1
72.17
.0.1:8000"
)
namespace_client
=
client
.
NSClient
(
base_client
=
base_client
,
namespace
=
"foo/bar/baz"
)
namespace_client
=
client
.
NSClient
(
base_client
=
base_client
,
namespace
=
"foo/bar/baz"
)
sb_client
=
client
.
SimBricksClient
(
namespace_client
)
sb_client
=
client
.
SimBricksClient
(
namespace_client
)
rc
=
client
.
RunnerClient
(
namespace_client
,
42
)
rc
=
client
.
RunnerClient
(
namespace_client
,
42
)
...
@@ -106,13 +118,10 @@ async def amain():
...
@@ -106,13 +118,10 @@ async def amain():
inst
.
env
=
env
inst
.
env
=
env
inst
.
preserve_tmp_folder
=
False
inst
.
preserve_tmp_folder
=
False
inst
.
create_checkpoint
=
True
inst
.
create_checkpoint
=
True
inst
.
artifact_paths
=
[
f
"
{
run_workdir
}
/output"
]
console
.
log
(
f
"Starting run
{
run_id
}
"
)
console
.
log
(
f
"Starting run
{
run_id
}
"
)
await
rc
.
update_run
(
run_id
,
"running"
,
""
)
await
run_instantiation
(
sb_client
,
rc
,
run_id
,
inst
)
out
=
await
run_instantiation
(
rc
,
run_id
,
inst
)
if
inst
.
create_artifact
:
await
sb_client
.
set_run_artifact
(
run_id
,
inst
.
artifact_name
)
await
rc
.
update_run
(
run_id
,
"completed"
,
json
.
dumps
(
out
))
console
.
log
(
f
"Finished run
{
run_id
}
"
)
console
.
log
(
f
"Finished run
{
run_id
}
"
)
...
...
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