Documentation
¶
Index ¶
Constants ¶
const InstanceNamePrefix = "infer-"
InstanceNamePrefix marks every GPU instance infer rents, so a listing shows infer's instances and never the rest of the account.
Variables ¶
This section is empty.
Functions ¶
func CheckHourlyCap ¶
CheckHourlyCap refuses a GPU whose hourly price is above the cap, so a rental never costs more than the user allowed. A zero cap allows any price.
Types ¶
type Cloud ¶
type Cloud string
Cloud is where a provider rents a GPU from: a community host or its own secure data centres.
type ClusterStatus ¶
type ClusterStatus struct {
Name string
Namespace string
Reachable bool
Error string
KubernetesVersion string
Sessions int
}
ClusterStatus is what a check of one cluster found: whether it is reachable and runs the operator, its Kubernetes version, and how many sessions run on it across every workspace that names it.
type GPUInstance ¶
type GPUInstance struct {
ID string
Name string
Image string
Status string
HourlyCost float64
StartedAt string
}
GPUInstance is one rented GPU, billed by the hour while it runs.
func (GPUInstance) Running ¶
func (i GPUInstance) Running() bool
Running reports whether the provider has started the instance.
func (GPUInstance) SpentSoFar ¶
func (i GPUInstance) SpentSoFar(now time.Time) float64
SpentSoFar is what the instance has cost at now since it last started.
type GPUType ¶
type GPUType struct {
ID string
DisplayName string
MemoryGB int
CommunityPrice float64
SecurePrice float64
}
GPUType is a GPU a provider rents, with its live hourly prices on each cloud. A zero price means the cloud does not offer it.
func (GPUType) HourlyPrice ¶
HourlyPrice is what an hour of the GPU costs and on which cloud: community when it is offered there, else secure.