diff --git a/deployer/commands/generate/resource_allocation/__init__.py b/deployer/commands/generate/resource_allocation/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/deployer/commands/generate/resource_allocation/generate_choices.py b/deployer/commands/generate/resource_allocation/generate_choices.py index ab70aca912..08ae9f5191 100644 --- a/deployer/commands/generate/resource_allocation/generate_choices.py +++ b/deployer/commands/generate/resource_allocation/generate_choices.py @@ -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") @@ -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" ), diff --git a/deployer/commands/generate/resource_allocation/resource_allocation_app.py b/deployer/commands/generate/resource_allocation/resource_allocation_app.py new file mode 100644 index 0000000000..dd5c2555b0 --- /dev/null +++ b/deployer/commands/generate/resource_allocation/resource_allocation_app.py @@ -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", +) diff --git a/deployer/commands/generate/resource_allocation/update_nodeinfo.py b/deployer/commands/generate/resource_allocation/update_nodeinfo.py index 428d703277..c7dd0bf265 100644 --- a/deployer/commands/generate/resource_allocation/update_nodeinfo.py +++ b/deployer/commands/generate/resource_allocation/update_nodeinfo.py @@ -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 @@ -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" ),