cache

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssumedGPUPod

type AssumedGPUPod struct {
	AllocatedCount int32
	AddedAt        time.Time
}

AssumedGPUPod represents an assumed GPU pod.

type Cluster

type Cluster struct {
	ClusterID   string
	ClusterName string
	UpdatedAt   time.Time

	GPUNodes               []*v1.GpuNode
	ProvisionableResources []*v1.ProvisionableResource

	GPUPods []*v1.GpuPod
	// AssumedGPUPodsByKey is a map from key to the assumed GPU pods on the node.
	// This pod is bound to the cluster by scheduler, but not yet created.
	// The key is the prefix of the pod.
	AssumedGPUPodsByKey map[string]*AssumedGPUPod
}

Cluster represents a cluster.

func (*Cluster) Clone

func (c *Cluster) Clone() *Cluster

Clone returns a deep copy of the cluster.

type Clusters

type Clusters map[string]*Cluster

Clusters is a map from cluster ID to clusters.

func (*Clusters) Clone

func (c *Clusters) Clone() Clusters

Clone returns a deep copy of the clusters.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a cache store.

func NewStore

func NewStore(store *store.S, log logr.Logger) *Store

NewStore creates a new cache store.

func (*Store) AddAssumedPod

func (c *Store) AddAssumedPod(tenantID, clusterID, key string, gpuCount int) error

AddAssumedPod adds an assumed pod to the cache. If the tenant is not found in the cache, it fetches them from the store.

func (*Store) AddOrUpdateCluster

func (c *Store) AddOrUpdateCluster(cluster *store.Cluster) error

AddOrUpdateCluster adds or updates a cluster. If the tenant is not found in the cache, it fetches them from the store.

func (*Store) ListClustersByTenantID

func (c *Store) ListClustersByTenantID(tenantID string) (map[string]*Cluster, error)

ListClustersByTenantID lists clusters by tenant ID. If the tenant is not found in the cache, it fetches them from the store.

Jump to

Keyboard shortcuts

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