oci

package
v0.504.4 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FTLFullSchemaPath = "ftl-full-schema.pb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artefact

type Artefact struct {
	Digest   sha256.SHA256
	Metadata Metadata
	Content  io.ReadCloser
}

Artefact container for an artefact's payload and metadata

type ArtefactBlobs

type ArtefactBlobs struct {
	Digest    sha256.SHA256
	MediaType string
	Size      int64
}

type ArtefactConfig added in v0.504.4

type ArtefactConfig struct {
	Repository    Repository `help:"OCI container repository, in the form host[:port]/repository" env:"FTL_ARTEFACT_REPOSITORY"`
	Username      string     `help:"OCI container repository username" env:"FTL_ARTEFACT_REPOSITORY_USERNAME"`
	Password      string     `help:"OCI container repository password" env:"FTL_ARTEFACT_REPOSITORY_PASSWORD"`
	AllowInsecure bool       `help:"Allows the use of insecure HTTP based registries." env:"FTL_ARTEFACT_REPOSITORY_ALLOW_INSECURE"`
}

type ArtefactKey

type ArtefactKey struct {
	Digest sha256.SHA256
}

type ArtefactReader

type ArtefactReader interface {
	io.ReadCloser
}

type ArtefactRepository

type ArtefactRepository struct {
	ModuleDigest     sha256.SHA256
	MediaType        string
	ArtefactType     string
	RepositoryDigest digest.Digest
	Size             int64
}

type ArtefactService added in v0.504.3

type ArtefactService struct {
	// contains filtered or unexported fields
}

func NewArtefactService

func NewArtefactService(ctx context.Context, config ArtefactConfig) (*ArtefactService, error)

func NewNewArtefactServiceForTesting

func NewNewArtefactServiceForTesting() *ArtefactService

func (*ArtefactService) Download added in v0.504.3

func (s *ArtefactService) Download(ctx context.Context, dg sha256.SHA256) (io.ReadCloser, error)

func (*ArtefactService) DownloadArtifacts added in v0.504.3

func (s *ArtefactService) DownloadArtifacts(ctx context.Context, dest string, artifacts []*schema.MetadataArtefact) error

DownloadArtifacts downloads artefacts for a deployment from an OCI registry.

func (*ArtefactService) GetDigestsKeys added in v0.504.3

func (s *ArtefactService) GetDigestsKeys(ctx context.Context, digests []sha256.SHA256) (keys []ArtefactKey, missing []sha256.SHA256, err error)

func (*ArtefactService) GetRepository added in v0.504.3

func (s *ArtefactService) GetRepository() Repository

func (*ArtefactService) Upload added in v0.504.3

func (s *ArtefactService) Upload(ctx context.Context, artefact ArtefactUpload) error

Upload uploads the specific artifact as a raw blob and links it to a manifest to prevent GC

type ArtefactUpload

type ArtefactUpload struct {
	Digest  sha256.SHA256
	Size    int64
	Content io.ReadCloser
}

type DeploymentArtefactProvider

type DeploymentArtefactProvider func() (string, error)

type Image added in v0.504.4

type Image string

Image is a string that represents an OCI image. For example, "123456789012.dkr.ecr.us-west-2.amazonaws.com/ftl-tests/ftl-tests:latest"

type ImageConfig added in v0.504.4

type ImageConfig struct {
	AllowInsecureImages bool     `help:"Allows the use of insecure HTTP based registries." env:"FTL_IMAGE_REPOSITORY_ALLOW_INSECURE"`
	Registry            Registry `help:"Registry to use for the image service." env:"FTL_IMAGE_REGISTRY"`
	RepositoryTemplate  string   `` /* 127-byte string literal not displayed */
	TagTemplate         string   `help:"Tag template to use for the image service." env:"FTL_IMAGE_TAG_TEMPLATE" default:"$${tag}"`
}

type ImageService added in v0.504.3

type ImageService struct {
	// contains filtered or unexported fields
}

func NewImageService added in v0.504.3

func NewImageService(ctx context.Context, artefactService *ArtefactService, config *ImageConfig) (*ImageService, error)

func (*ImageService) BuildOCIImage added in v0.504.3

func (s *ImageService) BuildOCIImage(ctx context.Context, baseImage string, targetImage string, apath string, allArtifacts []*schema.MetadataArtefact, targets ...ImageTarget) error

func (*ImageService) BuildOCIImageFromRemote added in v0.504.3

func (s *ImageService) BuildOCIImageFromRemote(ctx context.Context, baseImage string, targetImage string, tempDir string, module *schema.Module, artifacts []*schema.MetadataArtefact, targets ...ImageTarget) error

func (*ImageService) Image added in v0.504.4

func (s *ImageService) Image(realm, module, tag string) Image

type ImageTarget

type ImageTarget func(ctx context.Context, s *ImageService, targetImage name.Tag, imageIndex v1.ImageIndex, image v1.Image, layers []v1.Layer) error

func WithLocalDeamon

func WithLocalDeamon() ImageTarget

func WithRemotePush

func WithRemotePush() ImageTarget

type Metadata

type Metadata struct {
	Executable bool
	Size       int64
	Path       string
}

Metadata container for an artefact's metadata

type Registry added in v0.504.3

type Registry string

Registry is a string that represents an OCI container registry. For example, "123456789012.dkr.ecr.us-west-2.amazonaws.com"

type ReleaseArtefact

type ReleaseArtefact struct {
	Artefact   ArtefactKey
	Path       string
	Executable bool
}

type Repository added in v0.504.3

type Repository string

Repository is a string that represents an OCI container repository. For example, "123456789012.dkr.ecr.us-west-2.amazonaws.com/ftl-tests"

Jump to

Keyboard shortcuts

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