Documentation
¶
Index ¶
- Constants
- func GenerateImageEnv(werfImageName, imageName string) string
- type BasePhase
- func (phase *BasePhase) AfterImageStages(ctx context.Context, img *image.Image) error
- func (phase *BasePhase) AfterImages(_ context.Context) error
- func (phase *BasePhase) BeforeImageStages(ctx context.Context, img *image.Image) (deferFn func(), err error)
- func (phase *BasePhase) BeforeImages(_ context.Context) error
- func (phase *BasePhase) ImageProcessingShouldBeStopped(_ context.Context, _ *image.Image) bool
- func (phase *BasePhase) OnImageStage(_ context.Context, _ *image.Image, _ stage.Interface) error
- type BuildOptions
- type BuildPhase
- func (phase *BuildPhase) AfterImageStages(ctx context.Context, img *image.Image) error
- func (phase *BuildPhase) AfterImages(ctx context.Context) error
- func (phase *BuildPhase) BeforeImageStages(ctx context.Context, img *image.Image) (deferFn func(), err error)
- func (phase *BuildPhase) BeforeImages(ctx context.Context) error
- func (phase *BuildPhase) Clone() Phase
- func (phase *BuildPhase) ImageProcessingShouldBeStopped(_ context.Context, _ *image.Image) bool
- func (phase *BuildPhase) Name() string
- func (phase *BuildPhase) OnImageStage(ctx context.Context, img *image.Image, stg stage.Interface) error
- func (phase *BuildPhase) Report() *ImagesReport
- type BuildPhaseOptions
- type Conveyor
- func (c *Conveyor) AppendOnTerminateFunc(f ConveyorCleanupFunc)
- func (c *Conveyor) Build(ctx context.Context, opts BuildOptions) ([]*ImagesReport, error)
- func (c *Conveyor) Export(ctx context.Context, opts ExportOptions) error
- func (c *Conveyor) ExportFromReport(ctx context.Context, opts ExportOptions) error
- func (c *Conveyor) FetchLastImageStage(ctx context.Context, targetPlatform, imageName string) error
- func (c *Conveyor) FindImage(targetPlatform, name string) (*image.Image, error)
- func (c *Conveyor) GetBaseImagesRepoErrCache(key string) error
- func (c *Conveyor) GetBaseImagesRepoIdsCache(key string) string
- func (c *Conveyor) GetExportedImages() (res []*image.Image)
- func (c *Conveyor) GetForcedTargetPlatforms() []string
- func (c *Conveyor) GetFullImageName(imageName string) (string, error)
- func (c *Conveyor) GetFullImageNameFromReport(ctx context.Context, imageName string) (string, error)
- func (c *Conveyor) GetImage(targetPlatform, name string) *image.Image
- func (c *Conveyor) GetImageContentTagDigest(targetPlatform, imageName string) string
- func (c *Conveyor) GetImageContentTagName(targetPlatform, imageName string) string
- func (c *Conveyor) GetImageContentTagStageID(targetPlatform, imageName string) string
- func (c *Conveyor) GetImageInfoGetters(opts imagePkg.InfoGetterOptions) ([]*imagePkg.InfoGetter, error)
- func (c *Conveyor) GetImageInfoGettersFromReport(ctx context.Context, opts imagePkg.InfoGetterOptions) ([]*imagePkg.InfoGetter, error)
- func (c *Conveyor) GetImageInfoGettersWithOpts(opts imagePkg.InfoGetterOptions) ([]*imagePkg.InfoGetter, error)
- func (c *Conveyor) GetImageNameForLastImageStageFromReport(image ReportImageRecord) string
- func (c *Conveyor) GetImageTargetPlatforms(targetImageName string) ([]string, error)
- func (c *Conveyor) GetImagesEnvArray() []string
- func (c *Conveyor) GetImagesEnvArrayFromReport(ctx context.Context) ([]string, error)
- func (c *Conveyor) GetImportServer(ctx context.Context, targetPlatform, imageName string, fromExternalImage bool) (import_server.ImportServer, error)
- func (c *Conveyor) GetOrCreateStageImage(name string, prevStageImage *stage.StageImage, stg stage.Interface, ...) *stage.StageImage
- func (c *Conveyor) GetRemoteGitRepo(key string) *git_repo.Remote
- func (c *Conveyor) GetServiceRWMutex(service string) *sync.RWMutex
- func (c *Conveyor) GetStageDigestMutex(stage string) *sync.Mutex
- func (c *Conveyor) GetStageImageByPlatform(name, targetPlatform string) *stage.StageImage
- func (c *Conveyor) GetTargetPlatforms() ([]string, error)
- func (c *Conveyor) GiterminismManager() giterminism_manager.Interface
- func (c *Conveyor) IsBaseImagesRepoErrCacheExist(key string) bool
- func (c *Conveyor) IsBaseImagesRepoIdsCacheExist(key string) bool
- func (c *Conveyor) ProjectName() string
- func (c *Conveyor) ResolveTargetPlatforms(imageName string) ([]string, error)
- func (c *Conveyor) SetBaseImagesRepoErrCache(key string, err error)
- func (c *Conveyor) SetBaseImagesRepoIdsCache(key, value string)
- func (c *Conveyor) SetRemoteGitRepo(key string, repo *git_repo.Remote)
- func (c *Conveyor) SetShouldAddManagedImagesRecords()
- func (c *Conveyor) SetStageImage(stageImage *stage.StageImage)
- func (c *Conveyor) ShouldAddManagedImagesRecords() bool
- func (c *Conveyor) ShouldBeBuilt(ctx context.Context, opts ShouldBeBuiltOptions) ([]*ImagesReport, error)
- func (c *Conveyor) Terminate(ctx context.Context) error
- func (c *Conveyor) UnsetStageImage(name string)
- func (c *Conveyor) UnsetStageImageByPlatform(name, targetPlatform string)
- func (c *Conveyor) UseLegacyStapelBuilder(cr container_backend.ContainerBackend) bool
- type ConveyorCleanupFunc
- type ConveyorOptions
- type ConveyorWithRetryWrapper
- type ExportOptions
- type Exporter
- type ImagesReport
- func (report *ImagesReport) SetCacheOperationsSummary(ctx context.Context, cache []opstats.CacheSummary)
- func (report *ImagesReport) SetImageByPlatformRecord(targetPlatform, name string, imageRecord ReportImageRecord)
- func (report *ImagesReport) SetImageRecord(name string, imageRecord ReportImageRecord)
- func (report *ImagesReport) SetOperationsSummary(ctx context.Context, operations []opstats.OperationSummary, ...)
- func (report *ImagesReport) ToEnvFileData() []byte
- func (report *ImagesReport) ToImageInfoGetters(opts imagePkg.InfoGetterOptions) []*imagePkg.InfoGetter
- func (report *ImagesReport) ToJsonData() ([]byte, error)
- type IntrospectOptions
- type IntrospectTarget
- type Phase
- type ReportCacheOperationRecord
- type ReportFormat
- type ReportImageRecord
- type ReportOperationRecord
- type ReportStageRecord
- type RuntimeInfo
- type ShouldBeBuiltOptions
- type StagesIterator
- func (iterator *StagesIterator) GetPrevBuiltImage(img *build_image.Image, stg stage.Interface) *stage.StageImage
- func (iterator *StagesIterator) GetPrevImage(img *build_image.Image, stg stage.Interface) *stage.StageImage
- func (iterator *StagesIterator) OnImageStage(ctx context.Context, img *build_image.Image, stg stage.Interface, ...) error
Constants ¶
View Source
const ( BaseImageSourceTypeRepo = "repo" BaseImageSourceTypeSecondary = "secondary" )
Variables ¶
This section is empty.
Functions ¶
func GenerateImageEnv ¶
Types ¶
type BasePhase ¶
type BasePhase struct {
Conveyor *Conveyor
}
func (*BasePhase) AfterImageStages ¶
func (*BasePhase) BeforeImageStages ¶
func (*BasePhase) ImageProcessingShouldBeStopped ¶
type BuildOptions ¶
type BuildOptions struct {
ImageBuildOptions container_backend.BuildOptions
IntrospectOptions
ReportPath string
ReportFormat ReportFormat
ReportOperations bool
SkipImageMetadataPublication bool
SkipAddManagedImagesRecords bool
CustomTagFuncList []imagePkg.CustomTagFunc
}
type BuildPhase ¶
type BuildPhase struct {
BasePhase
BuildPhaseOptions
StagesIterator *StagesIterator
ImagesReport *ImagesReport
// contains filtered or unexported fields
}
func NewBuildPhase ¶
func NewBuildPhase(c *Conveyor, opts BuildPhaseOptions) *BuildPhase
func (*BuildPhase) AfterImageStages ¶
func (*BuildPhase) AfterImages ¶
func (phase *BuildPhase) AfterImages(ctx context.Context) error
func (*BuildPhase) BeforeImageStages ¶
func (*BuildPhase) BeforeImages ¶
func (phase *BuildPhase) BeforeImages(ctx context.Context) error
func (*BuildPhase) Clone ¶
func (phase *BuildPhase) Clone() Phase
func (*BuildPhase) ImageProcessingShouldBeStopped ¶
func (*BuildPhase) Name ¶
func (phase *BuildPhase) Name() string
func (*BuildPhase) OnImageStage ¶
func (*BuildPhase) Report ¶
func (phase *BuildPhase) Report() *ImagesReport
type BuildPhaseOptions ¶
type BuildPhaseOptions struct {
BuildOptions
ShouldBeBuiltMode bool
}
type Conveyor ¶
type Conveyor struct {
ContainerBackend container_backend.ContainerBackend
StorageLockManager lock_manager.Interface
StorageManager manager.StorageManagerInterface
ConveyorOptions
// contains filtered or unexported fields
}
func NewConveyor ¶
func NewConveyor(werfConfig *config.WerfConfig, giterminismManager giterminism_manager.Interface, projectDir, baseTmpDir string, containerBackend container_backend.ContainerBackend, storageManager manager.StorageManagerInterface, storageLockManager lock_manager.Interface, opts ConveyorOptions) *Conveyor
func (*Conveyor) AppendOnTerminateFunc ¶
func (c *Conveyor) AppendOnTerminateFunc(f ConveyorCleanupFunc)
func (*Conveyor) Build ¶
func (c *Conveyor) Build(ctx context.Context, opts BuildOptions) ([]*ImagesReport, error)
func (*Conveyor) ExportFromReport ¶
func (c *Conveyor) ExportFromReport(ctx context.Context, opts ExportOptions) error
func (*Conveyor) FetchLastImageStage ¶
func (*Conveyor) GetBaseImagesRepoErrCache ¶
func (*Conveyor) GetBaseImagesRepoIdsCache ¶
func (*Conveyor) GetExportedImages ¶
func (*Conveyor) GetForcedTargetPlatforms ¶
func (*Conveyor) GetFullImageName ¶
func (*Conveyor) GetFullImageNameFromReport ¶
func (*Conveyor) GetImageContentTagDigest ¶
func (*Conveyor) GetImageContentTagName ¶
func (*Conveyor) GetImageContentTagStageID ¶
func (*Conveyor) GetImageInfoGetters ¶
func (c *Conveyor) GetImageInfoGetters(opts imagePkg.InfoGetterOptions) ([]*imagePkg.InfoGetter, error)
func (*Conveyor) GetImageInfoGettersFromReport ¶
func (c *Conveyor) GetImageInfoGettersFromReport(ctx context.Context, opts imagePkg.InfoGetterOptions) ([]*imagePkg.InfoGetter, error)
func (*Conveyor) GetImageInfoGettersWithOpts ¶
func (c *Conveyor) GetImageInfoGettersWithOpts(opts imagePkg.InfoGetterOptions) ([]*imagePkg.InfoGetter, error)
func (*Conveyor) GetImageNameForLastImageStageFromReport ¶
func (c *Conveyor) GetImageNameForLastImageStageFromReport(image ReportImageRecord) string
func (*Conveyor) GetImageTargetPlatforms ¶
func (*Conveyor) GetImagesEnvArray ¶
func (*Conveyor) GetImagesEnvArrayFromReport ¶
func (*Conveyor) GetImportServer ¶
func (c *Conveyor) GetImportServer(ctx context.Context, targetPlatform, imageName string, fromExternalImage bool) (import_server.ImportServer, error)
func (*Conveyor) GetOrCreateStageImage ¶
func (c *Conveyor) GetOrCreateStageImage(name string, prevStageImage *stage.StageImage, stg stage.Interface, img *image.Image) *stage.StageImage
func (*Conveyor) GetRemoteGitRepo ¶
func (*Conveyor) GetServiceRWMutex ¶
func (*Conveyor) GetStageDigestMutex ¶
func (*Conveyor) GetStageImageByPlatform ¶
func (c *Conveyor) GetStageImageByPlatform(name, targetPlatform string) *stage.StageImage
func (*Conveyor) GetTargetPlatforms ¶
func (*Conveyor) GiterminismManager ¶
func (c *Conveyor) GiterminismManager() giterminism_manager.Interface
func (*Conveyor) IsBaseImagesRepoErrCacheExist ¶
func (*Conveyor) IsBaseImagesRepoIdsCacheExist ¶
func (*Conveyor) ProjectName ¶
func (*Conveyor) ResolveTargetPlatforms ¶
func (*Conveyor) SetBaseImagesRepoErrCache ¶
func (*Conveyor) SetBaseImagesRepoIdsCache ¶
func (*Conveyor) SetRemoteGitRepo ¶
func (*Conveyor) SetShouldAddManagedImagesRecords ¶
func (c *Conveyor) SetShouldAddManagedImagesRecords()
func (*Conveyor) SetStageImage ¶
func (c *Conveyor) SetStageImage(stageImage *stage.StageImage)
func (*Conveyor) ShouldAddManagedImagesRecords ¶
func (*Conveyor) ShouldBeBuilt ¶
func (c *Conveyor) ShouldBeBuilt(ctx context.Context, opts ShouldBeBuiltOptions) ([]*ImagesReport, error)
func (*Conveyor) UnsetStageImage ¶
func (*Conveyor) UnsetStageImageByPlatform ¶
func (*Conveyor) UseLegacyStapelBuilder ¶
func (c *Conveyor) UseLegacyStapelBuilder(cr container_backend.ContainerBackend) bool
type ConveyorCleanupFunc ¶
type ConveyorOptions ¶
type ConveyorWithRetryWrapper ¶
type ConveyorWithRetryWrapper struct {
WerfConfig *config.WerfConfig
GiterminismManager giterminism_manager.Interface
ProjectDir string
BaseTmpDir string
ContainerBackend container_backend.ContainerBackend
StorageManager *manager.StorageManager
StorageLockManager lock_manager.Interface
ConveyorOptions ConveyorOptions
}
func NewConveyorWithRetryWrapper ¶
func NewConveyorWithRetryWrapper(werfConfig *config.WerfConfig, giterminismManager giterminism_manager.Interface, projectDir, baseTmpDir string, containerBackend container_backend.ContainerBackend, storageManager *manager.StorageManager, storageLockManager lock_manager.Interface, opts ConveyorOptions) *ConveyorWithRetryWrapper
func (*ConveyorWithRetryWrapper) Terminate ¶
func (wrapper *ConveyorWithRetryWrapper) Terminate() error
func (*ConveyorWithRetryWrapper) WithRetryBlock ¶
type ExportOptions ¶
type Exporter ¶
type Exporter struct {
ExportOptions
Conveyor *Conveyor
}
func NewExporter ¶
func NewExporter(c *Conveyor, opts ExportOptions) *Exporter
type ImagesReport ¶
type ImagesReport struct {
Runtime RuntimeInfo `json:"Runtime"`
Images map[string]ReportImageRecord
ImagesByPlatform map[string]map[string]ReportImageRecord
Operations map[string]ReportOperationRecord `json:"Operations,omitempty"`
CacheOperations map[string]map[string]ReportCacheOperationRecord `json:"CacheOperations,omitempty"`
StageCache map[string]int `json:"StageCache,omitempty"`
RegistryCache map[string]int `json:"RegistryCache,omitempty"`
Recovery map[string]int `json:"Recovery,omitempty"`
// contains filtered or unexported fields
}
func LoadBuildReportFromFile ¶
func LoadBuildReportFromFile(ctx context.Context, path string) (*ImagesReport, error)
func NewImagesReport ¶
func NewImagesReport() *ImagesReport
func (*ImagesReport) SetCacheOperationsSummary ¶ added in v3.7.0
func (report *ImagesReport) SetCacheOperationsSummary(ctx context.Context, cache []opstats.CacheSummary)
SetCacheOperationsSummary fills the CacheOperations section from the cache counters of the collector, keyed by operation and then by the caching layer the lookup went through. It is additive to SetOperationsSummary: the legacy StageCache/RegistryCache event sections keep their existing meaning.
func (*ImagesReport) SetImageByPlatformRecord ¶
func (report *ImagesReport) SetImageByPlatformRecord(targetPlatform, name string, imageRecord ReportImageRecord)
func (*ImagesReport) SetImageRecord ¶
func (report *ImagesReport) SetImageRecord(name string, imageRecord ReportImageRecord)
func (*ImagesReport) SetOperationsSummary ¶
func (report *ImagesReport) SetOperationsSummary(ctx context.Context, operations []opstats.OperationSummary, events []opstats.EventSummary)
func (*ImagesReport) ToEnvFileData ¶
func (report *ImagesReport) ToEnvFileData() []byte
func (*ImagesReport) ToImageInfoGetters ¶
func (report *ImagesReport) ToImageInfoGetters(opts imagePkg.InfoGetterOptions) []*imagePkg.InfoGetter
func (*ImagesReport) ToJsonData ¶
func (report *ImagesReport) ToJsonData() ([]byte, error)
type IntrospectOptions ¶
type IntrospectOptions struct {
Targets []IntrospectTarget
}
func (*IntrospectOptions) ImageStageShouldBeIntrospected ¶
func (opts *IntrospectOptions) ImageStageShouldBeIntrospected(imageName, stageName string) bool
type IntrospectTarget ¶
type Phase ¶
type Phase interface {
Name() string
BeforeImages(ctx context.Context) error
AfterImages(ctx context.Context) error
BeforeImageStages(ctx context.Context, img *image.Image) (deferFn func(), err error)
OnImageStage(ctx context.Context, img *image.Image, stg stage.Interface) error
AfterImageStages(ctx context.Context, img *image.Image) error
ImageProcessingShouldBeStopped(ctx context.Context, img *image.Image) bool
Clone() Phase
Report() *ImagesReport
}
type ReportCacheOperationRecord ¶ added in v3.7.0
ReportCacheOperationRecord counts the completed calls through one caching layer of one operation. Lookups is the sum of the three outcomes; the hit rate is derivable from Hit and Miss and is therefore not serialized.
type ReportFormat ¶
type ReportFormat string
const ( ReportJSON ReportFormat = "json" ReportEnvFile ReportFormat = "envfile" )
type ReportImageRecord ¶
type ReportImageRecord struct {
WerfImageName string
ConfigType string
DockerRepo string
DockerTag string
DockerImageID string
DockerImageDigest string
DockerImageName string
TargetPlatform string
Rebuilt bool
Final bool
Size int64
BuildTime string
Commit string
Stages []ReportStageRecord `json:"Stages,omitempty"`
StagesSkipped bool `json:"StagesSkipped,omitempty"`
}
type ReportOperationRecord ¶
type ReportStageRecord ¶
type RuntimeInfo ¶
type ShouldBeBuiltOptions ¶
type ShouldBeBuiltOptions struct {
SkipImageMetadataPublication bool
SkipAddManagedImagesRecords bool
CustomTagFuncList []imagePkg.CustomTagFunc
ReportPath string
ReportFormat ReportFormat
ReportOperations bool
}
type StagesIterator ¶
type StagesIterator struct {
Conveyor *Conveyor
PrevStage stage.Interface
PrevNonEmptyStage stage.Interface
PrevBuiltStage stage.Interface
PrevNonEmptyStageImageSize int64
}
func NewStagesIterator ¶
func NewStagesIterator(conveyor *Conveyor) *StagesIterator
func (*StagesIterator) GetPrevBuiltImage ¶
func (iterator *StagesIterator) GetPrevBuiltImage(img *build_image.Image, stg stage.Interface) *stage.StageImage
func (*StagesIterator) GetPrevImage ¶
func (iterator *StagesIterator) GetPrevImage(img *build_image.Image, stg stage.Interface) *stage.StageImage
func (*StagesIterator) OnImageStage ¶
func (iterator *StagesIterator) OnImageStage(ctx context.Context, img *build_image.Image, stg stage.Interface, onImageStageFunc func(img *build_image.Image, stg stage.Interface, isEmpty bool) error) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.