Skip to content

Create a new layer for loader classes #20529

@nebhale

Description

@nebhale

This one is an observation for discussion rather than a requirement for improvement. At this time, Spring Boot's default OCI image layering strategy describes four layers:

  1. dependencies
  2. snapshot-dependencies
  3. resources
  4. application

There is, however, an implicit fifth layer containing (in a typical case):

  • META-INF/MANIFEST.MF
  • META-INF/maven/**
  • BOOT-INF/classpath.idx
  • BOOT-INF/layers.idx
  • org/springframework/boot/loader/**

My observation is that this final implicit layer mixes lifecycles. The contents of META-INF/MANIFEST.MF, META-INF/maven/**, and BOOT-INF/classpath.idx are broadly application-specific and change for every tagged version of an application while BOOT-INF/layers.idx and org/springframework/boot/loader/** are much more stable, and generally would be duplicate even across applications within an enterprise (given consistent versions of Boot).

The concrete result of this is that every single version of an application using this layering would end up with a layer that isn't de-duplicatable but contains (at the current time) 364K of duplicated files and 12K of unique files. I think we can all agree that this isn't the biggest inefficiency in a typical enterprise deployment system, but there is room for a big win both in cumulative storage and cumulative data transfer (i.e. deployment speed) if these files can be de-duped in a registry and cached at edge nodes.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions