Comments (2)
Copying some context
Ok, I finally got around to testing how this interacts with OverlayFS. The answer is that OverlayFS handles deleted files by creating "whiteouts" in higher layers. For example, if a lower layer has
dir/file
then a higher layer can delete it by containing a file nameddir/.wh.file
. This works with the change.For directories, overlayfs has an "opaque" xattr (
trusted.overlay.opaque=y
) which treats all files as deleted rather than having to explicitly create a whiteout file for each. In containers, this is encoded as a special.wh..wh..opq
file in a higher layer (.e.g. to delete all files in/bin
a higher layer would contain/bin/.wh..wh..opq
). So it's possible for the container image to contain an opaque directory with no xattrs. This change will disable xattrs and the directory will be populated at runtime.An example:
FROM alpine:latest RUN mkdir /dir && touch /dir/file1 /dir/file2 /dir/file3 RUN touch /dir/.wh..wh..opq
Without Soci:
# ls /dir #
With SOCI:
# ls /dir file1 file2 file3 #
The image spec says that whiteouts should be explicit, but to be spec compliant we must accept opaque directories. At a minimum, we should look for
.wh..wh..opq
files when determining if a layer has xattrs.
Taking a step back and considering #971, I think the real issue we have is that checking opaqueness is expensive. Each check goes through bbolt to see if a file exists. Since the lower layers are immutable, I think we could probably just push opaqueness up into the in-memory nodes.
I'm going to run some quick hard-coded benchmarks (normal, disableXattrs hard coded to true, isOpaque hard coded to false) to see how that compares.
from soci-snapshotter.
TL;DR GetXAttrs is an expensive operation and should be avoided unless necessary. Full testing and results on changes can be found here: #1021 (comment)
Operations that normally made significant calls to GetXAttrs would take up a nontrivial amount of CPU seconds due to checking if isOpaque
is true. #1021 fixed this by not making these calls on a layer-level unless the directory had opaque directories.
While we may want further iteration of this (i.e. see if we can make it more granular to avoid the call more often), the question and immediate problem at hand have been resolved, so this can be closed.
from soci-snapshotter.
Related Issues (20)
- [Bug] Container Ephemeral storage limit is not enforced when using SOCI Snapshotter. HOT 3
- [Bug] Extracting binaries of 0.5.0 requires the use of ./ prefix
- [FEATURE] Centralize our CLI Documentation HOT 1
- [FEATURE] Don't make registry calls when content has completed fetching HOT 2
- [Bug] Max concurrent uploads flag is unused HOT 2
- [Doc] Document zInfo binary format and implementation details HOT 1
- [Bug] ECR reauthentication on 403 does not seem to work HOT 7
- Update registry container image to v3.0.0
- [Bug] TestFuseOperationFailureMetrics fails on ARM64 HOT 1
- Return errors when creating SpanManager
- Switch to Alpine base for container images in integration tests
- [FEATURE] Set image tag when pushing a Soci index and an image index
- [FEATURE] Update docs/makefile for `command not found` after `make install` HOT 2
- [Bug] sh.R leaves open pipes HOT 2
- [FEATURE] Clean up integration test artifacts
- [Bug] Incorrect formatting for digest in SOCI index remove
- [FEATURE] Add test for container starting without internet access
- [FEATURE] Create ztoc in a single pass
- [Bug] SOCI snapshotter not working insecure container registry HOT 2
- [Bug] xattrs cannot be disabled on layers with volume mounts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soci-snapshotter.