Skip to content

Add support for stargz/estargz images #20154

@bdalpe

Description

@bdalpe

Describe the current behavior

Putting this in the backlog for future consideration.

Our current base image is roughly ~275MiB compressed before any additional code is added. For environments like AWS ECS Fargate, this image is pulled in entirety every single time a container starts which adds some latency to startup times.

docker manifest inspect -v prefecthq/prefect:3-latest | jq -r '[.[0].SchemaV2Manifest.layers[].size] | add' | numfmt --to=iec-i

272Mi

Most containers won't require the usage of every single byte in the image leading to wasted network bandwidth.

Describe the proposed behavior

By implementing this, we could speed up container start times and reduce the amount of network traffic required for starting a Prefect flow run:

Our analysis shows that pulling packages accounts for 76% of container start time, but only 6.4% of that data is read.

Additionally, update docs for using the eStargz format with customer image builds.

Example Use

https://github.com/moby/buildkit?tab=readme-ov-file#imageregistry

oci-mediatypes=true: use OCI mediatypes in configuration JSON instead of Docker's
compression=<uncompressed|gzip|estargz|zstd>: choose compression type for layers newly created and cached, gzip is default value. estargz should be used with oci-mediatypes=true.
compression-level=<value>: compression level for gzip, estargz (0-9) and zstd (0-22)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAn improvement of an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions