distro

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DnfInstall

func DnfInstall(cfg *dnfInstallConfig, releaseVer string, pkgs []string) llb.RunOption

func DnfNoGPGCheck

func DnfNoGPGCheck(cfg *dnfInstallConfig)

func TdnfInstall

func TdnfInstall(cfg *dnfInstallConfig, releaseVer string, pkgs []string) llb.RunOption

Types

type Config

type Config struct {
	FullName   string
	ImageRef   string
	ContextRef string

	// The release version of the distro
	ReleaseVer string

	// Build dependencies needed
	BuilderPackages []string

	// Dependencies to install in base image
	BasePackages       []dalec.Spec
	RepoPlatformConfig *dalec.RepoPlatformConfig

	DefaultOutputImage string

	InstallFunc PackageInstaller

	// Unique identifier for the package cache for this particular distro,
	// e.g., azlinux3-tdnf-cache
	CacheName string
	// Whether to namespace the cache key by platform
	// Not all distros need this, hence why it is configurable.
	// The cache key is only added when the build platform and target platform differ.
	CacheAddPlatform bool

	// e.g. /var/cache/tdnf or /var/cache/dnf
	CacheDir string
}

func (*Config) BuildContainer

func (cfg *Config) BuildContainer(ctx context.Context, client gwclient.Client, worker llb.State, sOpt dalec.SourceOpts, spec *dalec.Spec, targetKey string, rpmDir llb.State, opts ...llb.ConstraintsOpt) (llb.State, error)

func (*Config) BuildPkg

func (c *Config) BuildPkg(ctx context.Context, client gwclient.Client, worker llb.State, sOpt dalec.SourceOpts, spec *dalec.Spec, targetKey string, opts ...llb.ConstraintsOpt) (llb.State, error)

func (*Config) DebugWorker

func (c *Config) DebugWorker(ctx context.Context, client gwclient.Client, spec *dalec.Spec, targetKey string, sOpt dalec.SourceOpts, opts ...llb.ConstraintsOpt) (llb.State, error)

DebugWorker returns a worker image with the build dependencies specified in `spec` installed, if needed. It is most useful for `HandleSources` handler in which we aren't building a full worker image with build dependencies because we aren't executing build steps, but we may still have source generators which depend on `build` dependencies in the spec in order to run.

func (*Config) Handle

func (cfg *Config) Handle(ctx context.Context, client gwclient.Client) (*gwclient.Result, error)

func (*Config) HandleBuildroot

func (c *Config) HandleBuildroot(ctx context.Context, client gwclient.Client) (*gwclient.Result, error)

func (*Config) HandleDebug

func (c *Config) HandleDebug() gwclient.BuildFunc

HandleDebug returns a build function that adds support for some debugging targets for RPM builds.

func (*Config) HandleDepsOnly

func (cfg *Config) HandleDepsOnly(ctx context.Context, client gwclient.Client) (*gwclient.Result, error)

func (*Config) HandleSources

func (c *Config) HandleSources(ctx context.Context, client gwclient.Client) (*gwclient.Result, error)

func (*Config) HandleSpec

func (c *Config) HandleSpec(ctx context.Context, client gwclient.Client) (*gwclient.Result, error)

func (*Config) HandleWorker

func (cfg *Config) HandleWorker(ctx context.Context, client gwclient.Client) (*gwclient.Result, error)

The implementation here is identical to that for the deb distro. TODO: can this be refactored to share code?

func (*Config) Install

func (c *Config) Install(pkgs []string, opts ...DnfInstallOpt) llb.RunOption

func (*Config) InstallBuildDeps

func (cfg *Config) InstallBuildDeps(ctx context.Context, client gwclient.Client, spec *dalec.Spec, sOpt dalec.SourceOpts, targetKey string, opts ...llb.ConstraintsOpt) llb.StateOption

func (*Config) InstallTestDeps

func (cfg *Config) InstallTestDeps(worker llb.State, sOpt dalec.SourceOpts, targetKey string, spec *dalec.Spec, opts ...llb.ConstraintsOpt) llb.StateOption

func (*Config) PackageCacheMount

func (cfg *Config) PackageCacheMount(root string) llb.RunOption

func (*Config) RepoMounts

func (cfg *Config) RepoMounts(repos []dalec.PackageRepositoryConfig, sOpt dalec.SourceOpts, opts ...llb.ConstraintsOpt) (llb.RunOption, []string, error)

func (*Config) RunTests

func (cfg *Config) RunTests(ctx context.Context, client gwclient.Client, worker llb.State, spec *dalec.Spec, sOpt dalec.SourceOpts, ctr llb.State, targetKey string, opts ...llb.ConstraintsOpt) (gwclient.Reference, error)

runTests runs the package tests The returned reference is the solved container state

func (*Config) Validate

func (c *Config) Validate(spec *dalec.Spec) error

func (*Config) Worker

func (cfg *Config) Worker(sOpt dalec.SourceOpts, opts ...llb.ConstraintsOpt) (llb.State, error)

type DnfInstallOpt

type DnfInstallOpt func(*dnfInstallConfig)

func DnfAtRoot

func DnfAtRoot(root string) DnfInstallOpt

func DnfDownloadAllDeps

func DnfDownloadAllDeps(dest string) DnfInstallOpt

func DnfImportKeys

func DnfImportKeys(keys []string) DnfInstallOpt

see comment in tdnfInstall for why this additional option is needed

func DnfWithMounts

func DnfWithMounts(opts ...llb.RunOption) DnfInstallOpt

func IncludeDocs added in v0.16.2

func IncludeDocs(v bool) DnfInstallOpt

type PackageInstaller

type PackageInstaller func(*dnfInstallConfig, string, []string) llb.RunOption

Jump to

Keyboard shortcuts

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