build

package
v0.0.358 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FixedPoint = time.Unix(1, 1)
)

Functions

func CopyConfiguration

func CopyConfiguration(b Configuration) *buildConfiguration

func IsPrebuilt

func IsPrebuilt(spec Spec) (oci.ImageID, bool)

func NewBuildTarget

func NewBuildTarget(target *specs.Platform) *buildTarget

func PlatformsOrOverrides

func PlatformsOrOverrides(platforms []specs.Platform) []specs.Platform

func Prebuilt

func Prebuilt(imgid oci.ImageID) compute.Computable[oci.ImageID]

func PrebuiltResolveOpts

func PrebuiltResolveOpts() oci.RegistryAccess

Types

type BuildPlatformsVar

type BuildPlatformsVar struct{}

func (BuildPlatformsVar) Set

func (BuildPlatformsVar) String

func (BuildPlatformsVar) String() string

func (BuildPlatformsVar) Type

func (BuildPlatformsVar) Type() string

type BuildTarget

type BuildTarget interface {
	SourcePackage() schema.PackageName
	SourceLabel() string

	TargetPlatform() *specs.Platform
	// See Plan.PublishName.
	PublishName() compute.Computable[oci.RepositoryWithParent]
}

type Configuration

type Configuration interface {
	BuildTarget

	// If the builder has the ability to produce with buildkit, that's
	// preferred. A reason to do this is for instance when we want to merge
	// multiple images together, and want to defer the merge to buildkit.
	PrefersBuildkit() bool
	Workspace() Workspace
}

type Plan

type Plan struct {
	SourcePackage schema.PackageName
	SourceLabel   string
	BuildKind     storage.Build_Kind
	Spec          Spec
	Workspace     Workspace
	Platforms     []specs.Platform

	// The caller has given us a hint or where the built image will be uploaded
	// to, in case the builder implementation can use this information for
	// optimization purposes. This may be null, and an implementation can always
	// elect to ignore it.
	PublishName compute.Computable[oci.RepositoryWithParent]
}

func (Plan) GetSourceLabel added in v0.0.89

func (p Plan) GetSourceLabel() string

func (Plan) GetSourcePackageRef added in v0.0.89

func (p Plan) GetSourcePackageRef() *schema.PackageRef

type Spec

type Spec interface {
	BuildImage(context.Context, pkggraph.SealedContext, Configuration) (compute.Computable[oci.Image], error)
	PlatformIndependent() bool
}

func PrebuiltPlan

func PrebuiltPlan(imgid oci.ImageID, platformIndependent bool, opts oci.RegistryAccess) Spec

type Workspace

type Workspace interface {
	ModuleName() string
	Abs() string
	IsExternal() bool
	ReadOnlyFS(rel ...string) fs.FS

	// ChangeTrigger returns an observable which will get a new value whenever a
	// path under `rel` is modified, and the filter function doesn't reject.
	// Excludes is a list of excluded files, in buildkit format. Implementations
	// are REQUIRED to depend on ChangeTrigger if they rely on the contents of
	// the workspace.
	ChangeTrigger(rel string, excludes []string) compute.Computable[any]
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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