简体   繁体   English

将Rails应用程序编译为Heroku之外的块是否有好处? 可以做成非Heroku的吗?

[英]Is there a benefit to Rails apps being compiled to slugs outside of Heroku? Can you make a non-Heroku slug?

Is there a spec, whitepaper, anything at all out there, regarding what a slug is in the Heroku context? 是否有关于Heroku上下文中的子弹的规范,白皮书或其他内容? I've always noticed how Heroku compiles Rails apps into slugs, increasing performance, at least within their proprietary environment. 我一直注意到Heroku如何将Rails应用程序编译为块,从而至少在其专有环境中提高性能。

Is there a way to do this outside of Heroku, and/or take advantage of it within a different environment? 有没有办法在Heroku之外进行此操作,和/或在其他环境中利用它?

As pointed out by John Beynon above, the 'compilation' is another name for the build pack process. 正如上面的John Beynon指出的那样,“编译”是构建包过程的另一个名称。 When you push your code to Heroku we resolve all depedencies and TGZ the resulting package into a "slug". 当您将代码推送到Heroku时,我们将解决所有缺陷,并将生成的程序包TGZ打包成“段”。

The process is open source, with full documentation and links to the various supported buildpacks on our devcenter . 该过程是开源的,具有完整的文档以及指向我们devcenter上各种受支持的buildpack的链接 If you want the technical details of exactly what goes on, refer to the buildpack api doc . 如果您想要确切的技术细节,请参考buildpack api doc

We have already seen some other platforms start to adopt buildpacks. 我们已经看到其他一些平台开始采用buildpack。 It would be great to see anyone who likes adopt them and provide feedback. 希望看到任何喜欢的人采纳并提供反馈意见。

I've not seen any documentation aside from this but it's not 'compiling' in the traditional sense of the word. 我从来没见过任何文档除了这个 ,但是在这个词的传统意义上它不是“编译”。

They take the git repo you have pushed your application into, remove the .git directory, clean up unnecessary directories, process .slugignore file to remove any bits you don't need at runtime (like tests etc, etc), they then include dependencies and then create a smaller version of your application which is more easily distributed across the dyno grid. 它们将您已将应用程序推送到的git repo,删除.git目录,清理不必要的目录,处理.slugignore文件以删除运行时不需要的任何位(例如测试等),然后包括依赖项然后创建应用程序的较小版本,该版本更容易在dyno网格中分布。 The smaller your slug size the faster it is to scale your application because each dyno you add receives a fresh copy of the 'compiled' slug. 块的大小越小,扩展应用程序的速度就越快,因为添加的每个dyno都会收到“编译”块的新副本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM