BRE2-1083: Hyperstack cloud provider - #159
Conversation
|
|
||
| const ( | ||
| CloudProviderID = "hyperstack" | ||
| DefaultAPIURL = "https://infrahub-api.nexgencloud.com/v1" |
There was a problem hiding this comment.
just confirming it's nexgencloud and not nexTgencloud
There was a problem hiding this comment.
Clearly you're not thinking like a nexgencloud
| 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") |
There was a problem hiding this comment.
is this important? should make the string a constant?
| } | ||
|
|
||
| func (c *HyperstackClient) listFlavors(ctx context.Context) ([]flavor.FlavorItemGetResponse, error) { | ||
| response, err := c.flavors.ListFlavorsWithResponse(ctx, nil) |
| Memory: memory, | ||
| MemoryBytes: memoryBytes, | ||
| VCPU: int32(intValue(providerType.Cpu)), //nolint:gosec // ok | ||
| SupportedArchitectures: []v1.Architecture{v1.ArchitectureX86_64}, |
There was a problem hiding this comment.
they don't offer arm64?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
do we need to clear the label on stop, otherwise a start will release immediately?
There was a problem hiding this comment.
I didn't see the same issues on start -- releasing once the API reported success was just fine.
For the most part this is pretty standard, with the exception of
readiness.go😭