builder

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 32 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Leave added in v0.13.0

func Leave(ctx context.Context, txn *store.Txn, dockerCli command.Cli, opts LeaveOpts) error

Types

type Builder

type Builder struct {
	*store.NodeGroup
	// contains filtered or unexported fields
}

Builder represents an active builder object

func Create added in v0.13.0

func Create(ctx context.Context, txn *store.Txn, dockerCli command.Cli, opts CreateOpts) (*Builder, error)

func GetBuilders

func GetBuilders(dockerCli command.Cli, txn *store.Txn) ([]*Builder, error)

GetBuilders returns all builders

func New

func New(dockerCli command.Cli, opts ...Option) (_ *Builder, err error)

New initializes a new builder client

func (*Builder) Boot

func (b *Builder) Boot(ctx context.Context) (bool, error)

Boot bootstrap a builder

func (*Builder) ContextName

func (b *Builder) ContextName() string

ContextName returns builder context name if available.

func (*Builder) Err

func (b *Builder) Err() error

Err returns error if any.

func (*Builder) Factory

func (b *Builder) Factory(ctx context.Context, dialMeta map[string][]string) (_ driver.Factory, err error)

Factory returns the driver factory.

func (*Builder) ImageOpt

func (b *Builder) ImageOpt() (imagetools.Opt, error)

ImageOpt returns registry auth configuration

func (*Builder) Inactive

func (b *Builder) Inactive() bool

Inactive checks if all nodes are inactive for this builder.

func (*Builder) LoadNodes

func (b *Builder) LoadNodes(ctx context.Context, opts ...LoadNodesOption) (_ []Node, err error)

LoadNodes loads and returns nodes for this builder. TODO: this should be a method on a Node object and lazy load data for each driver.

func (*Builder) MarshalJSON added in v0.13.0

func (b *Builder) MarshalJSON() ([]byte, error)

func (*Builder) Nodes

func (b *Builder) Nodes() []Node

Nodes returns nodes for this builder.

func (*Builder) Validate

func (b *Builder) Validate() error

Validate validates builder context

type CreateOpts added in v0.13.0

type CreateOpts struct {
	Name                string
	Driver              string
	NodeName            string
	Platforms           []string
	BuildkitdFlags      string
	BuildkitdConfigFile string
	DriverOpts          []string
	Use                 bool
	Endpoint            string
	Append              bool
}

type LeaveOpts added in v0.13.0

type LeaveOpts struct {
	Name     string
	NodeName string
}

type LoadNodesOption added in v0.12.0

type LoadNodesOption func(*loadNodesOptions)

func WithClientOpt added in v0.16.0

func WithClientOpt(clientOpt ...client.ClientOpt) LoadNodesOption

func WithData added in v0.12.0

func WithData() LoadNodesOption

func WithDialMeta added in v0.12.0

func WithDialMeta(dialMeta map[string][]string) LoadNodesOption

type Node

type Node struct {
	store.Node
	Builder     string
	Driver      *driver.DriverHandle
	DriverInfo  *driver.Info
	ImageOpt    imagetools.Opt
	ProxyConfig map[string]string
	Version     string
	Err         error

	// worker settings
	IDs       []string
	Platforms []ocispecs.Platform
	GCPolicy  []client.PruneInfo
	Labels    map[string]string
}

func (*Node) MarshalJSON added in v0.13.0

func (n *Node) MarshalJSON() ([]byte, error)

type Option

type Option func(b *Builder)

Option provides a variadic option for configuring the builder.

func WithContextPathHash

func WithContextPathHash(contextPathHash string) Option

WithContextPathHash is used for determining pods in k8s driver instance.

func WithName

func WithName(name string) Option

WithName sets builder name.

func WithSkippedValidation

func WithSkippedValidation() Option

WithSkippedValidation skips builder context validation.

func WithStore

func WithStore(txn *store.Txn) Option

WithStore sets a store instance used at init.

Jump to

Keyboard shortcuts

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