buildkitd

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContainerName is the name of the buildkitd container.
	ContainerName = "earthly-buildkitd"
	// VolumeName is the name of the docker volume used for storing the cache.
	VolumeName = "earthly-cache"
)

Variables

View Source
var Address = fmt.Sprintf("docker-container://%s", ContainerName)

Address is the address at which the daemon is available.

Functions

func CheckCompatibility added in v0.4.0

func CheckCompatibility(ctx context.Context, settings Settings) error

CheckCompatibility runs all avaliable compatibility checks before starting the buildkitd daemon.

func GetAvailableImageID

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

GetAvailableImageID fetches the ID of the image buildkitd image available.

func GetContainerIP added in v0.3.13

func GetContainerIP(ctx context.Context) (string, error)

GetContainerIP returns the IP of the buildkit container.

func GetContainerImageID

func GetContainerImageID(ctx context.Context) (string, error)

GetContainerImageID fetches the ID of the image used for the running buildkitd container.

func GetSettingsHash

func GetSettingsHash(ctx context.Context) (string, error)

GetSettingsHash fetches the hash of the currently running buildkitd container.

func IsStarted

func IsStarted(ctx context.Context) (bool, error)

IsStarted checks if the buildkitd container has been started.

func MaybeRestart

func MaybeRestart(ctx context.Context, console conslogging.ConsoleLogger, image string, settings Settings, opTimeout time.Duration) error

MaybeRestart checks whether the there is a different buildkitd image available locally or if settings of the current container are different from the provided settings. In either case, the container is restarted.

func MaybeStart

func MaybeStart(ctx context.Context, console conslogging.ConsoleLogger, image string, settings Settings, opTimeout time.Duration) (string, error)

MaybeStart ensures that the buildkitd daemon is started. It returns the URL that can be used to connect to it.

func NewClient

func NewClient(ctx context.Context, console conslogging.ConsoleLogger, image string, settings Settings, opTimeout time.Duration, opts ...client.ClientOpt) (*client.Client, error)

NewClient returns a new buildkitd client.

func RemoveExited added in v0.3.0

func RemoveExited(ctx context.Context) error

RemoveExited removes any stopped or exited buildkitd containers

func ResetCache

func ResetCache(ctx context.Context, console conslogging.ConsoleLogger, image string, settings Settings, opTimeout time.Duration) error

ResetCache restarts the buildkitd daemon with the reset command.

func Start

func Start(ctx context.Context, image string, settings Settings, reset bool) error

Start starts the buildkitd daemon.

func Stop

func Stop(ctx context.Context) error

Stop stops the buildkitd container.

func WaitUntilStarted

func WaitUntilStarted(ctx context.Context, address string, opTimeout time.Duration) error

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

func WaitUntilStopped

func WaitUntilStopped(ctx context.Context, opTimeout time.Duration) error

WaitUntilStopped waits until the buildkitd daemon has stopped.

Types

type Settings

type Settings struct {
	CacheSizeMb     int      `json:"cacheSizeMb"`
	GitURLInsteadOf string   `json:"gitUrlInsteadOf"`
	RunDir          string   `json:"runDir"`
	Debug           bool     `json:"debug"`
	DebuggerPort    int      `json:"debuggerPort"`
	AdditionalArgs  []string `json:"additionalArgs"`
}

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

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