Skip to content

perf(local): prune olf's host Docker images and build cache after prefetch and on destroy (#1370 follow-up) #1372

Open

Description

@malon64

Follow-up to #1370.

Problem

After prefetch loads an image into the kind nodes, its copy in the host's Docker image store is no longer needed: pods run from the nodes' containerd. The build cache from olf's own local image builds (project-code, Superset) also keeps growing. On a machine running the local stack for a few weeks, read from docker system df:

Total Reclaimable
Images 61 GB (158) 42 GB
Build cache 37 GB (1038 entries) 4.9 GB (reported)
Local volumes 72 GB (18, 3 active) 4.5 GB

Scope

  1. After prefetch, and only for images olf itself pulled or tagged for loading (tools/olf/olf/infra/deployment/local/prefetch.py), remove the host copy. Never remove an image the user had before.
  2. On olf infra destroy for the local provider, prune what olf created:
    • images it pulled or built;
    • the build cache of its builds, scoped by label or builder;
    • nothing of the user's.
  3. Document the trade-off in docs/guides/local-installation.md: the next deploy pulls or rebuilds those images.
  4. If removing host copies would slow every redeploy, put it behind a flag, or make destroy-time pruning the default and post-prefetch pruning opt-in. Decide with measurements.

Done when

  • The disk freed is measured, on CI (docker system df at the end of local-full-e2e.yml) or locally.
  • The hardware table or troubleshooting notes in local-installation.md reflect it.
  • No user-owned image, container, volume or cache entry is ever removed. This is covered by a unit test.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions