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
a4a71d8e
Unverified
Commit
a4a71d8e
authored
Jan 17, 2025
by
Jakob Görgen
Browse files
symphony/cli: simplified i.e. shortened various commands
parent
418125d0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
symphony/cli/simbricks/cli/__main__.py
symphony/cli/simbricks/cli/__main__.py
+2
-2
symphony/cli/simbricks/cli/commands/namespaces.py
symphony/cli/simbricks/cli/commands/namespaces.py
+2
-2
symphony/cli/simbricks/cli/commands/rg.py
symphony/cli/simbricks/cli/commands/rg.py
+0
-0
symphony/cli/simbricks/cli/commands/runners.py
symphony/cli/simbricks/cli/commands/runners.py
+3
-3
symphony/cli/simbricks/cli/commands/runs.py
symphony/cli/simbricks/cli/commands/runs.py
+6
-6
No files found.
symphony/cli/simbricks/cli/__main__.py
View file @
a4a71d8e
...
...
@@ -26,7 +26,7 @@ from simbricks.cli.commands import (
audit
,
admin
,
namespaces
,
r
esource_groups
,
r
g
,
runs
,
systems
,
simulations
,
...
...
@@ -45,7 +45,7 @@ app.add_typer(systems.app, name="systems")
app
.
add_typer
(
simulations
.
app
,
name
=
"sims"
)
app
.
add_typer
(
instantiations
.
app
,
name
=
"insts"
)
app
.
add_typer
(
runners
.
app
,
name
=
"runners"
)
app
.
add_typer
(
r
esource_groups
.
app
,
name
=
"resource_groups
"
)
app
.
add_typer
(
r
g
.
app
,
name
=
"rg
"
)
@
app
.
callback
()
...
...
symphony/cli/simbricks/cli/commands/namespaces.py
View file @
a4a71d8e
...
...
@@ -39,7 +39,7 @@ async def ls():
@
app
.
command
()
@
async_cli
()
async
def
ls_id
(
ident
:
int
):
async
def
show
(
ident
:
int
):
"""List namespace with given id ident."""
client
=
client_provider
.
ns_client
...
...
@@ -49,7 +49,7 @@ async def ls_id(ident: int):
@
app
.
command
()
@
async_cli
()
async
def
ls_
cur
():
async
def
cur
():
"""List current namespace."""
client
=
client_provider
.
ns_client
...
...
symphony/cli/simbricks/cli/commands/r
esource_groups
.py
→
symphony/cli/simbricks/cli/commands/r
g
.py
View file @
a4a71d8e
File moved
symphony/cli/simbricks/cli/commands/runners.py
View file @
a4a71d8e
...
...
@@ -36,7 +36,7 @@ app = Typer(
async
def
ls
():
"""List runners."""
runners
=
await
client_provider
.
runner_client
.
list_runners
()
print_table_generic
(
"Runners"
,
runners
,
"id"
,
"label"
,
"tags"
,
"resource_group_id"
)
print_table_generic
(
"Runners"
,
runners
,
"id"
,
"label"
,
"tags"
,
"namespace_id"
,
"resource_group_id"
)
@
app
.
command
()
...
...
@@ -44,7 +44,7 @@ async def ls():
async
def
show
(
runner_id
:
int
):
"""Show individual runner."""
runner
=
await
client_provider
.
runner_client
.
get_runner
(
runner_id
=
runner_id
)
print_table_generic
(
"Runners"
,
[
runner
],
"id"
,
"label"
,
"tags"
,
"resource_group_id"
)
print_table_generic
(
"Runners"
,
[
runner
],
"id"
,
"label"
,
"tags"
,
"namespace_id"
,
"resource_group_id"
)
@
app
.
command
()
...
...
@@ -61,7 +61,7 @@ async def create(resource_group_id: int, label: str, tags: list[str]):
runner
=
await
client_provider
.
runner_client
.
create_runner
(
resource_group_id
=
resource_group_id
,
label
=
label
,
tags
=
tags
)
print_table_generic
(
"Runner"
,
[
runner
],
"id"
,
"label"
,
"tags"
,
"resource_group_id"
)
print_table_generic
(
"Runner"
,
[
runner
],
"id"
,
"label"
,
"tags"
,
"namespace_id"
,
"resource_group_id"
)
@
app
.
command
()
...
...
symphony/cli/simbricks/cli/commands/runs.py
View file @
a4a71d8e
...
...
@@ -61,7 +61,7 @@ async def follow(run_id: int):
@
app
.
command
()
@
async_cli
()
async
def
run_con
sole
(
run_id
:
int
):
async
def
run_con
(
run_id
:
int
):
"""Print a runs console completely."""
console
=
rich
.
console
.
Console
()
output
=
await
client_provider
.
simbricks_client
.
get_run_console
(
rid
=
run_id
)
...
...
@@ -80,7 +80,7 @@ async def delete(run_id: int):
@
app
.
command
()
@
async_cli
()
async
def
set_in
put
_tar
ball
(
run_id
:
int
,
source_file
:
str
):
async
def
set_in_tar
(
run_id
:
int
,
source_file
:
str
):
"""Set the tarball input for an individual run."""
client
=
client_provider
.
simbricks_client
await
client
.
set_run_input
(
run_id
,
source_file
)
...
...
@@ -88,7 +88,7 @@ async def set_input_tarball(run_id: int, source_file: str):
@
app
.
command
()
@
async_cli
()
async
def
set_
output_artifac
t
(
run_id
:
int
,
source_file
:
str
):
async
def
set_
ar
t
(
run_id
:
int
,
source_file
:
str
):
"""Set the tarball input for an individual run."""
client
=
client_provider
.
simbricks_client
await
client
.
set_run_artifact
(
run_id
,
source_file
)
...
...
@@ -96,7 +96,7 @@ async def set_output_artifact(run_id: int, source_file: str):
@
app
.
command
()
@
async_cli
()
async
def
get_
output_artifac
t
(
run_id
:
int
,
destination_file
:
str
):
async
def
get_
ar
t
(
run_id
:
int
,
destination_file
:
str
):
"""Follow individual run as it executes."""
client
=
client_provider
.
simbricks_client
await
client
.
get_run_artifact
(
run_id
,
destination_file
)
...
...
@@ -104,7 +104,7 @@ async def get_output_artifact(run_id: int, destination_file: str):
@
app
.
command
()
@
async_cli
()
async
def
update
_run
(
run_id
:
int
,
updates
:
str
):
async
def
update
(
run_id
:
int
,
updates
:
str
):
"""Update run with the 'updates' json string."""
client
=
client_provider
.
simbricks_client
json_updates
=
json
.
loads
(
updates
)
...
...
@@ -113,7 +113,7 @@ async def update_run(run_id: int, updates: str):
@
app
.
command
()
@
async_cli
()
async
def
submit
_script
(
async
def
submit
(
path
:
Annotated
[
Path
,
Argument
(
help
=
"Python simulation script to submit."
)],
follow
:
Annotated
[
bool
,
Option
(
"--follow"
,
"-f"
,
help
=
"Wait for run to terminate and show output live."
)]
=
False
,
input
:
Annotated
[
...
...
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