Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteTap(name string)
- func GetExecEnvironmentCount(labels map[string]string) int
- func GetMaxReplicaCount(labels map[string]string) int
- func GetMinReplicaCount(labels map[string]string) int
- func PrepareReplicaRequest(labels map[string]string, envs map[string]string, image string) (*pb.CreateRequest, error)
- type Dir
- type ReplicaMeta
- type ServiceState
- type Tool
- type TryAgainError
- type VMSetup
- type VMSetupPool
Constants ¶
const ( // FirecrackerSockName is the name of the Firecracker VMM API socket FirecrackerSockName = "firecracker.sock" // FirecrackerLogFifoName is the name of the Firecracker VMM log FIFO FirecrackerLogFifoName = "fc-logs.fifo" // FirecrackerMetricsFifoName is the name of the Firecracker VMM metrics FIFO FirecrackerMetricsFifoName = "fc-metrics.fifo" // OsvOutputLogfileName is the name of the Osv log OsvOutputLogfileName = "osv.fifo" )
const (
// DefaultImageSuffix is the default image tag kubelet try to add to image.
DefaultImageSuffix = ":latest"
)
Variables ¶
var (
ErrNotAssign = errors.New("VM setup is not assigned")
)
Functions ¶
func GetExecEnvironmentCount ¶
GetExecEnvironmentCount gets the EE count
func GetMaxReplicaCount ¶
GetMaxReplicaCount gets the maximum replica count
func GetMinReplicaCount ¶
GetMinReplicaCount gets the minimum replica count
func PrepareReplicaRequest ¶
func PrepareReplicaRequest(labels map[string]string, envs map[string]string, image string) (*pb.CreateRequest, error)
PrepareReplicaRequest prepares the argument needed for creating replica
Types ¶
type Dir ¶
type Dir string
Dir represents the root of a firecracker-frakti VM directory, which holds various files, sockets and FIFOs used during VM runtime.
func VMDir ¶
VMDir holds files, sockets and FIFOs scoped to a single VM with the given VMID. It is unique per-VM and containerd namespace.
func (Dir) FirecrackerLogFifoPath ¶
FirecrackerLogFifoPath returns the path to the FIFO at which the firecracker VMM writes its logs
func (Dir) FirecrackerMetricsFifoPath ¶
FirecrackerMetricsFifoPath returns the path to the FIFO at which the firecracker VMM writes metrics
func (Dir) FirecrackerSockPath ¶
FirecrackerSockPath returns the path to the unix socket at which the firecracker VMM services its API
func (Dir) Mkdir ¶
Mkdir will mkdir the RootPath with correct permissions, or no-op if it already exists
func (Dir) OsvOutputLogfilePath ¶
OsvOutputLogfilePath returns the path to the log file at which the osv writes its logs
type ReplicaMeta ¶
type ReplicaMeta struct { Machine *firecracker.Machine MachineConfig firecracker.Config Vmid string // contains filtered or unexported fields }
ReplicaMeta contains metadata of a serverless vm replica >>>> This is used by fcdaemon, not stored at the gateway/proxy
func CreateReplica ¶
func CreateReplica(ctx context.Context, newMachineLock *sync.Mutex, fcBinary string, vmSetupPool *VMSetupPool, serviceState *ServiceState, req *pb.CreateRequest, cpuID uint32, numaNode uint32) (*ReplicaMeta, error)
CreateReplica creates a new serverless function replica
type ServiceState ¶
type ServiceState struct { ResmngrAddr string FcdaemonAddr string NetName string CachePort uint UseCustomCache bool AvALogLevel string }
ServiceState contains states that are necessary to start the VM
type TryAgainError ¶
type TryAgainError struct {
Msg string // description of error
}
TryAgainError contains the error message that asks the client to retry
func (*TryAgainError) Error ¶
func (e *TryAgainError) Error() string
type VMSetup ¶
type VMSetup struct { ReplicaMeta *ReplicaMeta // contains filtered or unexported fields }
VMSetup contains meta data for the vm and a configured network interface using cni
type VMSetupPool ¶
type VMSetupPool struct { sync.Mutex IdleVMSetup []*VMSetup OccupiedVMSetup map[string]*VMSetup NetName string // contains filtered or unexported fields }
VMSetupPool contains a pool of vm setup
func NewVMSetupPool ¶
func NewVMSetupPool(ctx context.Context, netname string) *VMSetupPool
NewVMSetupPool creates a empty vm setup pool
func (*VMSetupPool) FillVMSetupPool ¶
func (p *VMSetupPool) FillVMSetupPool(n int) error
FillVMSetupPool fills in n vm setup to idle pool
func (*VMSetupPool) GetVMSetup ¶
func (p *VMSetupPool) GetVMSetup() (*VMSetup, error)
GetVMSetup returns a vm setup
func (*VMSetupPool) ReturnVMSetup ¶
func (p *VMSetupPool) ReturnVMSetup(vmSetup *VMSetup)
ReturnVMSetup returns the vm setup back to the idle vm setup pool
func (*VMSetupPool) ReturnVMSetupByVmid ¶
func (p *VMSetupPool) ReturnVMSetupByVmid(vmid string) error
ReturnVMSetupByVmid returns the vm setup identified by vmid to the idle vm setup pool