evadne

evadne

Packmatic — On-the-fly Zip Generation

Packmatic generates Zip Streams by aggregating File or URL Sources.

Hex / GitHub

By using a Stream, the caller can compose it within the confines of Plug’s request/response model and serve the content of the resultant Zip acrhive in a streaming fashion. This allows fast delivery of a Zip archive consisting of many disparate parts hosted in different places, without having to first spool all of them to disk. The generated archive uses Zip64, and works with individual files that are larger than 4GB.

The Documentation contains a more detailed explanation of why it was built.

First 10 of 16 Posts! Switch mode

engineeringdept

engineeringdept

This looks great, thanks for releasing it.

evadne

evadne

:information_source: Packmatic 1.0.0 is now released. This release includes ahead-of-time verification enhancements for the Manifest, among other things. Changelog has been updated.

ananthakumaran

ananthakumaran

I am just wondering if you were aware of GitHub - ananthakumaran/zstream: An elixir library to write and read ZIP file in a streaming fashion · GitHub when you started the project. Seems like there is a major overlap in features between the two

evadne

evadne

Yes. It does not do Unicode names, Zip64, or provide easy Plug integration. Not does it seem to have support for URL based Sources or any Custom Source which was recently added. I have seen a few other libraries like these as well.

The reason of building Packmatic was to solve a specific implementation issue outlined in the rationale section (in the README). Nevertheless, availability of these libraries made the task of implementing Packmatic easier. I have noticed that your library is not acknowledged in the README section and I will do so in the next release.

LostKobrakai

LostKobrakai

So packmatic can do unicode filenames on win/mac? I recently found out :zip doesn‘t do so.

qhwa

qhwa

Thanks for releasing it! I am currently working on a project which requires some zip file processing. :zip works fine at this moment but in the recent future we will be generating zip files on-the-fly with url based remote files.

I feel your library is such a perfect fit. So glad to know it and definitely will give it a try. Thank you for sharing!

evadne

evadne

I believe it does if I have interpreted the specification correctly. Haven’t had any issues so far with our own use cases.

See this: Packmatic.Field.Local.FileHeader — Packmatic v2.0.0 (first item in Notes) and this: Packmatic.Field.Central.FileHeader — Packmatic v2.0.0 (also first item).

ananthakumaran

ananthakumaran

zip64 is a known issue, but I was assuming it does support utf8 filenames (bit 11 of general purpose flag is set)

sorentwo

sorentwo

Oban Core Team

I had some similar requirements a few months ago:

  1. UTF8 file names
  2. Stream file input
  3. Stream archive output

For our specific use case we needed to generate very large zips of video data without worrying about disk space. The goal was to create a multi part upload in S3 as the zip was created and to avoid disk writes altogether. The goal was to limit memory use to that of the largest video file. This was an unusual enough use case that I created a new library for it: zap.

Due to the specifics of the use case it doesn’t compress at all (though it could quite easily). Through the use of streams it accumulates inputs and periodically emits chunks of output suitable for S3. Since switching to zap we haven’t had any disk space issues.

Edit: I’m sharing in this thread in case others find themselves in a similar situation. Zap has a specific use case that is much narrower than packmatic, but we probably could have made packmatic work for our needs.

evadne

evadne

I shall add yours to the list as well. For S3 Multipart Uploads my preference would be to use a separate component to accumulate/buffer chunks as there is a limit on number of chunks, and another on size of chunks.

Further, within Packmatic, the URL Source reads in chunks as well (powered by ibrowse), so it could theoretically process source files that do not fit on the host.

The design rationale was driven by user experience. I wanted the download to start instantaneously, and this could only be achieved by not buffering anything at all prior to vending of the stream. Once the download starts the user will wait.

Last Post!

evadne

evadne

Packmatic 2.0.0 is out with some Zip64 changes and compatibility with the latest Elixir and Erlang/OTP versions. We have also changed the bundled URL source to use the excellent Req library. We have run this in production for some time and will continue to make changes as required. Thank-you to everybody who reported problems and contributed patches.

Hex Diff

Changed

  • Upgraded targeted Elixir and OTP versions

  • Revised URL Source

    • Changed iBrowse/HTTPotion to Req/Finch/Mint

    • Added dedicated Buffer capability

  • Added support for Extended Attributes

    • Added UID/GID information

    • Added support for default and custom File Modes

  • Added support for Compression Methods

    • Added support for STORE method

    • Cleaned up support for DEFLATE method

  • Enhanced Zip64 Compatibility

    • Fixed offset not always emitted in Zip64 format

    • Added offset in Zip64 Extended Information extra field

  • Enhanced macOS Compatibility

    • Fixed journaling to list all files in the order they were encoded

Where Next?

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
385 14863 120
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
zachdaniel
Introducing AshStorage! Attachment and file management that slots directly into your resources :smiling_face_with_sunglasses: I had hope...
New

Other Trending Topics Top

type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
bjorng
We want to introduce a new native datatype to Erlang: native records. Although replacing all tuple records with native records is not our...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
yureehuh
Introduction Founded in 2017 by landscape ecologist and fire mitigation expert Harry Statter, Frontline developed the first fully integra...
New

We're in Beta

About us Mission Statement