spinframework / spinframework/spin

OCI: improve archive layers algorithm

Open
#1,952 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/oci enhancement
Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

The first fix for https://github.com/fermyon/spin/issues/1787 used the following easy-mode algorithm to bundle multiple data files into a given layer assuming the application layer count would otherwise exceed a maximum (500 at time of writing).

The algorithm simply bundles all files under each directory entry in the component's files mount list into one .tar.gz blob layer each.

This leads to much fewer and much larger-sized layers, thus much less chance for parallelization. When combined with a machine that doesn't have great upload bandwidth, this can result in very slow spin registry push (or spin deploy) times.

  • Let's look into a smarter algorithm that is less sensitive to upload conditions (i.e. break up into more, smaller-sized layers while still staying under the max).
  • Also, double-check other opportunities for efficiency: are we re-pushing layers even if they already exist on the registry?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the OCI layer bundling used by spin registry push and spin deploy, then review the first fix in issue #1787. Done means producing more, smaller layers within the maximum layer count and determining whether existing registry layers can avoid being pushed again.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.