builder

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: Apache-2.0 Imports: 27 Imported by: 2

Documentation

Index

Constants

View Source
const DriverDirectory = "/tmp/driver"

DriverDirectory is the directory the processor uses to store the driver.

View Source
const ModuleFileName = "module.ko"

ModuleFileName is the standard file name for the kernel module.

View Source
const ProbeFileName = "probe.o"

ProbeFileName is the standard file name for the eBPF probe.

Variables

View Source
var HeadersNotFoundErr = errors.New("kernel headers not found")

ModuleFullPath is the standard path for the kernel module. Builders must place the compiled module at this location.

View Source
var ProbeFullPath = path.Join(DriverDirectory, "bpf", ProbeFileName)

ProbeFullPath is the standard path for the eBPF probe. Builders must place the compiled probe at this location.

Functions

func GetResolvingURLs added in v0.15.0

func GetResolvingURLs(urls []string) ([]string, error)

func Script added in v0.9.6

func Targets

func Targets() []string

Targets returns the list of all the supported targets.

Types

type Build

type Build struct {
	TargetType        Type
	KernelConfigData  string
	KernelRelease     string
	KernelVersion     string
	DriverVersion     string
	Architecture      string
	ModuleFilePath    string
	ProbeFilePath     string
	ModuleDriverName  string
	ModuleDeviceName  string
	BuilderImage      string
	BuilderRepos      []string
	ImagesListers     []ImagesLister
	KernelUrls        []string
	GCCVersion        string
	RepoOrg           string
	RepoName          string
	Images            ImagesMap
	RegistryName      string
	RegistryUser      string
	RegistryPassword  string
	RegistryPlainHTTP bool
}

Build contains the info about the on-going build.

func (*Build) ClientForRegistry added in v0.14.0

func (b *Build) ClientForRegistry(registry string) *auth.Client

func (*Build) GetBuilderImage added in v0.10.0

func (b *Build) GetBuilderImage() string

func (*Build) HasOutputs added in v0.15.1

func (b *Build) HasOutputs() bool

func (*Build) KernelReleaseFromBuildConfig added in v0.9.3

func (b *Build) KernelReleaseFromBuildConfig() kernelrelease.KernelRelease

func (*Build) LoadImages added in v0.12.0

func (b *Build) LoadImages()

func (*Build) ToConfig added in v0.10.0

func (b *Build) ToConfig() Config

type Builder

type Builder interface {
	Name() string
	TemplateScript() string
	URLs(kr kernelrelease.KernelRelease) ([]string, error)
	TemplateData(c Config, kr kernelrelease.KernelRelease, urls []string) interface{} // error return type is managed
}

Builder represents a builder capable of generating a script for a driverkit target.

func Factory

func Factory(target Type) (Builder, error)

Factory returns a builder for the given target.

type Config

type Config struct {
	DriverName      string
	DeviceName      string
	DownloadBaseURL string
	*Build
}

Config contains all the configurations needed to build the kernel module or the eBPF probe.

type FileImagesLister added in v0.13.0

type FileImagesLister struct {
	FilePath string
	Arch     string
	Tag      string
	Target   string
}

func NewFileImagesLister added in v0.13.0

func NewFileImagesLister(filePath string, build *Build) (*FileImagesLister, error)

func (*FileImagesLister) LoadImages added in v0.13.0

func (f *FileImagesLister) LoadImages() []Image

type GCCVersionRequestor added in v0.10.0

type GCCVersionRequestor interface {
	// GCCVersion returns the GCC version to be used.
	// If the returned value is empty, the default algorithm will be enforced.
	GCCVersion(kr kernelrelease.KernelRelease) semver.Version
}

type Image added in v0.10.0

type Image struct {
	Target     Type
	GCCVersion semver.Version // we expect images to internally link eg: gcc5 to gcc5.0.0
	Name       string
}

type ImageKey added in v0.12.0

type ImageKey string

