Skip to content

Commit ec156ad

Browse files
authored
[App] Remove --instance-types from cluster creation (#15314)
## What does this PR do? Removes the ability to specify `--instance-types` when creating clusters. Instead, all clusters will be able to use every instance type supported by the platform.
1 parent 3e5e507 commit ec156ad

File tree

5 files changed

+5
-26
lines changed

5 files changed

+5
-26
lines changed

src/lightning_app/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3131
### Changed
3232

3333
- Improved the show logs command to be standalone and re-usable ([#15343](https://github.com/Lightning-AI/lightning/pull/15343)
34+
- Removed the `--instance-types` option when creating clusters ([#15314](https://github.com/Lightning-AI/lightning/pull/15314))
3435

3536
### Fixed
3637

src/lightning_app/cli/cmd_clusters.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
V1ClusterState,
1616
V1ClusterType,
1717
V1CreateClusterRequest,
18-
V1InstanceSpec,
1918
V1KubernetesClusterDriver,
2019
)
2120
from rich.console import Console
@@ -86,7 +85,6 @@ def create(
8685
role_arn: str = None,
8786
region: str = "us-east-1",
8887
external_id: str = None,
89-
instance_types: List[str] = [],
9088
edit_before_creation: bool = False,
9189
wait: bool = False,
9290
) -> None:
@@ -98,7 +96,6 @@ def create(
9896
role_arn: AWS IAM Role ARN used to provision resources
9997
region: AWS region containing compute resources
10098
external_id: AWS IAM Role external ID
101-
instance_types: AWS instance types supported by the cluster
10299
edit_before_creation: Enables interactive editing of requests before submitting it to Lightning AI.
103100
wait: Waits for the cluster to be in a RUNNING state. Only use this for debugging.
104101
"""
@@ -119,7 +116,6 @@ def create(
119116
region=region,
120117
role_arn=role_arn,
121118
external_id=external_id,
122-
instance_types=[V1InstanceSpec(name=x) for x in instance_types],
123119
)
124120
)
125121
),

src/lightning_app/cli/lightning_cli_create.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ def create() -> None:
2727
help="AWS region that is used to host the associated resources.",
2828
hidden=True,
2929
)
30-
@click.option(
31-
"--instance-types",
32-
"instance_types",
33-
type=str,
34-
required=False,
35-
default=None,
36-
help="Instance types that you want to support, for computer jobs within the cluster.",
37-
)
3830
@click.option(
3931
"--enable-performance",
4032
"enable_performance",
@@ -66,7 +58,6 @@ def create_cluster(
6658
role_arn: str,
6759
external_id: str,
6860
provider: str,
69-
instance_types: str,
7061
edit_before_creation: bool,
7162
enable_performance: bool,
7263
wait: bool,
@@ -82,7 +73,6 @@ def create_cluster(
8273
region=region,
8374
role_arn=role_arn,
8475
external_id=external_id,
85-
instance_types=instance_types.split(",") if instance_types is not None else [],
8676
edit_before_creation=edit_before_creation,
8777
cost_savings=not enable_performance,
8878
wait=wait,

tests/tests_app/cli/test_cli.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,13 @@ def test_main_lightning_cli_help():
9999
@mock.patch("lightning_cloud.login.Auth.authenticate", MagicMock())
100100
@mock.patch("lightning_app.cli.cmd_clusters.AWSClusterManager.create")
101101
@pytest.mark.parametrize(
102-
"extra_arguments,expected_instance_types,expected_cost_savings_mode",
102+
"extra_arguments,expected_cost_savings_mode",
103103
[
104-
(["--instance-types", "t3.xlarge"], ["t3.xlarge"], True),
105-
(["--instance-types", "t3.xlarge,t3.2xlarge"], ["t3.xlarge", "t3.2xlarge"], True),
106-
([], [], True),
107-
(["--enable-performance"], [], False),
104+
([], True),
105+
(["--enable-performance"], False),
108106
],
109107
)
110-
def test_create_cluster(
111-
create_command: mock.MagicMock, extra_arguments, expected_instance_types, expected_cost_savings_mode
112-
):
108+
def test_create_cluster(create_command: mock.MagicMock, extra_arguments, expected_cost_savings_mode):
113109
runner = CliRunner()
114110
runner.invoke(
115111
create_cluster,
@@ -130,7 +126,6 @@ def test_create_cluster(
130126
region="us-east-1",
131127
role_arn="arn:aws:iam::1234567890:role/lai-byoc",
132128
external_id="dummy",
133-
instance_types=expected_instance_types,
134129
edit_before_creation=False,
135130
cost_savings=expected_cost_savings_mode,
136131
wait=False,

tests/tests_app/cli/test_cmd_clusters.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
V1ClusterStatus,
1414
V1ClusterType,
1515
V1CreateClusterRequest,
16-
V1InstanceSpec,
1716
V1KubernetesClusterDriver,
1817
V1ListClustersResponse,
1918
)
@@ -43,7 +42,6 @@ def test_create_cluster(api: mock.MagicMock):
4342
cluster_name="test-7",
4443
external_id="dummy",
4544
role_arn="arn:aws:iam::1234567890:role/lai-byoc",
46-
instance_types=["t2.small"],
4745
region="us-west-2",
4846
)
4947

@@ -59,7 +57,6 @@ def test_create_cluster(api: mock.MagicMock):
5957
region="us-west-2",
6058
role_arn="arn:aws:iam::1234567890:role/lai-byoc",
6159
external_id="dummy",
62-
instance_types=[V1InstanceSpec(name="t2.small")],
6360
)
6461
)
6562
),

0 commit comments

Comments
 (0)