sledd

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SledAPIHost name or ip of location of sledapi
	SledAPIHost = "localhost" // nolint:gochecknoglobals
	// SledAPIPort port of location of sledapi
	SledAPIPort = "9913" // nolint:gochecknoglobals
)
View Source
var (
	SleddRequestOps = promauto.NewCounter(prometheus.CounterOpts{
		Name: fmt.Sprintf("sledd_%s_all_req", instanceID),
		Help: "The total number of sledd requested events",
	})
	SleddCmdOps = promauto.NewCounter(prometheus.CounterOpts{
		Name: fmt.Sprintf("sledd_%s_cmd_req", instanceID),
		Help: "The total number of sleed command request events",
	})
	SleddWipeOps = promauto.NewCounter(prometheus.CounterOpts{
		Name: fmt.Sprintf("sledd_%s_wipe_req", instanceID),
		Help: "The total number of sledd wipe request events",
	})
	SleddWriteOps = promauto.NewCounter(prometheus.CounterOpts{
		Name: fmt.Sprintf("sledd_%s_write_req", instanceID),
		Help: "The total number of sledd write request events",
	})
	SleddKexecOps = promauto.NewCounter(prometheus.CounterOpts{
		Name: fmt.Sprintf("sledd_%s_kexec_req", instanceID),
		Help: "The total number of sledd kexec request events",
	})
	SleddNetWriteDuration = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name:       "sledd_network_write_durations",
			Help:       "Latency of network writes for sledd requests",
			Objectives: map[float64]float64{},
		},
		[]string{"service"},
	)
	SleddNetGRPC = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name:       "sledd_sledapi_grpc_latency",
			Help:       "Latency of network writes for sledd requests",
			Objectives: map[float64]float64{},
		},
		[]string{"service"},
	)
)
View Source
var (
	//SledMount is the image directory location
	SledMount string = "/var/img" // nolint:gochecknoglobals

	// ConnTimeout is the default connection timeout for grpc
	ConnTimeout time.Duration = 10 * time.Second // nolint:gochecknoglobals

	// SledTimeout is the default connection timeout for sledc communications
	// it is much longer in the case of downloading images
	SledTimeout time.Duration = 5 * time.Minute // nolint:gochecknoglobals
)

Functions

func CheckImageExists

func CheckImageExists(image string) error

CheckImageExists simple function to check if image exists in predefined location.

func CheckWrite added in v0.6.0

func CheckWrite(csw *sled.WriteResponse) *sled.ErrorPackage

CheckWrite checks that each image (kernel, initramfs, device) exists on the storage server.

func GetCommand added in v0.6.0

func GetCommand(mac string) (*sled.CommandSet, error)

GetCommand requests from sledapi the command set for a sled client. It is the primary function used by sledd/sledc.

func RegisterMac added in v0.6.0

func RegisterMac(ru *sled.DaemonProto) error

RegisterMac communicates with the sledapi the sledc's mac address for daemon mode.

func StartFireServer added in v0.8.0

func StartFireServer()

StartFireServer begins the prometheus server endpoint.

func UpdateTask added in v0.6.0

func UpdateTask(
	id, cmd, mac string, update *sled.Response,
) (*sled.NackResponse, error)

UpdateTask changes the status of a task for every commandset, each task is updated on receipt of a sledc update.

func WithSledcInterface added in v0.6.0

func WithSledcInterface(dpi, dpp string,
	f func(sled.SledcProtocolClient) (interface{}, error)) (interface{}, error)

WithSledcInterface wrapper for sledapi connections that returns wrapper and allows additional computation to take place outside the grpc connection.

Types

type WriteMiscUpdate added in v0.7.0

type WriteMiscUpdate struct {
	Daemon bool
	Disk   string
	Kernel string
	Initrd string
}

WriteMiscUpdate contains the other misc fields in a write update.

Jump to

Keyboard shortcuts

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