domain

package
v0.251.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
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

func CheckHourlyCap(gpuType string, price, maxHourly float64) error

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.

const (
	CloudCommunity Cloud = "COMMUNITY"
	CloudSecure    Cloud = "SECURE"
)

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.

func (GPUInstance) Uptime

func (i GPUInstance) Uptime(now time.Time) time.Duration

Uptime is how long a running instance has been up at now, zero when it is not running or its start time is unknown.

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

func (t GPUType) HourlyPrice() (float64, Cloud)

HourlyPrice is what an hour of the GPU costs and on which cloud: community when it is offered there, else secure.

func (GPUType) Rentable

func (t GPUType) Rentable() bool

Rentable reports whether any cloud offers the GPU at a price.

type ProvisionRequest

type ProvisionRequest struct {
	Name      string
	GPUTypeID string
	Image     string
	StartCmd  []string
	Cloud     Cloud
	DiskGB    int
	Env       map[string]string
	Ports     []string
}

ProvisionRequest is the GPU instance to rent and what it runs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL