Documentation ¶
Index ¶
- Constants
- type BuildOptions
- type BuildReport
- type Farm
- func CreateFarm(ctx context.Context, name string) (*Farm, error)
- func NewAdHocFarm(ctx context.Context, destinations []string, storeOptions *storage.StoreOptions, ...) (*Farm, error)
- func NewDefaultFarm(ctx context.Context, storeOptions *storage.StoreOptions, flags *pflag.FlagSet) (*Farm, error)
- func NewFarm(ctx context.Context, name string, storeOptions *storage.StoreOptions, ...) (*Farm, error)
- func UpdateFarm(ctx context.Context, add, remove []string) (*Farm, error)
- func (f *Farm) Build(ctx context.Context, reference string, schedule Schedule, ...) error
- func (f *Farm) Done(ctx context.Context) error
- func (f *Farm) EmulatedPlatforms(ctx context.Context) ([]string, error)
- func (f *Farm) NativePlatforms(ctx context.Context) ([]string, error)
- func (f *Farm) PruneImages(ctx context.Context, options PruneImageOptions) (map[string]PruneImageReport, error)
- func (f *Farm) Schedule(ctx context.Context, platforms []string) (Schedule, error)
- func (f *Farm) Status(ctx context.Context) (map[string]error, error)
- type ImageBuilder
- func NewDockerImageBuilder(ctx context.Context, flags *pflag.FlagSet, name string) (ImageBuilder, error)
- func NewPodmanLocalImageBuilder(ctx context.Context, flags *pflag.FlagSet, storeOptions *storage.StoreOptions) (ImageBuilder, error)
- func NewPodmanRemoteImageBuilder(ctx context.Context, flags *pflag.FlagSet, name string) (ImageBuilder, error)
- type Info
- type InfoOptions
- type ListBuilder
- type ListBuilderOptions
- type PruneImageOptions
- type PruneImageReport
- type PullToFileOptions
- type PullToLocalOptions
- type RemoveImageOptions
- type Schedule
Constants ¶
const (
LocalImageBuilderName = "(local)"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildOptions ¶
type BuildOptions struct { OutputFormat string Out io.Writer Err io.Writer ForceRemoveIntermediateContainers bool RemoveIntermediateContainers bool RemoveIntermediateImages bool PruneImagesOnSuccess bool Platforms []struct{ OS, Arch, Variant string } Pull bool IIDFile string ContextDirectory string Labels []string Args map[string]string ShmSize string Ulimit []string Memory int64 MemorySwap int64 CPUQuota int64 CPUPeriod uint64 CPUSetCPUs string CPUSetMems string CgroupParent string NoCache bool Quiet bool CacheFrom []reference.Named CacheTo []reference.Named AddHost []string Target string ConfigureNetwork *bool }
type BuildReport ¶
type Farm ¶
type Farm struct {
// contains filtered or unexported fields
}
Farm represents a group of connections to builders.
func CreateFarm ¶
CreateFarm creates an empty farm which will use a set of named connections which will be added to it later.
func NewAdHocFarm ¶
func NewAdHocFarm(ctx context.Context, destinations []string, storeOptions *storage.StoreOptions, flags *pflag.FlagSet) (*Farm, error)
NewAdHocFarm returns a Farm that uses the specified system connections and which has no name. If storeOptions is not nil AND the list of destinations includes the empty string, the local system will be included as an unnamed connection.
func NewDefaultFarm ¶
func NewDefaultFarm(ctx context.Context, storeOptions *storage.StoreOptions, flags *pflag.FlagSet) (*Farm, error)
NewDefaultFarm returns a Farm that uses all known system connections and which has no name. If storeOptions is not nil, the local system will be included as an unnamed connection.
func NewFarm ¶
func NewFarm(ctx context.Context, name string, storeOptions *storage.StoreOptions, flags *pflag.FlagSet) (*Farm, error)
NewFarm returns a Farm that has a preconfigured set of system connections.
func UpdateFarm ¶
UpdateFarm updates a farm, adding and removing the set of named connections to/from it, respectively.
func (*Farm) Build ¶
func (f *Farm) Build(ctx context.Context, reference string, schedule Schedule, containerFiles []string, options BuildOptions) error
Build runs a build using the specified targetplatform:service map. If all builds succeed, it copies the resulting images from the remote hosts to the local service and builds a manifest list with the specified reference name.
func (*Farm) EmulatedPlatforms ¶
EmulatedPlatforms returns a list of the set of platforms for which the farm can build images with the help of emulation.
func (*Farm) NativePlatforms ¶
NativePlatforms returns a list of the set of platforms for which the farm can build images natively.
func (*Farm) PruneImages ¶
func (f *Farm) PruneImages(ctx context.Context, options PruneImageOptions) (map[string]PruneImageReport, error)
PruneImages, well, prunes unused images from each of the builders. We remove images that we build after we've downloaded them when the Rm flag is true, which is its default, but that still leaves base images that we caused to be pulled lying around.
func (*Farm) Schedule ¶
Schedule takes a list of platforms and returns a list of connections which can be used to build for those platforms. It always prefers native builders over emulated builders, but will assign a builder which can use emulation for a platform if no suitable native builder is available.
If platforms is an empty list, all available native platforms will be scheduled.
TODO: add (Priority,Weight *int) a la RFC 2782 to destinations that we know of, and factor those in when assigning builds to nodes in here.
type ImageBuilder ¶
type ImageBuilder interface { Driver(ctx context.Context) string Name(ctx context.Context) string Status(ctx context.Context) error Info(ctx context.Context, options InfoOptions) (*Info, error) NativePlatforms(ctx context.Context, options InfoOptions) ([]string, error) EmulatedPlatforms(ctx context.Context, options InfoOptions) ([]string, error) Build(ctx context.Context, reference string, containerFiles []string, options BuildOptions) (BuildReport, error) PullToFile(ctx context.Context, options PullToFileOptions) (reference string, err error) PullToLocal(ctx context.Context, options PullToLocalOptions) (reference string, err error) RemoveImage(ctx context.Context, options RemoveImageOptions) error PruneImages(ctx context.Context, options PruneImageOptions) (PruneImageReport, error) Done(ctx context.Context) error }
ImageBuilder is a subset of the entities.ImageEngine interface.
func NewDockerImageBuilder ¶
func NewDockerImageBuilder(ctx context.Context, flags *pflag.FlagSet, name string) (ImageBuilder, error)
NewDockerImageBuilder creates an ImageBuilder which uses a docker engine.
func NewPodmanLocalImageBuilder ¶
func NewPodmanLocalImageBuilder(ctx context.Context, flags *pflag.FlagSet, storeOptions *storage.StoreOptions) (ImageBuilder, error)
NewPodmanLocalImageBuilder creates an ImageBuilder which uses libpod to directly perform a build.
func NewPodmanRemoteImageBuilder ¶
func NewPodmanRemoteImageBuilder(ctx context.Context, flags *pflag.FlagSet, name string) (ImageBuilder, error)
NewPodmanRemoteImageBuilder creates an ImageBuilder which uses a remote connection to a podman service running somewhere else.
type InfoOptions ¶
type InfoOptions struct { }
type ListBuilder ¶
type ListBuilder interface {
Build(ctx context.Context, images map[BuildReport]ImageBuilder) (string, error)
}
func NewFileListBuilder ¶
func NewFileListBuilder(directory string, options ListBuilderOptions) (ListBuilder, error)
NewFileListBuilder returns a manifest list builder which saves a manifest list and images to a specified directory in the non-standard dir: format.
func NewPodmanLocalListBuilder ¶
func NewPodmanLocalListBuilder(listName string, flags *pflag.FlagSet, storeOptions *storage.StoreOptions, options ListBuilderOptions) (ListBuilder, error)
NewPodmanLocalListBuilder returns a manifest list builder which saves a manifest list and images to local storage.
type ListBuilderOptions ¶
type PruneImageOptions ¶
type PruneImageOptions struct {
All bool
}
type PruneImageReport ¶
type PullToFileOptions ¶
type PullToLocalOptions ¶
type PullToLocalOptions struct { ImageID string SaveFormat string Destination entities.ImageEngine }
type RemoveImageOptions ¶
type RemoveImageOptions struct {
ImageID string
}