Best practices for compressed source or low bandwidth links

Does Habitat have any best practices for optimizing package sizes for low bandwidth links? Today we ship the compressed binaries down to the remote site since bandwidth is limited.

Should I uncompress the binaries during build phase or would it be okay to uncompress after I’ve shipped the package to the remote site with something like an init hook?

It sounds like you want to save bandwidth during the runtime phase. With that in mind, your binaries are technically compressed inside the *.hart artifact (ref1: A Habitat .hart file screencast ref2: https://www.habitat.sh/docs/internals/#crypto-internals)

However nothing prevents you from implementing a step during the build phase to compress your binary even more before it is packaged inside the hart. Then during the runtime phase, you can do what you just mentioned have a step to uncompress during init hook.

I also concur with uncompressing after you shipped the package through an init hook.

awesome! thank you this is very helpful

1 Like