buildkit

package
v0.0.303 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 80 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultContainerName = "fn-buildkitd"
View Source
const KeySourceDateEpoch = "source-date-epoch"
View Source
const SSHAgentProviderID = "default"

Variables

View Source
var (
	ImportCacheVar = &cacheVar{}
	ExportCacheVar = &cacheVar{}
)
View Source
var (
	BuildkitSecrets string
	ForwardKeychain = true
)
View Source
var (
	BuildOnNamespaceCloud           = knobs.Bool("build_in_nscloud", "If set to true, builds are triggered remotely.", false)
	BuildOnNamespaceCloudUnlessHost = knobs.Bool("build_in_nscloud_unless_host", "If set to true, builds that match the host platform run locally. All other builds are triggered remotely.", false)
)
View Source
var File_internal_build_buildkit_devhost_proto protoreflect.FileDescriptor
View Source
var OverridesConfigType = cfg.DefineConfigType[*Overrides]()
View Source
var PreDigestLocalInputs = environment.IsRunningInCI()

XXX make this a flag instead. The assumption here is that in CI the filesystem is readonly.

View Source
var SkipExpectedMaxWorkspaceSizeCheck = false
View Source
var TaskOutputBuildkitJsonLog = tasks.Output("buildkit.json", "application/json+fn.buildkit")
View Source
var UsePlaintextLogging = false

Functions

func BuildDefinitionToImage

func BuildDefinitionToImage(makeClient ClientFactory, conf build.BuildTarget, def *llb.Definition) compute.Computable[oci.Image]

func BuildFilesystem

func BuildFilesystem(ctx context.Context, makeClient ClientFactory, target build.BuildTarget, state llb.State, localDirs ...LocalContents) (compute.Computable[fs.FS], error)

func BuildImage

func BuildImage(ctx context.Context, makeClient ClientFactory, conf build.BuildTarget, state llb.State, localDirs ...LocalContents) (compute.Computable[oci.Image], error)

func DeferBuildFilesystem added in v0.0.112

func DeferBuildFilesystem(makeClient ClientFactory, secrets secrets.GroundedSecrets, target build.BuildTarget, state compute.Computable[*Input], localDirs ...LocalContents) compute.Computable[fs.FS]

func EnsureBuildkitd

func EnsureBuildkitd(ctx context.Context, containerName string) (string, error)

func MakeClient added in v0.0.108

func MakeClient(config cfg.Configuration, targetPlatform *specs.Platform) compute.Computable[*GatewayClient]

func MakeImage added in v0.0.83

func MakeLocalExcludes

func MakeLocalExcludes(src LocalContents) []string

func MakeLocalState

func MakeLocalState(src LocalContents) llb.State

func MarshalForTarget added in v0.0.108

func MarshalForTarget(ctx context.Context, state llb.State, target build.BuildTarget) (*llb.Definition, error)

func Prune

func Prune(ctx context.Context, cfg cfg.Configuration, targetPlatform *specs.Platform) error

func RemoveBuildkitd

func RemoveBuildkitd(ctx context.Context) error

func Version

func Version() (string, error)

Types

type BuildkitAwareRegistry

type BuildkitAwareRegistry interface {
	CheckExportRequest(*GatewayClient, oci.RepositoryWithParent) (*ExportToRegistryRequest, *ExportToRegistryRequest)
}

type ClientFactory added in v0.0.108

type ClientFactory interface {
	MakeClient(context.Context) (*GatewayClient, error)
}

func DeferClient added in v0.0.108

func DeferClient(config cfg.Configuration, targetPlatform *specs.Platform) ClientFactory

type ColocatedBuildCluster added in v0.0.124

