conflicts

package module
v0.0.0-...-cc2015d Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REG_EXP                      string = `^wskowdev-invoker-[0-9]*-[0-9]*-guest-%v`
	BLKIO_WEIGHT_DEFAULT         uint16 = 0
	CPUSET_CPUS_DEFAULT          string = ""
	CPUSET_MEMS_DEFAULT          string = ""
	CPU_SHARES_DEFAULT           int64  = 0 // Openwhisk default 2
	CPU_PERIOD_DEFAULT           int64  = 0 // Openwhisk default 100000
	CPU_QUOTA_DEFAULT            int64  = 0
	CPU_REALTIME_PERIOD_DEFAULT  int64  = 0
	CPU_REALTIME_RUNTIME_DEFAULT int64  = 0
	MEMORY_DEFAULT               int64  = 0 // Openwhisk default 268435456
	MEMORY_RESERVATION_DEFAULT   int64  = 0
	MEMORY_SWAP_DEFAULT          int64  = 0 // Openwhisk default -1
	KERNEL_MEMORY_DEFAULT        int64  = 0
	NANO_CPUS_DEFAULT            int64  = 0
	RESTART_POLICY_DEFAULT       string = "" // Openwhisk default {"Name": "no",MaximumRetryCount: 0}
	CPU_PERIOD_OPENWHISK_DEFAULT int64  = 100000
	CPU_QUOTAS_LOWER_BOUND       int64  = 1000
	Kp                           int64  = 10
	Ki                           int64  = 1
	Kd                           int64  = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConflictResolver

type ConflictResolver struct {
	Registry     map[string]*wfs.FunctionState
	DockerClient *client.Client
	Cores        int64
	// contains filtered or unexported fields
}

func NewConflictResolver

func NewConflictResolver(cores int64) ConflictResolver

func (*ConflictResolver) ExportRegistry

func (cr *ConflictResolver) ExportRegistry() map[string]interface{}

Export Registry information. Method used for debugging purposes.

func (*ConflictResolver) ReconfigureRegistry

func (cr *ConflictResolver) ReconfigureRegistry(quotas_new int64, quotas_old int64)

Recompute CPU quotas for each container, using the formula λ*DesiredCPUQuotas where λ = CPU_Cores / sum of DesiredCPUQuotas.

func (*ConflictResolver) RegistryContains

func (cr *ConflictResolver) RegistryContains(function string) bool

Searches Registry data stucture for existing function state.

func (*ConflictResolver) RemoveFromRegistry

func (cr *ConflictResolver) RemoveFromRegistry(rs wrq.ResetRequest) error

Removes a request from registry and resets function state.

func (*ConflictResolver) SearchDockerRuntime

func (cr *ConflictResolver) SearchDockerRuntime(function, podType string) (*types.Container, error)

Helper method for searching docker runtime for an openwhisk action container.

func (*ConflictResolver) UpdateRegistry

func (cr *ConflictResolver) UpdateRegistry(req *wrq.Request) (bool, error)

Places new request into registry and update container resources.

type ConflictResolverInterface

type ConflictResolverInterface interface {
	SearchDockerRuntime(function, podType string) (*types.Container, error)
	RegistryContains(function string) bool
	InsertToRegistry()
	UpdateRegistry(id uint64, function string, quotas int64) error
	RemoveFromRegistry(rs wrq.ResetRequest) error
	ReconfigureRegistry() error
	ExportRegistry() map[string]interface{}
}

Jump to

Keyboard shortcuts

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