Unverified Commit a4a71d8e authored by Jakob Görgen's avatar Jakob Görgen
Browse files

symphony/cli: simplified i.e. shortened various commands

parent 418125d0
...@@ -26,7 +26,7 @@ from simbricks.cli.commands import ( ...@@ -26,7 +26,7 @@ from simbricks.cli.commands import (
audit, audit,
admin, admin,
namespaces, namespaces,
resource_groups, rg,
runs, runs,
systems, systems,
simulations, simulations,
...@@ -45,7 +45,7 @@ app.add_typer(systems.app, name="systems") ...@@ -45,7 +45,7 @@ app.add_typer(systems.app, name="systems")
app.add_typer(simulations.app, name="sims") app.add_typer(simulations.app, name="sims")
app.add_typer(instantiations.app, name="insts") app.add_typer(instantiations.app, name="insts")
app.add_typer(runners.app, name="runners") app.add_typer(runners.app, name="runners")
app.add_typer(resource_groups.app, name="resource_groups") app.add_typer(rg.app, name="rg")
@app.callback() @app.callback()
......
...@@ -39,7 +39,7 @@ async def ls(): ...@@ -39,7 +39,7 @@ async def ls():
@app.command() @app.command()
@async_cli() @async_cli()
async def ls_id(ident: int): async def show(ident: int):
"""List namespace with given id ident.""" """List namespace with given id ident."""
client = client_provider.ns_client client = client_provider.ns_client
...@@ -49,7 +49,7 @@ async def ls_id(ident: int): ...@@ -49,7 +49,7 @@ async def ls_id(ident: int):
@app.command() @app.command()
@async_cli() @async_cli()
async def ls_cur(): async def cur():
"""List current namespace.""" """List current namespace."""
client = client_provider.ns_client client = client_provider.ns_client
......
...@@ -36,7 +36,7 @@ app = Typer( ...@@ -36,7 +36,7 @@ app = Typer(
async def ls(): async def ls():
"""List runners.""" """List runners."""
runners = await client_provider.runner_client.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() @app.command()
...@@ -44,7 +44,7 @@ async def ls(): ...@@ -44,7 +44,7 @@ async def ls():
async def show(runner_id: int): async def show(runner_id: int):
"""Show individual runner.""" """Show individual runner."""
runner = await client_provider.runner_client.get_runner(runner_id=runner_id) 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() @app.command()
...@@ -61,7 +61,7 @@ async def create(resource_group_id: int, label: str, tags: list[str]): ...@@ -61,7 +61,7 @@ async def create(resource_group_id: int, label: str, tags: list[str]):
runner = await client_provider.runner_client.create_runner( runner = await client_provider.runner_client.create_runner(
resource_group_id=resource_group_id, label=label, tags=tags 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() @app.command()
......
...@@ -61,7 +61,7 @@ async def follow(run_id: int): ...@@ -61,7 +61,7 @@ async def follow(run_id: int):
@app.command() @app.command()
@async_cli() @async_cli()
async def run_console(run_id: int): async def run_con(run_id: int):
"""Print a runs console completely.""" """Print a runs console completely."""
console = rich.console.Console() console = rich.console.Console()
output = await client_provider.simbricks_client.get_run_console(rid=run_id) output = await client_provider.simbricks_client.get_run_console(rid=run_id)
...@@ -80,7 +80,7 @@ async def delete(run_id: int): ...@@ -80,7 +80,7 @@ async def delete(run_id: int):
@app.command() @app.command()
@async_cli() @async_cli()
async def set_input_tarball(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.""" """Set the tarball input for an individual run."""
client = client_provider.simbricks_client client = client_provider.simbricks_client
await client.set_run_input(run_id, source_file) await client.set_run_input(run_id, source_file)
...@@ -88,7 +88,7 @@ async def set_input_tarball(run_id: int, source_file: str): ...@@ -88,7 +88,7 @@ async def set_input_tarball(run_id: int, source_file: str):
@app.command() @app.command()
@async_cli() @async_cli()
async def set_output_artifact(run_id: int, source_file: str): async def set_art(run_id: int, source_file: str):
"""Set the tarball input for an individual run.""" """Set the tarball input for an individual run."""
client = client_provider.simbricks_client client = client_provider.simbricks_client
await client.set_run_artifact(run_id, source_file) await client.set_run_artifact(run_id, source_file)
...@@ -96,7 +96,7 @@ async def set_output_artifact(run_id: int, source_file: str): ...@@ -96,7 +96,7 @@ async def set_output_artifact(run_id: int, source_file: str):
@app.command() @app.command()
@async_cli() @async_cli()
async def get_output_artifact(run_id: int, destination_file: str): async def get_art(run_id: int, destination_file: str):
"""Follow individual run as it executes.""" """Follow individual run as it executes."""
client = client_provider.simbricks_client client = client_provider.simbricks_client
await client.get_run_artifact(run_id, destination_file) await client.get_run_artifact(run_id, destination_file)
...@@ -104,7 +104,7 @@ async def get_output_artifact(run_id: int, destination_file: str): ...@@ -104,7 +104,7 @@ async def get_output_artifact(run_id: int, destination_file: str):
@app.command() @app.command()
@async_cli() @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.""" """Update run with the 'updates' json string."""
client = client_provider.simbricks_client client = client_provider.simbricks_client
json_updates = json.loads(updates) json_updates = json.loads(updates)
...@@ -113,7 +113,7 @@ async def update_run(run_id: int, updates: str): ...@@ -113,7 +113,7 @@ async def update_run(run_id: int, updates: str):
@app.command() @app.command()
@async_cli() @async_cli()
async def submit_script( async def submit(
path: Annotated[Path, Argument(help="Python simulation script to 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, follow: Annotated[bool, Option("--follow", "-f", help="Wait for run to terminate and show output live.")] = False,
input: Annotated[ input: Annotated[
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment