apple / apple/container

[Request]: Clean container root fs and rw-mounted volumes periodically.

Open
#2,206 1 comment 1 reaction 0 assignees View on GitHub
enhancement storage
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### Feature or enhancement request details

Once #1949 is merged, we can implement periodic clean on containers so that filesystem blocks deallocated in Linux filesystems can be freed on the host. Today, the disk image files grow in size (number of allocated host blocks as shown by `ls -s`) but never decrease.

For short-running containers this is less of a problem, but longer running containers that frequently create and delete files (such as the builder) can consume quite a bit of host capacity.

A simple implementation is all that is necessary for now, something like running clean from a task in `container-runtime-linux` every hour, serialized such that only one of a scheduled clean and a user's `container clean` run at once.

@recrack if you want this one, please let us know in the comments and I'll assign you, since we took apple/containerization#838 and #1949 over your fixes.

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by reading the prerequisite issue #1949, then inspect the container-runtime-linux clean task and the existing user-facing `container clean` entry point. Implement an hourly periodic clean for containers, serialized so scheduled and user-triggered cleans cannot overlap, and verify that both paths still work without concurrent execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, swift
Domain
devops, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.