Documentation
¶
Index ¶
- Variables
- func GenCerts(cfg config.Config, hostname string) error
- func GetAvailableImageID(ctx context.Context, image string, fe containerutil.ContainerFrontend) (string, error)
- func GetContainerIP(ctx context.Context, containerName string, fe containerutil.ContainerFrontend, ...) (string, error)
- func GetContainerInfo(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (*containerutil.ContainerInfo, error)
- func GetDockerVersion(ctx context.Context, fe containerutil.ContainerFrontend) (string, error)
- func GetImageInfo(ctx context.Context, image string, fe containerutil.ContainerFrontend) (*containerutil.ImageInfo, error)
- func GetLogs(ctx context.Context, containerName string, fe containerutil.ContainerFrontend, ...) (string, error)
- func GetSettingsHash(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (string, error)
- func IsStarted(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) (bool, error)
- func MaybePull(ctx context.Context, console conslogging.ConsoleLogger, image string, ...) error
- func NewClient(ctx context.Context, console conslogging.ConsoleLogger, ...) (_ *client.Client, retErr error)
- func RemoveExited(ctx context.Context, fe containerutil.ContainerFrontend, containerName string) error
- func ResetCache(ctx context.Context, console conslogging.ConsoleLogger, ...) error
- func Start(ctx context.Context, console conslogging.ConsoleLogger, ...) error
- func Stop(ctx context.Context, containerName string, fe containerutil.ContainerFrontend) error
- func WaitUntilStarted(ctx context.Context, console conslogging.ConsoleLogger, ...) (*client.Info, *client.WorkerInfo, error)
- func WaitUntilStopped(ctx context.Context, containerName string, opTimeout time.Duration, ...) error
- type Settings
Constants ¶
This section is empty.
Variables ¶
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 GenCerts ¶
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 ¶
func GetContainerIP( ctx context.Context, containerName string, fe containerutil.ContainerFrontend, settings Settings, ) (string, error)
GetContainerIP returns the IP of the buildkit container.
func GetContainerInfo ¶
func GetContainerInfo( ctx context.Context, containerName string, fe containerutil.ContainerFrontend, ) (*containerutil.ContainerInfo, error)
GetContainerInfo inspects the running container (running under containerName).
func GetDockerVersion ¶
func GetDockerVersion(ctx context.Context, fe containerutil.ContainerFrontend) (string, error)
GetDockerVersion returns the docker version command output.
func GetImageInfo ¶
func GetImageInfo( ctx context.Context, image string, fe containerutil.ContainerFrontend, ) (*containerutil.ImageInfo, error)
GetImageInfo inspects an image.
func GetLogs ¶
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 ¶
func MaybePull( ctx context.Context, console conslogging.ConsoleLogger, image string, fe containerutil.ContainerFrontend, ) error
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 RemoveExited ¶
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 string, settings Settings, 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 {
TLSCA string
ServerTLSCert string
IPTables string
StartUpLockPath string `hash:"ignore"`
BuildkitAddress string
LocalRegistryAddress string
ServerTLSKey string
ClientTLSKey string
ClientTLSCert string
VolumeName string
AdditionalConfig string
AdditionalArgs []string
CacheSizeMb int
CacheSizePct int
Timeout time.Duration `hash:"ignore"`
MaxParallelism int
CacheKeepDuration int
CniMtu uint16
UseTLS bool
UseTCP bool
EnableProfiler bool
NoUpdate bool `hash:"ignore"`
Debug bool
}
Settings represents the buildkitd settings used to start up the daemon with.
func (Settings) HasConfiguredCacheSize ¶
HasConfiguredCacheSize returns if the buildkitd cache size was configured.