Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Additional Layer Store] Use TOCDigest as ID of each layer #1673

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ ARG RUNC_VERSION=v1.1.12
ARG CNI_PLUGINS_VERSION=v1.4.1
ARG NERDCTL_VERSION=1.7.6

ARG PODMAN_VERSION=v5.0.2
ARG CRIO_VERSION=v1.30.0
ARG PODMAN_VERSION=v5.1.1
ARG CRIO_VERSION=main
ARG CONMON_VERSION=v2.1.11
ARG COMMON_VERSION=v0.58.2
ARG CRIO_TEST_PAUSE_IMAGE_NAME=registry.k8s.io/pause:3.6
Expand Down
5 changes: 2 additions & 3 deletions cmd/stargz-store/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,8 @@ func main() {
Fatalf("failed to prepare mountpoint %q", mountPoint)
}
}
if !config.Config.DisableVerification {
log.G(ctx).Warnf("content verification is not supported; switching to non-verification mode")
config.Config.DisableVerification = true
if config.Config.DisableVerification {
log.G(ctx).Fatalf("content verification can't be disabled")
}
mt, err := getMetadataStore(*rootDir, config)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions fs/layer/layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type Info struct {
FetchedSize int64 // layer fetched size in bytes
PrefetchSize int64 // layer prefetch size in bytes
ReadTime time.Time // last time the layer was read
TOCDigest digest.Digest
}

// Resolver resolves the layer location and provieds the handler of that layer.
Expand Down Expand Up @@ -415,6 +416,7 @@ func (l *layer) Info() Info {
FetchedSize: l.blob.FetchedSize(),
PrefetchSize: l.prefetchedSize(),
ReadTime: readTime,
TOCDigest: l.verifiableReader.Metadata().TOCDigest(),
}
}

Expand Down
1 change: 0 additions & 1 deletion script/demo-store/etc/stargz-store/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
metrics_address = "127.0.0.1:8234"
disable_verification = true
[[resolver.host."registry2-store:5000".mirrors]]
host = "registry2-store:5000"
insecure = true
10 changes: 9 additions & 1 deletion store/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,20 @@ func (n *layernode) Lookup(ctx context.Context, name string, out *fuse.EntryOut)
return nil, syscall.EIO
}
log.G(ctx).WithField(remoteSnapshotLogKey, prepareFailed).
WithField("layerdigest", n.digest).
WithField("digest", n.digest).
WithError(err).
Debugf("error resolving layer (context error: %v)", cErr)
log.G(ctx).WithError(err).Warnf("failed to mount layer %q: %q", name, n.digest)
return nil, syscall.EIO
}
if err := l.Verify(n.digest); err != nil {
log.G(ctx).WithField(remoteSnapshotLogKey, prepareFailed).
WithField("digest", n.digest).
WithError(err).
Debugf("failed to verify layer")
log.G(ctx).WithError(err).Warnf("failed to mount layer %q: %q", name, n.digest)
return nil, syscall.EIO
}
if name == blobLink {
sAttr := layerToAttr(l, &out.Attr)
cn := &blobnode{l: l}
Expand Down
Loading
Loading