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
a4f0b9e3
Unverified
Commit
a4f0b9e3
authored
Jan 16, 2025
by
Jakob Görgen
Browse files
symphony/cli: reflect that instantiations do have fragments + resource groups with namespace
parent
155eb854
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
18 deletions
+11
-18
symphony/cli/simbricks/cli/commands/instantiations.py
symphony/cli/simbricks/cli/commands/instantiations.py
+2
-2
symphony/cli/simbricks/cli/commands/resource_groups.py
symphony/cli/simbricks/cli/commands/resource_groups.py
+4
-4
symphony/cli/simbricks/cli/commands/runs.py
symphony/cli/simbricks/cli/commands/runs.py
+5
-12
No files found.
symphony/cli/simbricks/cli/commands/instantiations.py
View file @
a4f0b9e3
...
@@ -33,7 +33,7 @@ app = Typer(help="Managing SimBricks Instantiations.")
...
@@ -33,7 +33,7 @@ app = Typer(help="Managing SimBricks Instantiations.")
async
def
ls
():
async
def
ls
():
"""List Instantiations."""
"""List Instantiations."""
insts
=
await
client_provider
.
simbricks_client
.
get_instantiations
()
insts
=
await
client_provider
.
simbricks_client
.
get_instantiations
()
print_table_generic
(
"Instantiations"
,
insts
,
"id"
,
"simulation_id"
)
print_table_generic
(
"Instantiations"
,
insts
,
"id"
,
"simulation_id"
,
"fragments"
)
@
app
.
command
()
@
app
.
command
()
...
@@ -41,7 +41,7 @@ async def ls():
...
@@ -41,7 +41,7 @@ async def ls():
async
def
show
(
inst_id
:
int
):
async
def
show
(
inst_id
:
int
):
"""Show individual Instantiation."""
"""Show individual Instantiation."""
inst
=
await
client_provider
.
simbricks_client
.
get_instantiation
(
instantiation_id
=
inst_id
)
inst
=
await
client_provider
.
simbricks_client
.
get_instantiation
(
instantiation_id
=
inst_id
)
print_table_generic
(
"Instantiations"
,
[
inst
],
"id"
,
"simulation_id"
)
print_table_generic
(
"Instantiations"
,
[
inst
],
"id"
,
"simulation_id"
,
"fragments"
)
@
app
.
command
()
@
app
.
command
()
...
...
symphony/cli/simbricks/cli/commands/resource_groups.py
View file @
a4f0b9e3
...
@@ -15,7 +15,7 @@ async def create(label: str, available_cores: int, available_memory: int):
...
@@ -15,7 +15,7 @@ async def create(label: str, available_cores: int, available_memory: int):
label
=
label
,
available_cores
=
available_cores
,
available_memory
=
available_memory
label
=
label
,
available_cores
=
available_cores
,
available_memory
=
available_memory
)
)
print_table_generic
(
print_table_generic
(
"Resource Group"
,
[
rg
],
"id"
,
"label"
,
"available_cores"
,
"available_memory"
,
"cores_left"
,
"memory_left"
"Resource Group"
,
[
rg
],
"id"
,
"label"
,
"namespace_id"
,
"available_cores"
,
"available_memory"
,
"cores_left"
,
"memory_left"
)
)
...
@@ -39,7 +39,7 @@ async def update(
...
@@ -39,7 +39,7 @@ async def update(
memory_left
=
memory_left
,
memory_left
=
memory_left
,
)
)
print_table_generic
(
print_table_generic
(
"Resource Group"
,
[
rg
],
"id"
,
"label"
,
"available_cores"
,
"available_memory"
,
"cores_left"
,
"memory_left"
"Resource Group"
,
[
rg
],
"id"
,
"label"
,
"namespace_id"
,
"available_cores"
,
"available_memory"
,
"cores_left"
,
"memory_left"
)
)
...
@@ -49,7 +49,7 @@ async def ls_rg(rg_id: int):
...
@@ -49,7 +49,7 @@ async def ls_rg(rg_id: int):
"""List a resource group."""
"""List a resource group."""
rg
=
await
client_provider
.
resource_group_client
.
get_rg
(
rg_id
=
rg_id
)
rg
=
await
client_provider
.
resource_group_client
.
get_rg
(
rg_id
=
rg_id
)
print_table_generic
(
print_table_generic
(
"Resource Group"
,
[
rg
],
"id"
,
"label"
,
"available_cores"
,
"available_memory"
,
"cores_left"
,
"memory_left"
"Resource Group"
,
[
rg
],
"id"
,
"label"
,
"namespace_id"
,
"available_cores"
,
"available_memory"
,
"cores_left"
,
"memory_left"
)
)
...
@@ -59,5 +59,5 @@ async def ls():
...
@@ -59,5 +59,5 @@ async def ls():
"""List available resource groups."""
"""List available resource groups."""
rgs
=
await
client_provider
.
resource_group_client
.
filter_get_rg
()
rgs
=
await
client_provider
.
resource_group_client
.
filter_get_rg
()
print_table_generic
(
print_table_generic
(
"Resource Group"
,
rgs
,
"id"
,
"label"
,
"available_cores"
,
"available_memory"
,
"cores_left"
,
"memory_left"
"Resource Group"
,
rgs
,
"id"
,
"label"
,
"namespace_id"
,
"available_cores"
,
"available_memory"
,
"cores_left"
,
"memory_left"
)
)
symphony/cli/simbricks/cli/commands/runs.py
View file @
a4f0b9e3
...
@@ -28,7 +28,7 @@ from typer import Typer, Argument, Option
...
@@ -28,7 +28,7 @@ from typer import Typer, Argument, Option
from
typing_extensions
import
Annotated
from
typing_extensions
import
Annotated
from
simbricks.client.provider
import
client_provider
from
simbricks.client.provider
import
client_provider
from
simbricks.client.opus
import
base
as
opus_base
from
simbricks.client.opus
import
base
as
opus_base
from
..utils
import
async_cli
from
..utils
import
async_cli
,
print_table_generic
from
rich.console
import
Console
from
rich.console
import
Console
from
rich.table
import
Table
from
rich.table
import
Table
...
@@ -41,16 +41,7 @@ app = Typer(help="Managing SimBricks runs.")
...
@@ -41,16 +41,7 @@ app = Typer(help="Managing SimBricks runs.")
async
def
ls
():
async
def
ls
():
"""List runs."""
"""List runs."""
runs
=
await
client_provider
.
simbricks_client
.
get_runs
()
runs
=
await
client_provider
.
simbricks_client
.
get_runs
()
print_table_generic
(
"Runs"
,
runs
,
"id"
,
"instantiation_id"
,
"state"
)
table
=
Table
()
table
.
add_column
(
"Id"
)
table
.
add_column
(
"Instantiation"
)
table
.
add_column
(
"State"
)
for
r
in
runs
:
table
.
add_row
(
str
(
r
[
"id"
]),
str
(
r
[
"instantiation_id"
]),
r
[
"state"
])
console
=
Console
()
console
.
print
(
table
)
@
app
.
command
()
@
app
.
command
()
...
@@ -58,7 +49,7 @@ async def ls():
...
@@ -58,7 +49,7 @@ async def ls():
async
def
show
(
run_id
:
int
):
async
def
show
(
run_id
:
int
):
"""Show individual run."""
"""Show individual run."""
run
=
await
client_provider
.
simbricks_client
.
get_run
(
run_id
)
run
=
await
client_provider
.
simbricks_client
.
get_run
(
run_id
)
print
(
run
)
print
_table_generic
(
"Run"
,
[
run
],
"id"
,
"instantiation_id"
,
"state"
)
@
app
.
command
()
@
app
.
command
()
...
@@ -138,6 +129,8 @@ async def submit_script(
...
@@ -138,6 +129,8 @@ async def submit_script(
sb_inst
=
instantiations
[
0
]
sb_inst
=
instantiations
[
0
]
run_id
=
await
opus_base
.
create_run
(
instantiation
=
sb_inst
)
run_id
=
await
opus_base
.
create_run
(
instantiation
=
sb_inst
)
run
=
await
client_provider
.
simbricks_client
.
get_run
(
run_id
=
run_id
)
print_table_generic
(
"Run"
,
[
run
],
"id"
,
"instantiation_id"
,
"state"
)
if
input
:
if
input
:
await
system_client
.
set_run_input
(
run_id
,
input
)
await
system_client
.
set_run_input
(
run_id
,
input
)
...
...
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