type ImagesLister added in v0.13.0

type ImagesLister interface {
	LoadImages() []Image
}

type ImagesMap added in v0.12.0

type ImagesMap map[ImageKey]Image

type MinimumURLsBuilder added in v0.9.6

type MinimumURLsBuilder interface {
	MinimumURLs() int
}

MinimumURLsBuilder is an optional interface to specify minimum number of requested headers urls

type RepoImagesLister added in v0.13.0

type RepoImagesLister struct {
	*repository.Repository
}

func NewRepoImagesLister added in v0.13.0

func NewRepoImagesLister(repo string, build *Build) (*RepoImagesLister, error)

func (*RepoImagesLister) LoadImages added in v0.13.0

func (repo *RepoImagesLister) LoadImages() []Image

type Type

type Type string

Type is a type representing targets.

const TargetTypeAlinux Type = "alinux"

TargetTypeAlinux identifies the AliyunLinux 2 and 3 target.

const TargetTypeAlma Type = "almalinux"

TargetTypeAlma identifies the AlmaLinux target.

const TargetTypeAmazonLinux Type = "amazonlinux"

TargetTypeAmazonLinux identifies the AmazonLinux target.

const TargetTypeAmazonLinux2 Type = "amazonlinux2"

TargetTypeAmazonLinux2 identifies the AmazonLinux2 target.

const TargetTypeAmazonLinux2022 Type = "amazonlinux2022"

TargetTypeAmazonLinux2022 identifies the AmazonLinux2022 target.

const TargetTypeAmazonLinux2023 Type = "amazonlinux2023"

TargetTypeAmazonLinux2023 identifies the AmazonLinux2023 target.

const TargetTypeArchlinux Type = "arch"

TargetTypeArchlinux identifies the Archlinux target.

const TargetTypeBottlerocket Type = "bottlerocket"

TargetTypeBottlerocket identifies the Bottlerocket target.

const TargetTypeCentos Type = "centos"

TargetTypeCentos identifies the Centos target.

const TargetTypeDebian Type = "debian"

TargetTypeDebian identifies the Debian target.

const TargetTypeFedora Type = "fedora"

TargetTypeFedora identifies the Fedora target.

const TargetTypeFlatcar Type = "flatcar"

TargetTypeFlatcar identifies the Flatcar target.

const TargetTypeMinikube Type = "minikube"

TargetTypeMinikube identifies the Minikube target.

const TargetTypeOpenSUSE Type = "opensuse"

TargetTypeOpenSUSE identifies the OpenSUSE target.

const TargetTypePhoton Type = "photon"

TargetTypePhoton identifies the Photon target.

const TargetTypeRedhat Type = "redhat"

TargetTypeRedhat identifies the redhat target.

const TargetTypeRocky Type = "rocky"

TargetTypeRocky identifies the Rocky target.

const TargetTypeTalos Type = "talos"

TargetTypeTalos identifies the Talos target.

const TargetTypeUbuntu Type = "ubuntu"

TargetTypeUbuntu identifies the Ubuntu target.

const TargetTypeVanilla Type = "vanilla"

TargetTypeVanilla identifies the Vanilla target.

const TargetTypeoracle Type = "ol"

TargetTypeoracle identifies the oracle target ("ol" is the ID from /etc/os-release that Oracle uses)

func (Type) String

func (t Type) String() string

type YAMLImage added in v0.13.0

type YAMLImage struct {
	Target      string   `yaml:"target"`
	GCCVersions []string `yaml:"gcc_versions"` // we expect images to internally link eg: gcc5 to gcc5.0.0
	Name        string   `yaml:"name"`
	Arch        string   `yaml:"arch"`
	Tag         string   `yaml:"tag"`
}

type YAMLImagesList added in v0.13.0

type YAMLImagesList struct {
	Images []YAMLImage `yaml:"images"`
}

Jump to

Keyboard shortcuts

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