Skip to content

BRE2-1083: Hyperstack cloud provider - #159

Merged
drewmalin merged 24 commits into
mainfrom
dm/BRE2-1083/hyperstack
Sep 23, 2026
Merged

drewmalin merged 24 commits into
mainfrom
dm/BRE2-1083/hyperstack

Conversation

@drewmalin

@drewmalin drewmalin commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

For the most part this is pretty standard, with the exception of readiness.go 😭

@drewmalin drewmalin changed the title Dm/bre2 1083/hyperstack BRE2-1083: Hyperstack cloud provider Sep 22, 2026
@drewmalin
drewmalin marked this pull request as ready for review September 22, 2026 19:17
@drewmalin
drewmalin requested a review from a team as a code owner September 22, 2026 19:17

const (
CloudProviderID = "hyperstack"
DefaultAPIURL = "https://infrahub-api.nexgencloud.com/v1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just confirming it's nexgencloud and not nexTgencloud

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearly you're not thinking like a nexgencloud

Comment thread v1/providers/hyperstack/client.go Outdated
func (d *authenticatedDoer) Do(request *http.Request) (*http.Response, error) {
request = request.Clone(request.Context())
request.Header.Set("api_key", d.apiKey)
request.Header.Set("User-Agent", "brev-cloud")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this important? should make the string a constant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

}

func (c *HyperstackClient) listFlavors(ctx context.Context) ([]flavor.FlavorItemGetResponse, error) {
response, err := c.flavors.ListFlavorsWithResponse(ctx, nil)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no paging necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None offered :(

Comment thread v1/providers/hyperstack/instancetype.go Outdated
Memory: memory,
MemoryBytes: memoryBytes,
VCPU: int32(intValue(providerType.Cpu)), //nolint:gosec // ok
SupportedArchitectures: []v1.Architecture{v1.ArchitectureX86_64},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they don't offer arm64?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They don't have a field but I asked -- in the meantime I'll do a check here that is similar to the shadeform check (basically if the GPU name includes a G).

consoleLogPolls = 5
consoleLogPollPeriod = 500 * time.Millisecond
readinessLabel = "brev-cloud-ready"
readinessCloudConfig = `#cloud-config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is yaml? could we commit it as a .yaml file and use embed?

readinessMarker = "BREV_CLOUD_READY_V1"
consoleLogLineCount = 200
consoleLogPolls = 5
consoleLogPollPeriod = 500 * time.Millisecond

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.5 seconds is enough time? (5 * 500ms) ? Do we run the risk of getting rate limited by many starts and then abandoning a bunch of intances?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sort of an inner poll, as technically we are in the implementation of the outer (devplane) poll. So we do want to take as little time as possible trying to answer the question of whether or not the instance is in the right state.

patelspratik
patelspratik previously approved these changes Sep 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to clear the label on stop, otherwise a start will release immediately?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see the same issues on start -- releasing once the API reported success was just fine.

@drewmalin
drewmalin merged commit fc8d636 into main Sep 23, 2026
4 checks passed
@drewmalin
drewmalin deleted the dm/BRE2-1083/hyperstack branch September 23, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants