减少钢筋生成的升级包的大小
我目前正在学习如何使用 rebar 进行 erlang 版本和版本升级。感谢 本教程 我已经能够成功生成发布和升级,但在此过程中出现了一个问题。
在我正在从事的项目中,重要的是版本升级尽可能小,因为它们是通过不可靠且缓慢的连接下载到嵌入式设备(例如 beagleboard)中的。
不幸的是,由 rebar 生成的 tar.gz 存档始终包含包含所有应用程序的完整版本。我想知道是否有一种方法可以进行工作版本升级,该版本仅包含新应用程序和更新的应用程序以减少存档大小。也许可以配置 reltool 来做到这一点?
感谢您的帮助。
I'm currently learning how to make erlang releases and release upgrades using rebar. Thanks to this tutorial I was already able to successfully generate releases and upgrades, but one issue has emerged during this.
In a project that I'm working on, it is important that release upgrades are as small as possible, because they are downloaded through unreliable and slow connection into an embedded device (e.g. beagleboard)
Unfortunately, tar.gz archives generated by rebar always contain a full release, with all applications. I was wondering if there is a method to make a working release upgrade that would contain only new applications and updated applications to reduce archive size. Maybe it is possible to configure reltool to do that?
Thanks for help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经写了一个关于这个问题的小指南,作为 Learn You Some Erlang 发布章节的一部分:
这是为了使事情变得更小而提供的发布文件之一:
这会去除调试信息,使应用程序文件尽可能小,删除测试文件,排除尽可能多的应用程序等。请注意,您至少需要包括SASL 和如果您希望人们能够对您的材料进行实时代码升级,请保留 debug_info。
总而言之,ERTS 本身需要 18.5MB。如果您使用上述规则,这将占用您的大部分空间,因此您必须检查是否可以从列表中删除一些可执行文件(非 SMP Erlang 等)。
I've written a small guide on the issue as part of Learn You Some Erlang's releases chapter:
Here's one of the release files presented to make things smaller:
This strips debug info, makes app files as small as possible, removes test files, excludes as many applications as possible, etc. Note that you will need to at least include SASL and keep the debug_info if you want people to be able to run live code upgrades of your material.
All in all, the ERTS itself takes 18.5MB. That's going to be most of your space if you use the rules above, so you have to check whether or not you can drop some executables (non-SMP Erlang, etc.) from the list.