Add elfuse-oci pull into a local image store - #341
Conversation
|
Final switch of the open source library after trying out different projects and attempting to make it maintainable in the long run |
a5146cf to
b96a08d
Compare
|
Use shorter and still meaningful paths. e.g., |
There was a problem hiding this comment.
Checked and found sound, recording them so they do not get re-raised: --timeout really does bound the lock wait plus the whole transfer, because the deadline context is built before withLock and remote.Get threads it into the descriptor; authn.DefaultKeychain propagates config-load and helper errors instead of silently going anonymous, so the anonymous path only triggers on a genuinely absent entry; and v1.Hash.parse rejects any non-hex body and any algorithm other than sha256, so no reference or digest can walk out of filepath.Join.
The store design itself reads well. The pin table as a nested index annotated with org.opencontainers.image.ref.name is the right data structure, and it keeps elfuse itself free of OCI knowledge.
| if err != nil { | ||
| return v1.Descriptor{}, err | ||
| } | ||
| r, err := layer.Compressed() |
There was a problem hiding this comment.
A pull that fails partway leaves every layer already written in the store with nothing referencing it, and no subcommand removes it. Retry against a moved tag and the previous layers stay behind too, so the store grows without bound.
Either record what publishImage wrote and unwind on error, or land a prune subcommand and say so in docs/oci-images.md.
There was a problem hiding this comment.
As we have agreed in the previous iteration that we would not be handling OCI image lifecycle, this is intentionally left to the clean command to deal with (it's in the subsequent PR). WDYT?
Renamed. |
Publish canonical references and per-platform manifests through standard OCI indexes so layout readers can resolve the stored image. Use go-containerregistry for reference parsing and registry access.
Describe the OCI store, reference normalization, platform selection, credentials, timeouts, and pull validation. Add the command and environment surface to the user guide.
Summary by cubic
Adds
elfuse-oci, a Go CLI that pulls OCI images into a local store, keeping elfuse an OCI-agnostic runtime.New Features
pullfetches an image viago-containerregistryinto an OCI layout, pins it inindex.jsonby canonical ref and platform, and refuses a legacyrefs.jsonstore.--timeoutbounds the whole pull including the lock wait; a lock freed after the deadline is released, not used.--platformonly acceptslinux/arm64andlinux/amd64.mk/oci.mkaddselfuse-oci,oci-test, andoci-linttargets; CI runs race tests and lint on Linux.docs/oci-images.mdand the user guide.Written for commit 1b858e2. Summary will update on new commits.