What are best practices for making Erlang releases?

后端 未结 2 1730
南旧
南旧 2021-02-06 13:38

I\'ve been checking out Faxien+Sinan and Rebar, and the basic philosophy of Erlang OTP seems to be, install applications and releases on a single Erlang image instance. What ar

2条回答
  •  暖寄归人
    2021-02-06 14:22

    I'll describe the approach that currently works for me for regular (often daily) releases to a small number of instances on EC2:

    1. I set up my project with rebar and check it into github.
    2. All of my dependencies are listed in my rebar.config file (they too are on github).
    3. My Makefile looks similar to what I described here.
    4. My EC2 image only has a regular build of erlang and no other libs installed by default.
    5. To create a new node, I spin up an instance, clone my git repository, and run make. This will fetch my dependencies and build everything.
    6. To update my code I do a git pull and a rebar update-deps. Depending on what changed I may restart the node or, quite often, I'll attach to the running node and reload the updated modules. It helps to have start and attach scripts as part of your project.

    It may be helpful to look at how a project like webmachine is packaged.

    I don't know much about the standard OTP release management system, other than it looks like a lot of work. Because this seems counter to rapid deployment, I never gave it a serious try - though I'm certain it makes sense for other projects.

提交回复
热议问题