Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultWorkspaceDir is the default path to the workspace directory in the runner's environment. DefaultWorkspaceDir = "/home/build" // DefaultCacheDir is the default path to the cache directory in the runner's environment. DefaultCacheDir = "/var/cache/melange" // DefaultResolvConfPath is the default path to the resolv.conf file in the runner's environment. DefaultResolvConfPath = "/etc/resolv.conf" )
View Source
const ( KB = 1 << (10 * iota) MB GB TB )
Use binary values for all units
View Source
const (
BubblewrapName = "bubblewrap"
)
View Source
const QemuName = "qemu"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
type Config ¶
type Config struct {
PackageName string
Mounts []BindMount
Capabilities Capabilities
Environment map[string]string
ImgRef string
PodID string
Arch apko_types.Architecture
RunAsUID string
RunAs string
WorkspaceDir string
CacheDir string
CPU, CPUModel, Memory string
SSHKey ssh.Signer
SSHAddress string // SSH address for the build / chrooted environment
SSHControlAddress string // SSH address for the control / management environment
SSHHostKey string
Disk string
Timeout time.Duration
SSHBuildClient *ssh.Client // SSH client for the build environment, may not have privileges
SSHControlBuildClient *ssh.Client // SSH client for control operations in the build environment, has privileges
SSHControlClient *ssh.Client // SSH client for unrestricted control environment, has privileges
QemuPID int
RunAsGID string
}
type Loader ¶ added in v0.4.0
type Loader interface {
LoadImage(ctx context.Context, layer v1.Layer, arch apko_types.Architecture, bc *apko_build.Context) (ref string, err error)
RemoveImage(ctx context.Context, ref string) error
}
type Runner ¶
type Runner interface {
Close() error
Name() string
TestUsability(ctx context.Context) bool
// OCIImageLoader returns a Loader that will load an OCI image from a stream.
// It should return the Loader, which will be used to load the provided image
// as a tar stream into the Loader. That image will be used as the root when StartPod() the container.
OCIImageLoader() Loader
StartPod(ctx context.Context, cfg *Config) error
Run(ctx context.Context, cfg *Config, envOverride map[string]string, cmd ...string) error
TerminatePod(ctx context.Context, cfg *Config) error
// TempDir returns the base for temporary directory, or "" if whatever is provided by the system is fine
TempDir() string
// WorkspaceTar returns an io.ReadCloser that can be used to read the status of the workspace.
// The io.ReadCloser itself is a tar stream, which can be written to an io.Writer as is,
// or passed to an fs.FS processor
WorkspaceTar(ctx context.Context, cfg *Config, extraFiles []string) (io.ReadCloser, error)
// GetReleaseData returns the release data for the container's OS (os-release)
GetReleaseData(ctx context.Context, cfg *Config) (*apko_build.ReleaseData, error)
}
func BubblewrapRunner ¶
BubblewrapRunner returns a Bubblewrap Runner implementation.
func QemuRunner ¶ added in v0.11.3
func QemuRunner() Runner
QemuRunner returns a Qemu Runner implementation.
Click to show internal directories.
Click to hide internal directories.