Commit Graph
11 Commits
Author SHA1 Message Date
Maksym Pavlenko 728093bdca snapshots/erofs: source pre-converted layers from a content cache
Add a layer_content_cache option to the erofs snapshotter: a directory of
pre-converted, diffID-keyed erofs layer blobs (in production a read-only
mountpoint-s3/FUSE mount) that the snapshotter sources layers from on pull
instead of downloading and converting them per node.

On an image-layer extraction Prepare, if the layer's blob is present in the
cache the snapshotter stages it as a symlink, commits it as the target
chainID in the same transaction, and returns ErrAlreadyExists. This uses the
existing remote-snapshot protocol, so containerd skips both the layer
download and the tar->erofs conversion; no core changes are needed. Any miss
(cache disabled, no snapshot.ref/diff-id labels, blob absent, unreadable
cache) falls through to the normal path, so pulls keep working.

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2026-07-21 09:43:41 -07:00
Chris Crone 773d3517dd erofs: align default mkfs block size across platforms
Force a 4K block size on all platforms rather than only on darwin.
An explicit caller-supplied -b is still respected.

Signed-off-by: Chris Crone <christopher.crone@docker.com>
2026-06-18 14:25:26 -04:00
Craig Gumbley 1a6bd7020a fix(erofs): set TMPDIR for mkfs.erofs on Windows
mkfs.erofs uses TMPDIR for its internal diskbuf temp files. Windows
does not set TMPDIR (only TEMP/TMP), so the MinGW binary falls back
to "/tmp" which resolves to C:\tmp. That directory does not exist on
most Windows machines. mkstemp fails, and erofs_diskbuf_init returns
ENOSPC regardless of actual errno, producing a misleading "No space
left on device" error even on disks with plenty of free space.

Set TMPDIR to the snapshot directory (parent of the output layer file)
for all mkfs.erofs invocations on Windows. This directory is managed
by containerd and guaranteed to exist. On Unix, TMPDIR is left to the
parent process (no change in behavior).

Signed-off-by: Craig Chelnak <craig.chelnak@docker.com>
2026-04-22 09:40:24 -07:00
ChengyuZhu6 b320d3c855 ctr: add EROFS image conversion support
Add EROFS conversion support to ctr convert command with configurable
options for tar-index mode and mkfs parameters.

Usage:
  ctr image convert --erofs src:tag dst:tag
  ctr image convert --erofs --erofs-compression='lz4hc,12' src:tag dst:tag

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
2026-04-15 10:28:47 +08:00
Aadhar Agarwal 220108e1cf erofs: Log mkfs command at Debug level
Change the mkfs.erofs command logging to Debug level in both
ConvertTarErofs and GenerateTarIndexAndAppendTar. This keeps
Info level quiet as intended per project conventions while
still making the commands visible for debugging.

Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
2026-01-27 21:38:16 +00:00
Aadhar Agarwal 52a92e83f0 erofs-differ: use same UUID append style in tar index mode as tar conversion mode
Use the same approach for appending UUID arguments in GenerateTarIndexAndAppendTar
as done in ConvertTarErofs for consistency between the two modes.

Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
2026-01-14 05:29:13 +00:00
Derek McGowan 2f75989e2a Update erofs to use mount transformers
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-10-14 22:53:43 -07:00
Derek McGowan 1adaf27c1e Update erofs to compile on Darwin
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-10-13 19:33:44 -07:00
Aadhar Agarwal b641933cfa erofs snapshotter: Add tar index mode
Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>

Minor style updates to erofs.md and differ_linux.go

Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>

Add use case for tar index in erofs.md

Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
2025-07-08 21:44:49 +00:00
Gao Xiang a0ed14fd48 erofs-differ: fix filesystem UUID for tar-converted layers
Derive filesystem UUIDs (`lsblk -o +UUID`) from the OCI layer digests
(although diffIDs are better in principle, but they're unavailable by
differs in advance) rather than generating a random one.  This allows
EROFS to uniquely identify each layer using the content-addressable
filesystem UUID.

It can also be used for reproducible builds. To achieve this, configure
`mkfs_options` with `-T0 --mkfs-time` (However, `--mkfs-time` requires
erofs-utils 1.8+; Otherwise, all inode timestamps will be reset w/o it):

``` toml
  [plugins."io.containerd.differ.v1.erofs"]
    mkfs_options = ["-T0 --mkfs-time"]
```

Fixes: c73c8e5d52 ("Introduce EROFS differ")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2025-07-02 08:25:50 +08:00
Derek McGowan 98eded24b8 Move erofsutils to internal
Avoid introducing utils package outside of internal. This package
should not be imported by other modules.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-04-22 09:03:49 -07:00