Repository navigation
Conversation
jiayimeow
force-pushed
the
imagecache-keep-mtimes
branch
from
October 5, 2026 18:21
bfa6b47 to
7978174
Compare
🚀 baseline-perf (PR · micro-VM · swebench-astropy-7336)📊 baseline-perf --compare (main vs PR) |
jiayimeow
force-pushed
the
imagecache-keep-mtimes
branch
from
October 5, 2026 20:13
7978174 to
8f60213
Compare
jiayimeow
force-pushed
the
imagecache-keep-mtimes
branch
from
October 12, 2026 22:49
8f60213 to
3e6103f
Compare
unpackLayer never applied the mtime recorded in a layer's tar headers, so every unpacked file and directory carried the time the node unpacked it. Python trusts a .pyc only while its source still has the mtime recorded in the .pyc, so every .pyc shipped in an image read as stale: each actor recompiled every module it imported and wrote the new .pyc files into its rootfs upper, which then went into every snapshot. The unpacked tree also differed from node to node, while restore relies on a deterministic unpack of the same image. Set each regular file's atime and mtime to its entry's mtime once the file is written. Do the same for each directory in the final pass that already restores directory modes, after all of its children are written. Symlinks keep the unpack time, since Chtimes would follow the link, and hard links share their target's inode.
jiayimeow
force-pushed
the
imagecache-keep-mtimes
branch
from
October 12, 2026 23:35
3e6103f to
65d6c86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
unpackLayer(internal/imagecache/unpack.go) never applies the mtime recorded in a layer's tar headers, so every file and directory in an unpacked image carries the time the node unpacked it.Python trusts a
.pyconly while its source still has the mtime recorded in the.pyc, so every.pycshipped in an image reads as stale. Each actor recompiles every module it imports, writes the new.pycfiles into its rootfs upper, and carries them in every snapshot from then on. The unpacked tree also differs from node to node, whilecmd/ateom-microvm/restore.gonotes that cross-node consistency relies on a deterministic unpack of the same image.Changes
Chtimesfollows the link. Hard links share their target's inode.TestUnpackLayer_RestoresModTimes.Impact (measured)
A/B on the same atelet build, with and without this change. The build is release-0.1 at fa6d949, whose
unpack.gois identical to main's.Without the change, the actor rewrote 663 of the image's
.pycfiles (11.9 MB). 662 of them hold the same bytecode as the shipped copy, apart from the embedded source path. The other one is a module the trace edits.Cold start from the golden snapshot showed no significant difference.
Testing
gofmt,go vet,golangci-lintandgo test -race ./internal/imagecache/...are clean. The new test fails without the fix.This package's root-gated tests weren't run locally; CI runs them under sudo.
The A/B above ran this change on a microVM cluster.
Tests pass
Appropriate changes to documentation are included in the PR (none needed)