buildkitd

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MPL-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBuildkitCrashed is an error returned when buildkit has terminated unexpectedly.
	ErrBuildkitCrashed = errors.New("buildkitd crashed")

	// ErrBuildkitConnectionFailure is an error returned when buildkit has failed to respond.
	ErrBuildkitConnectionFailure = errors.New("buildkitd did not respond (in time)")
)

Functions

func ConfigureSatelliteTLS added in v0.8.0

func ConfigureSatelliteTLS(settings *Settings, sat *cloud.SatelliteInstance) (cleanupFn func(), err error)

ConfigureSatelliteTLS uses the CA cert and key associate with the satellite to generate a new certificate/key pair for use in client-side mTLS. The certificates are configured in the settings for a new buildkit client.

func GenCerts added in v0.7.5

func GenCerts(cfg config.Config, hostname string) error

GenCerts creates and saves a CA and certificates for both sides of an mTLS TCP connection.

func GetAvailableImageID

func GetAvailableImageID(ctx context.Context, image string, fe containerutil.ContainerFrontend) (string, error)

GetAvailableImageID fetches the ID of the image buildkitd image available.

func GetContainerIP added in v0.3.13

func GetContainerIP(ctx context.Context, containerName string, fe containerutil.ContainerFrontend, settings Settings) (string, error)

GetContainerIP returns the IP of the buildkit container.

func GetContainerInfo added in v0.8.7

func GetContainerInfo(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (*containerutil.ContainerInfo, error)

GetContainerInfo inspects the running container (running under containerName)

func GetDockerVersion added in v0.6.15

func GetDockerVersion(ctx context.Context, fe containerutil.ContainerFrontend) (string, error)

GetDockerVersion returns the docker version command output

func GetImageInfo added in v0.8.7

GetImageInfo inspects an image

func GetLogs added in v0.6.15

func GetLogs(ctx context.Context, containerName string, fe containerutil.ContainerFrontend, settings Settings) (string, error)

GetLogs returns earthly-buildkitd logs

func GetSettingsHash

func GetSettingsHash(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (string, error)

GetSettingsHash fetches the hash of the currently running buildkitd container.

func IsStarted

func IsStarted(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (bool, error)

IsStarted checks if the buildkitd container has been started.

func MaybePull added in v0.6.15

MaybePull checks whether an image is available locally and pulls it if it is not.

func NewClient

func NewClient(ctx context.Context, console conslogging.ConsoleLogger, image, containerName, installationName string, fe containerutil.ContainerFrontend, earthlyVersion string, settings Settings, opts ...client.ClientOpt) (_ *client.Client, retErr error)

NewClient returns a new buildkitd client. If the buildkitd daemon is local, this function might start one up, if not already started.

func PrintSatelliteInfo added in v0.6.20

func PrintSatelliteInfo(ctx context.Context, console conslogging.ConsoleLogger, earthlyVersion string, settings Settings, installationName string) error

PrintSatelliteInfo prints the instance's details, including its Buildkit version, current workload, and garbage collection.

func RemoveExited added in v0.3.0

func RemoveExited(ctx context.Context, fe containerutil.ContainerFrontend, containerName string) error

RemoveExited removes any stopped or exited buildkitd containers

func ResetCache

func ResetCache(ctx context.Context, console conslogging.ConsoleLogger, image, containerName, installationName string, fe containerutil.ContainerFrontend, settings Settings, opts ...client.ClientOpt) error

ResetCache restarts the buildkitd daemon with the reset command.

func Start

func Start(ctx context.Context, console conslogging.ConsoleLogger, image, containerName, installationName string, fe containerutil.ContainerFrontend, settings Settings, reset bool) error

Start starts the buildkitd daemon.

func Stop

func Stop(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) error

Stop stops the buildkitd container.

func WaitUntilStarted

func WaitUntilStarted(ctx context.Context, console conslogging.ConsoleLogger, containerName, volumeName, address string, opTimeout time.Duration, fe containerutil.ContainerFrontend, opts ...client.ClientOpt) (*client.Info, *client.WorkerInfo, error)

WaitUntilStarted waits until the buildkitd daemon has started and is healthy.

func WaitUntilStopped

func WaitUntilStopped(ctx context.Context, containerName string, opTimeout time.Duration, fe containerutil.ContainerFrontend) error

WaitUntilStopped waits until the buildkitd daemon has stopped.

Types

type Settings

type Settings struct {
	CacheSizeMb          int
	CacheSizePct         int
	CacheKeepDuration    int
	Debug                bool
	BuildkitAddress      string
	LocalRegistryAddress string
	AdditionalArgs       []string
	AdditionalConfig     string
	CniMtu               uint16
	Timeout              time.Duration `hash:"ignore"`
	TLSCA                string
	ClientTLSCert        string
	ClientTLSKey         string
	ServerTLSCert        string
	ServerTLSKey         string
	UseTCP               bool
	UseTLS               bool
	VolumeName           string
	IPTables             string
	MaxParallelism       int
	SatelliteName        string `hash:"ignore"`
	SatelliteDisplayName string `hash:"ignore"`
	SatelliteOrgID       string `hash:"ignore"`
	SatelliteToken       string `hash:"ignore"`
	SatelliteIsManaged   bool   `hash:"ignore"`
	EnableProfiler       bool
	NoUpdate             bool   `hash:"ignore"`
	StartUpLockPath      string `hash:"ignore"`
}

Settings represents the buildkitd settings used to start up the daemon with.

func (Settings) HasConfiguredCacheSize added in v0.8.2

func (s Settings) HasConfiguredCacheSize() bool

HasConfiguredCacheSize returns if the buildkitd cache size was configured

func (Settings) Hash

func (s Settings) Hash() (string, error)

Hash returns a secure hash of the settings.

func (Settings) VerifyHash

func (s Settings) VerifyHash(hash string) (bool, error)

VerifyHash checks whether a given hash matches the settings.

Jump to

Keyboard shortcuts

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