Skip to content

Commit

Permalink
Add new deployer.generate sub-command and nest everything there
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgianaElena committed Oct 27, 2023
1 parent 4c66acd commit 0d67971
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import typer
from ruamel.yaml import YAML

from deployer.cli_app import generate_app
from .resource_allocation_app import resource_allocation_app

yaml = YAML(typ="rt")

Expand Down Expand Up @@ -99,8 +99,8 @@ def proportional_memory_strategy(
return choices


@generate_app.command()
def resource_allocation_choices(
@resource_allocation_app.command()
def choices(
instance_type: str = typer.Argument(
..., help="Instance type to generate Resource Allocation options for"
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Creates a new typer application, which is then
nested as a sub-command named "resource-allocation"
under the `generate` sub-command of the deployer.
"""
import typer

from deployer.cli_app import generate_app

resource_allocation_app = typer.Typer(pretty_exceptions_show_locals=False)
generate_app.add_typer(
resource_allocation_app,
name="resource-allocation",
help="Generate the choices for a resource allocation strategy of an instance type and additional helper information",
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kubernetes.utils.quantity import parse_quantity
from ruamel.yaml import YAML

from deployer.cli_app import generate_app
from .resource_allocation_app import resource_allocation_app

HERE = Path(__file__).parent

Expand Down Expand Up @@ -133,8 +133,8 @@ def get_node_capacity_info(instance_type: str):
}


@generate_app.command()
def node_capacity_entry_in_info_json(
@resource_allocation_app.command()
def node_info_update(
instance_type: str = typer.Argument(
..., help="Instance type to generate Resource Allocation options for"
),
Expand Down

0 comments on commit 0d67971

Please sign in to comment.