Commit Graph

8 Commits

Author SHA1 Message Date
Allison Karlitskaya 17fed70faf Cargo.toml: release 0.2.0
Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-06-02 15:09:47 +02:00
Allison Karlitskaya 42b9465363 .github/workflows: add some workflows
Copied and adapted from the composefs-rs repo.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-06-02 15:09:39 +02:00
Allison Karlitskaya 1bab06ca17 lib: drop the idea of multiple chunks per file
For Chunk::External we can theoretically return multiple chunks for
files that have been subdivided (by the rollsum, for example).  I think
it's time to lay this idea for rest, at least for the time being, and
improve the ergonomics and efficiency of the API by replacing the
Box<[ContentReference]> with a single ContentReference.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-06-02 15:02:25 +02:00
Allison Karlitskaya d04aeee081 examples: add a pull example
🦎

Use the oci-client crate to pull a zstd:chunked image using something
approximating a performant and robust downloader.

For now this just creates a "tmp" directory in the current directory and
puts the chunks there.  It doesn't actually do anything with the data
once it's downloaded, but at that point it would be easy to reassemble
it into some form.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-06-02 10:53:16 +02:00
Allison Karlitskaya 76d371f2ae lib: make annotation API more generic
I chose HashMap because it would work nicely with oci-spec, but
oci-client uses a BTreeMap instead.  Let's just use a getter function.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-06-02 10:44:41 +02:00
Allison Karlitskaya 64412acf4e lib: add missing fmt::Debug impls
Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-06-02 10:26:17 +02:00
Allison Karlitskaya f0b0705937 lib: performance improvements
Add a 'profiling' profile and make some initial changes based on the
results.

The big win: parsing JSON directly out of a zstd::Decoder turns out to
be pretty slow, even if we add a BufReader, so decompress it in one go
first and use the serde_json slice API on the result.

A smaller win: instead of using an iterator-based JSON parser for the
tar-split, just split on lines and parse each line separately.

Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-06-02 10:25:11 +02:00
Allison Karlitskaya 324a82a959 Initial commit
Signed-off-by: Allison Karlitskaya <allison.karlitskaya@redhat.com>
2025-05-29 02:06:15 +02:00