Conversation
- Add three-level capability hierarchy (Provider, Instance Type, Instance) - Explain provider-level capabilities declared in GetCapabilities() - Document instance type capabilities as hardware-specific boolean fields - Describe instance capabilities as runtime state-dependent features - Add section on instance type mapping complexity - Reference Lambda Labs examples for implementation guidance Co-Authored-By: Alec Fong <alecsanf@usc.edu>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
docs/how-to-add-a-provider.md
Outdated
| - `Preemptible`: Whether this instance type supports spot/preemptible pricing | ||
|
|
||
| ### 3. Instance Capabilities | ||
| These are runtime state-dependent features for individual running instances. For example, a running instance might support certain operations that a stopped instance cannot, or vice versa. These are typically checked dynamically based on the instance's current `LifecycleStatus`. |
There was a problem hiding this comment.
Instance capabilities are very similar to Instance Type capabilities but for a running instance vs type (template)
docs/how-to-add-a-provider.md
Outdated
| ### 3. Instance Capabilities | ||
| These are runtime state-dependent features for individual running instances. For example, a running instance might support certain operations that a stopped instance cannot, or vice versa. These are typically checked dynamically based on the instance's current `LifecycleStatus`. | ||
|
|
||
| ### Instance Type Mapping Complexity |
There was a problem hiding this comment.
lets remove this section for now on instance type comlexity
- Remove entire 'Instance Type Mapping Complexity' section as requested - Clarify that Instance capabilities are similar to Instance Type capabilities but for running instances vs type templates - Keep focus on the three-level capability hierarchy Co-Authored-By: Alec Fong <alecsanf@usc.edu>
docs/how-to-add-a-provider.md
Outdated
| - Handle availability and regional variations consistently | ||
|
|
||
| See `convertLambdaLabsInstanceTypeToV1InstanceType()` in ../internal/lambdalabs/v1/instancetype.go for a complete example of this complex mapping process. | ||
| These are runtime state-dependent features for individual running instances, similar to Instance Type capabilities but applied to a running instance rather than the type template. For example, a running instance might support certain operations that a stopped instance cannot, or vice versa. These are typically checked dynamically based on the instance's current `LifecycleStatus`. |
There was a problem hiding this comment.
technically true that they can be changed based on state (they are note, good thing to note). however what I'm referring to is some booleans like (stoppable) are replicated on the instance even though you can figure it out through the instance type thats correlated with it. Its redundant but important to remember they need to be accurate none the less. Take a look at the instance
- Explain that Instance capabilities are boolean fields duplicated from InstanceType for performance/convenience - Note that while they appear redundant, they must be kept accurate and in sync - Mention they can reflect runtime state-dependent variations - Address PR feedback about the redundant but important nature of these fields Co-Authored-By: Alec Fong <alecsanf@usc.edu>
docs/how-to-add-a-provider.md
Outdated
| These are capability boolean fields replicated on individual `Instance` objects, similar to Instance Type capabilities but applied to the running instance rather than the type template. While these fields could theoretically be derived from the associated `InstanceType`, they are duplicated on the instance for performance and convenience reasons. Examples include: | ||
| - `Stoppable`: Whether this specific instance can be stopped/started | ||
| - `Rebootable`: Whether this specific instance can be rebooted | ||
| - `IsContainer`: Whether this instance runs in container mode |
There was a problem hiding this comment.
lets remove IsContainer this because I dont want to highlight container capabilities.
- Address PR feedback from @theFong to not highlight container capabilities - Keep Stoppable and Rebootable examples which are more relevant - Maintain documentation clarity and flow Co-Authored-By: Alec Fong <alecsanf@usc.edu>
Update provider capabilities documentation with three-level hierarchy
Summary
Enhanced the "How to Add a Cloud Provider" documentation to clarify the three distinct levels of capabilities in the SDK and explain the complexity of instance type mapping. This addresses feedback that the capability system needed better explanation for new provider implementers.
Key changes:
GetCapabilities()InstanceTypeReview & Testing Checklist for Human
pkg/v1/capabilities.go,pkg/v1/instancetype.go, andinternal/lambdalabs/v1/capabilities.goconvertLambdaLabsInstanceTypeToV1InstanceType()ininternal/lambdalabs/v1/instancetype.goactually demonstrates the mapping complexity I describedDiagram
%%{ init : { "theme" : "default" }}%% graph TD HowToDoc["docs/how-to-add-a-provider.md"]:::major-edit --> CapabilitiesCore["pkg/v1/capabilities.go"]:::context HowToDoc --> InstanceTypeCore["pkg/v1/instancetype.go"]:::context HowToDoc --> LambdaCaps["internal/lambdalabs/v1/capabilities.go"]:::context HowToDoc --> LambdaInstanceType["internal/lambdalabs/v1/instancetype.go"]:::context CapabilitiesCore -.->|"Provider-level<br/>capabilities"| LambdaCaps InstanceTypeCore -.->|"Instance type<br/>capabilities"| LambdaInstanceType LambdaInstanceType -.->|"Mapping complexity<br/>example"| HowToDoc subgraph Legend L1[Major Edit]:::major-edit L2[Minor Edit]:::minor-edit L3[Context/No Edit]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#F5F5F5Notes
This change was requested to improve clarity around the capability system after feedback that instance type mapping is "one of the trickier things" in provider implementation. The documentation now provides concrete guidance and examples for each capability level.
Link to Devin run: https://app.devin.ai/sessions/a811ba02cf8c45338aa1f6c1c8d6252e
Requested by: @theFong