如何避免Edeliver部署错误:"vm.args:没有这样的文件或目录"?

nel*_*nic 10 deployment elixir phoenix-framework edeliver distillery

上下文

我们正尝试将edeliverPhoenix Web应用程序的"热升级"部署到远程虚拟机实例.

我们的目标是每次都构建应用程序的"升级"版本,以便应用程序可以在生产中"热"升级而无需任何停机时间.

我们成功地在"Hello World"凤凰应用程序上进行了"热升级":https: //github.com/nelsonic/hello_world_edeliver,当构建通过时,它会自动从Travis-CI部署.请参阅:https://travis-ci.org/nelsonic/hello_world_edeliver/builds/259965752#L1752

因此,理论上这种技术应该适用于我们的"真实"应用程序.

尝试使用Edeliver部署"真正的"Phoenix应用程序

执行以下命令(构建升级):

mix edeliver build upgrade --auto-version=git-revision --from=$(git rev-parse HEAD~) --to=$(git rev-parse HEAD) --verbose
Run Code Online (Sandbox Code Playgroud)

即"构建从以前的git版本到当前版本的升级"

到现在为止还挺好." 发布成功! "

edeliver升级 - 构建 - 成功

错误: vm.args: No such file or directory

当我们尝试部署升级时:

mix edeliver deploy upgrade to production --version=1.0.3+86d55eb --verbose
Run Code Online (Sandbox Code Playgroud)

vm.args-没有这样的文件,或目录

cat: /home/hladmin/healthlocker/releases/1.0.3+86d55eb/vm.args: No such file or directory
Run Code Online (Sandbox Code Playgroud)

注意:我们有一个小的bash脚本,它读取可用的最新升级版本.deliver/releases并进行部署,看看:version.sh

题:

有没有办法忽略vm.args文件的缺失并继续部署?

或者,如果需要文件来完成部署,是否有一些关于如何创建文件的文档?

注意:我们已经阅读了酿酒厂的"运行时配置"文档:https://github.com/bitwalker/distillery/blob/master/docs/Runtime%20Configuration.md,遗憾的是没有更明智的......

附加信息

环境

这个问题也被问到:https://github.com/edeliver/edeliver/issues/234

小智 1

As mentioned by others, the vm.args file is necessary for BEAM to run the release. A default file is created by distillery during the release build process and should be located in releases/<version>/vm.args. From your log output it looks like expected directory is being checked.

  • Can you show us the contents of /home/hladmin/healthlocker/releases/?
  • Can you confirm that the default vm.args file is being created when building the release and extracting it (outside of the upgrade process)?

You also asked:

Or if the file is required to complete the deployment, is there some documentation on how to create the file?

If diagnosing the problem with the default vm.args file doesn't get you anywhere, you can also write your own file and configure distillery to use that file instead of the default. The details for this are in the distillery configuration docs. In short, add the vm_args setting to your distillery config, which should be at rel/config.exs(relative to your project root), for example:

environment :prod do
  set vm_args: "<path>/vm.args"
  [...]
end
Run Code Online (Sandbox Code Playgroud)