type ColocatedBuildCluster struct {
	Namespace         string            `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	MatchingPodLabels map[string]string `` /* 202-byte string literal not displayed */
	TargetPort        int32             `protobuf:"varint,3,opt,name=target_port,json=targetPort,proto3" json:"target_port,omitempty"`
	// contains filtered or unexported fields
}

func (*ColocatedBuildCluster) Descriptor deprecated added in v0.0.124

func (*ColocatedBuildCluster) Descriptor() ([]byte, []int)

Deprecated: Use ColocatedBuildCluster.ProtoReflect.Descriptor instead.

func (*ColocatedBuildCluster) GetMatchingPodLabels added in v0.0.124

func (x *ColocatedBuildCluster) GetMatchingPodLabels() map[string]string

func (*ColocatedBuildCluster) GetNamespace added in v0.0.124

func (x *ColocatedBuildCluster) GetNamespace() string

func (*ColocatedBuildCluster) GetTargetPort added in v0.0.124

func (x *ColocatedBuildCluster) GetTargetPort() int32

func (*ColocatedBuildCluster) ProtoMessage added in v0.0.124

func (*ColocatedBuildCluster) ProtoMessage()

func (*ColocatedBuildCluster) ProtoReflect added in v0.0.124

func (x *ColocatedBuildCluster) ProtoReflect() protoreflect.Message

func (*ColocatedBuildCluster) Reset added in v0.0.124

func (x *ColocatedBuildCluster) Reset()

func (*ColocatedBuildCluster) String added in v0.0.124

func (x *ColocatedBuildCluster) String() string

type ExportToRegistryRequest

type ExportToRegistryRequest struct {
	Name     string
	Insecure bool
}

type FrontendRequest added in v0.0.83

type FrontendRequest struct {
	Def            *llb.Definition
	OriginalState  *llb.State
	Frontend       string
	FrontendAttrs  map[string]string
	FrontendInputs map[string]llb.State
	Secrets        []*schema.PackageRef
}

type GatewayClient

type GatewayClient struct {
	*client.Client
	// contains filtered or unexported fields
}

func Client added in v0.0.108

func Client(ctx context.Context, config cfg.Configuration, targetPlatform *specs.Platform) (*GatewayClient, error)

func (*GatewayClient) BuildkitOpts added in v0.0.108

func (cli *GatewayClient) BuildkitOpts() builtkitOpts

func (*GatewayClient) MakeClient added in v0.0.108

func (cli *GatewayClient) MakeClient(_ context.Context) (*GatewayClient, error)

func (*GatewayClient) UsesDocker

func (cli *GatewayClient) UsesDocker() bool

type HostedBuildCluster added in v0.0.92

type HostedBuildCluster struct {
	ClusterId  string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
	TargetPort int32  `protobuf:"varint,2,opt,name=target_port,json=targetPort,proto3" json:"target_port,omitempty"`
	// contains filtered or unexported fields
}

func (*HostedBuildCluster) Descriptor deprecated added in v0.0.92

func (*HostedBuildCluster) Descriptor() ([]byte, []int)

Deprecated: Use HostedBuildCluster.ProtoReflect.Descriptor instead.

func (*HostedBuildCluster) GetClusterId added in v0.0.92

func (x *HostedBuildCluster) GetClusterId() string

func (*HostedBuildCluster) GetTargetPort added in v0.0.92

func (x *HostedBuildCluster) GetTargetPort() int32

func (*HostedBuildCluster) ProtoMessage added in v0.0.92

func (*HostedBuildCluster) ProtoMessage()

func (*HostedBuildCluster) ProtoReflect added in v0.0.92

func (x *HostedBuildCluster) ProtoReflect() protoreflect.Message

func (*HostedBuildCluster) Reset added in v0.0.92

func (x *HostedBuildCluster) Reset()

func (*HostedBuildCluster) String added in v0.0.92

func (x *HostedBuildCluster) String() string

type Input added in v0.0.115

type Input struct {
	State   llb.State
	Secrets []*schema.PackageRef
}

type LocalContents

type LocalContents struct {
	Module build.Workspace
	Path   string

	// Added to the base exclude patterns.
	ExcludePatterns []string
}

func (LocalContents) Abs

func (l LocalContents) Abs() string

type Overrides

type Overrides struct {
	ContainerName         string                 `protobuf:"bytes,1,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"`
	BuildkitAddr          string                 `protobuf:"bytes,2,opt,name=buildkit_addr,json=buildkitAddr,proto3" json:"buildkit_addr,omitempty"`
	HostedBuildCluster    *HostedBuildCluster    `protobuf:"bytes,3,opt,name=hosted_build_cluster,json=hostedBuildCluster,proto3" json:"hosted_build_cluster,omitempty"`
	ColocatedBuildCluster *ColocatedBuildCluster `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

Used for configuration purposes.

func (*Overrides) Descriptor deprecated

func (*Overrides) Descriptor() ([]byte, []int)

Deprecated: Use Overrides.ProtoReflect.Descriptor instead.

func (*Overrides) GetBuildkitAddr

func (x *Overrides) GetBuildkitAddr() string

func (*Overrides) GetColocatedBuildCluster added in v0.0.124

func (x *Overrides) GetColocatedBuildCluster() *ColocatedBuildCluster

func (*Overrides) GetContainerName

func (x *Overrides) GetContainerName() string

func (*Overrides) GetHostedBuildCluster added in v0.0.92

func (x *Overrides) GetHostedBuildCluster() *HostedBuildCluster

func (*Overrides) ProtoMessage

func (*Overrides) ProtoMessage()

func (*Overrides) ProtoReflect

func (x *Overrides) ProtoReflect() protoreflect.Message

func (*Overrides) Reset

func (x *Overrides) Reset()

func (*Overrides) String

func (x *Overrides) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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