Implement FluidStack provider with OpenAPI client generation#13
Merged
Implement FluidStack provider with OpenAPI client generation#13
Conversation
- Add Makefile for FluidStack OpenAPI client generation following Lambda Labs pattern - Generate Go client from FluidStack API specification at https://docs.atlas.fluidstack.io/redocusaurus/infrastructure-api.yaml - Implement all required instance management methods: - CreateInstance using InstancesPostRequest - GetInstance, TerminateInstance, ListInstances - RebootInstance via stop/start sequence - Add Bearer token authentication via makeAuthContext - Handle project scoping via X-PROJECT-ID header - Add type conversions from FluidStack API types to SDK v1 types - Fix naming conflicts in generated constants (PROJECT_*, INSTANCE_*) - Support GPU instance types with proper memory and count handling Co-Authored-By: Alec Fong <alecsanf@usc.edu>
Contributor
Author
🤖 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:
|
- Update incorrect import from 'github.com/brevdev/cloud' to correct path - Follow Lambda Labs pattern for generated client imports - Resolves go mod tidy failure in CI Co-Authored-By: Alec Fong <alecsanf@usc.edu>
- Fix assignment mismatch for DeleteInstance, StartInstance, StopInstance (2-value returns) - Add HTTP response body closure to all API calls with proper error handling - Use underscore for unused parameters to satisfy revive linter - Fix function signature to not return unnecessary error - Resolve integer overflow, formatting, and errcheck issues Co-Authored-By: Alec Fong <alecsanf@usc.edu>
theFong
requested changes
Aug 6, 2025
internal/fluidstack/v1/instance.go
Outdated
| } | ||
|
|
||
| func (c *FluidStackClient) RebootInstance(_ context.Context, _ v1.CloudProviderInstanceID) error { | ||
| return v1.ErrNotImplemented | ||
| func (c *FluidStackClient) RebootInstance(ctx context.Context, instanceID v1.CloudProviderInstanceID) error { |
Member
There was a problem hiding this comment.
if there is not reboot api call lets remove this and remove the capability
- Add v1.CapabilityInstanceUserData to capabilities since FluidStack API supports UserData - Replace RebootInstance implementation with ErrNotImplemented since FluidStack has no native reboot API - Remove unused time import from instance.go - Align capabilities with actual FluidStack API features per @theFong feedback Co-Authored-By: Alec Fong <alecsanf@usc.edu>
theFong
approved these changes
Aug 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement FluidStack provider with OpenAPI client generation
Summary
This PR implements the FluidStack cloud provider following the established Lambda Labs pattern. Key components include:
makeAuthContextmethodThe implementation generates the OpenAPI client from
https://docs.atlas.fluidstack.io/redocusaurus/infrastructure-api.yamlusing openapi-generator-cli v7.8.0, following the exact pattern used for Lambda Labs.Review & Testing Checklist for Human
🔴 High Risk - Requires Manual Testing
Recommended test plan:
Diagram
%%{ init : { "theme" : "default" }}%% graph TD Makefile["internal/fluidstack/Makefile<br/>OpenAPI Client Generation"]:::major-edit Client["internal/fluidstack/v1/client.go<br/>FluidStackClient + Auth"]:::major-edit Instance["internal/fluidstack/v1/instance.go<br/>Instance Operations"]:::major-edit InstanceType["internal/fluidstack/v1/instancetype.go<br/>Instance Types + Locations"]:::major-edit Generated["internal/fluidstack/gen/fluidstack/<br/>Generated OpenAPI Client"]:::major-edit V1Client["pkg/v1/client.go<br/>CloudClient Interface"]:::context V1Instance["pkg/v1/instance.go<br/>Instance Types"]:::context V1InstanceType["pkg/v1/instancetype.go<br/>InstanceType Types"]:::context Makefile -->|generates| Generated Client -->|uses| Generated Instance -->|uses| Generated InstanceType -->|uses| Generated Client -.->|implements| V1Client Instance -.->|converts to| V1Instance InstanceType -.->|converts to| V1InstanceType 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:#FFFFFFNotes
DELETINGconstant conflicts betweenProjectStateandInstanceStateenumsSession Details: