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
378fe455
Unverified
Commit
378fe455
authored
Nov 30, 2024
by
Antoine Kaufmann
Browse files
symphony/runner: explicitly setup/override instantiation env
parent
46cd2dae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
symphony/runner/simbricks/runner/__main__.py
symphony/runner/simbricks/runner/__main__.py
+10
-1
No files found.
symphony/runner/simbricks/runner/__main__.py
View file @
378fe455
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
import
asyncio
import
asyncio
import
json
import
json
import
pathlib
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
from
simbricks.orchestration.system
import
base
as
sys_base
from
simbricks.orchestration.system
import
base
as
sys_base
...
@@ -48,6 +48,8 @@ async def amain():
...
@@ -48,6 +48,8 @@ async def amain():
sb_client
=
client
.
SimBricksClient
(
namespace_client
)
sb_client
=
client
.
SimBricksClient
(
namespace_client
)
rc
=
client
.
RunnerClient
(
namespace_client
,
42
)
rc
=
client
.
RunnerClient
(
namespace_client
,
42
)
workdir
=
pathlib
.
Path
(
'./runner-work'
).
resolve
()
while
True
:
while
True
:
run_obj
=
await
rc
.
next_run
()
run_obj
=
await
rc
.
next_run
()
if
not
run_obj
:
if
not
run_obj
:
...
@@ -56,6 +58,9 @@ async def amain():
...
@@ -56,6 +58,9 @@ async def amain():
continue
continue
print
(
f
'Preparing run
{
run_obj
[
"id"
]
}
'
)
print
(
f
'Preparing run
{
run_obj
[
"id"
]
}
'
)
run_workdir
=
workdir
/
f
'run-
{
run_obj
[
"id"
]
}
'
run_workdir
.
mkdir
(
parents
=
True
)
inst_obj
=
await
sb_client
.
get_instantiation
(
run_obj
[
'instantiation_id'
])
inst_obj
=
await
sb_client
.
get_instantiation
(
run_obj
[
'instantiation_id'
])
sim_obj
=
await
sb_client
.
get_simulation
(
inst_obj
[
'simulation_id'
])
sim_obj
=
await
sb_client
.
get_simulation
(
inst_obj
[
'simulation_id'
])
sys_obj
=
await
sb_client
.
get_system
(
sim_obj
[
'system_id'
])
sys_obj
=
await
sb_client
.
get_system
(
sim_obj
[
'system_id'
])
...
@@ -63,7 +68,11 @@ async def amain():
...
@@ -63,7 +68,11 @@ async def amain():
system
=
sys_base
.
System
.
fromJSON
(
json
.
loads
(
sys_obj
[
'sb_json'
]))
system
=
sys_base
.
System
.
fromJSON
(
json
.
loads
(
sys_obj
[
'sb_json'
]))
simulation
=
sim_base
.
Simulation
.
fromJSON
(
system
,
json
.
loads
(
sim_obj
[
'sb_json'
]))
simulation
=
sim_base
.
Simulation
.
fromJSON
(
system
,
json
.
loads
(
sim_obj
[
'sb_json'
]))
# TODO: set from args
env
=
inst_base
.
InstantiationEnvironment
(
workdir
=
run_workdir
)
inst
=
inst_base
.
Instantiation
(
sim
=
simulation
)
inst
=
inst_base
.
Instantiation
(
sim
=
simulation
)
inst
.
env
=
env
inst
.
preserve_tmp_folder
=
False
inst
.
preserve_tmp_folder
=
False
inst
.
create_checkpoint
=
True
inst
.
create_checkpoint
=
True
...
...
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