Commit c3e26a6
committed
lambdalabs: add region-aware instance filtering in Kconfig
When using manual region selection for Lambda Labs, the instance type
menu would show all instances regardless of whether they were available
in the selected region. This led to a poor user experience where users
could select incompatible region/instance combinations that would fail
during provisioning.
This change adds intelligent Kconfig dependencies to filter instance
types based on the selected region:
1. Available instance types now include a 'depends on' clause that
makes them visible only when:
- Using automatic region selection modes (smart cheapest or smart
infer), OR
- Using manual region selection AND the instance is available in
the selected region
2. Unavailable instance types (those with no capacity) are now
completely hidden when using manual region selection, preventing
accidental selection of instances that will always fail
For example, gpu_1x_a10 which is only available in us-east-1 and
us-west-1 now has:
depends on !TERRAFORM_LAMBDALABS_REGION_MANUAL || \
(TERRAFORM_LAMBDALABS_REGION_US_EAST_1 || \
TERRAFORM_LAMBDALABS_REGION_US_WEST_1)
This ensures users see only valid options for their selected region,
significantly improving the configuration experience and preventing
provisioning failures due to region/instance mismatches.
The dependencies are dynamically generated based on real-time Lambda
Labs API data, ensuring the constraints stay current with actual
availability.
Also includes a minor whitespace fix in declared-hosts.j2.
Generated-by: Claude AI
Signed-off-by: Luis Chamberlain <[email protected]>1 parent 119b067 commit c3e26a6
1 file changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
282 | 298 | | |
283 | 299 | | |
284 | 300 | | |
| |||
301 | 317 | | |
302 | 318 | | |
303 | 319 | | |
| 320 | + | |
| 321 | + | |
304 | 322 | | |
305 | 323 | | |
306 | 324 | | |
| |||
0 commit comments