convert

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package convert provides LLB converter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalLLB

func MarshalLLB(ctx context.Context, graph *solver.PackageGraph, solver SolverFunc, options *environment.Options) (*llb.Definition, error)

MarshalLLB translates package graph into LLB DAG and marshals it.

Types

type GraphLLB

type GraphLLB struct {
	*solver.PackageGraph

	Options *environment.Options

	BaseImages   map[v1alpha2.Variant]llb.State
	Checksummer  llb.State
	LocalContext llb.State
	// contains filtered or unexported fields
}

GraphLLB wraps PackageGraph to provide LLB conversion.

GraphLLB caches common images used in the build.

func NewGraphLLB

func NewGraphLLB(graph *solver.PackageGraph, solverFn SolverFunc, options *environment.Options) *GraphLLB

NewGraphLLB creates new GraphLLB and initializes shared images.

func (*GraphLLB) Build

func (graph *GraphLLB) Build(ctx context.Context) (llb.State, error)

Build converts package graph to LLB.

func (*GraphLLB) Marshal

func (graph *GraphLLB) Marshal(ctx context.Context) (*llb.Definition, error)

Marshal returns marshaled LLB.

type NodeLLB

type NodeLLB struct {
	*solver.PackageNode

	Graph  *GraphLLB
	Prefix string
}

NodeLLB wraps PackageNode to provide LLB conversion.

func NewNodeLLB

func NewNodeLLB(node *solver.PackageNode, graph *GraphLLB) *NodeLLB

NewNodeLLB wraps PackageNode for LLB conversion.

func (*NodeLLB) Build

func (node *NodeLLB) Build(ctx context.Context) (llb.State, error)

Build converts PackageNode to buildkit LLB.

type SolverFunc added in v0.3.0

type SolverFunc func(ctx context.Context, platform environment.Platform, target string) (*client.Result, error)

SolverFunc can be called to solve the package into the llb state via buildkit.

Jump to

Keyboard shortcuts

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