Chapter 10. Packaging, services, and deployment
This chapter covers
- Target systems, applications, and releases
- How to define a release, and how to start it
- Packaging and installation of releases
By now, you’ve learned how to employ OTP behaviours, create proper OTP applications, handle logging and events, write distributed applications, and use the Mnesia database. That’s no small accomplishment. Your next task is to take all your code and wrap it up in a way that makes it ready to deploy.
OTP applications provide convenient units of functionality, but only on the Erlang programming level. To build a complete standalone software service—something that runs on one or more machines on your network and communicates with your other systems and with your users—you must typically combine a number of such applications that will run on a single Erlang runtime system. In OTP, such a higher-level package is called a release, and the result of installing a release on some host machine is called a target system.
A target system generally only includes those applications that are needed for it to work as a service, as opposed to a standard Erlang/OTP distribution that contains a large number of applications, including graphical runtime tools such as those you saw in chapter 5. Minimally, a target system must contain the stdlib and kernel applications (apart from your own applications), and often the SASL application is also needed to support logging.