<br><br><div class="gmail_quote">On Mon, Nov 10, 2008 at 10:48 AM, Ben Hood <span dir="ltr"><<a href="mailto:0x6e6562@gmail.com">0x6e6562@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Edwin,<br>
<div class="Ih2E3d"><br>
On Sat, Nov 8, 2008 at 6:09 PM, Edwin Fine<br>
<<a href="mailto:rabbitmq-discuss_efine@usa.net">rabbitmq-discuss_efine@usa.net</a>> wrote:<br>
> In terms of an earlier email about how to package the clients and server, I<br>
> see it like this: repackage (and optionally refactor) the server into<br>
> server-specific components and common components. Make the common components<br>
> a separate Erlang app; ditto for client and server, and have the server and<br>
> client depend on this app. Put in checks on both server and client side that<br>
> they are running with a suitable version of the common app, and fail with a<br>
> clear warning message if this is not the case. Make it easy for users to<br>
> know which version of the common app the client or server depend on,<br>
> preferably a simple script that invokes Erlang to delve into the guts and<br>
> bring out the answer.<br>
<br>
</div>I for one would be interested to see if there is any value in turning<br>
Rabbit into a proper Erlang release. My knowledge on the subject is<br>
surface deep at best but it seems that there may be some nice to haves<br>
(e.g. code upgrades). At the end of the day, I shouldn't imagine that<br>
most users mind where the binaries sit and where the log file goes,<br>
just as long as there's an easy way to start and stop it, run<br>
rabbitmqctl and have the server boot on startup. Given the work that<br>
you've done in this context, could you map out in more concrete terms<br>
what this would look like?<br>
<font color="#888888"></font></blockquote><div><br>I use Erlware's sinan and faxien for packaging and distribution. They create "proper" Erlang releases, and make the whole thing much easier than trying to do it just with OTP. However, like any evolving open-source product, there are some rough edges and glitches, and less than perfect documentation, but overall I couldn't live without them. One downside is that I don't think it supports building on Windows - or is that an upside? ;)<br>
<br>Currently, I have two packaged applications that are rabbit-related, plus the off-the-shelf Rabbit server/broker itself, which runs on a different Erlang node. I've done nothing to the broker, which is installed and built the usual way.<br>
<br>Here's part of the output of my application:which_applications() - slightly enchanced to include the compile times of all apps - showing the two "home-grown" rabbit modules. The version numbers are added by me, based on 1.4.0, with any local modifications I have done bumping them up.<br>
<br><span style="font-family: courier new,monospace;">[{kernel,"ERTS CXC 138 10 2008-06-13 02:44:58 UTC", "2.12.3"},</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> {mnesia,"MNESIA CXC 138 12 2008-06-10 18:33:37 UTC", "4.4.3"},</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {eunit,"EUnit 2008-07-15 04:40:42 UTC","2.0"},</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> {ibrowse,"HTTP client application 2008-11-07 22:48:03 UTC", "1.4"},</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> {stdlib,"ERTS CXC 138 10 2008-06-10 18:29:39 UTC", "1.15.3"},</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">... snip ...</span><br style="font-family: courier new,monospace;">
<b style="font-family: courier new,monospace;"> {erlang_client,"RabbitMQ Erlang Client. 2008-11-07 22:48:03 UTC", "<a href="http://1.4.0.2">1.4.0.2</a>"},<br> {rabbitmq_common,"RabbitMQ modules common to client and server 2008-09-09 09:20:25 UTC", "1.4.0"},<br>
</b><span style="font-family: courier new,monospace;"> {yaws,"yaws WWW server 2008-11-07 22:47:59 UTC","1.77"},</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> {sasl,"SASL CXC 138 11 2008-06-10 18:27:34 UTC", "<a href="http://2.1.5.3">2.1.5.3</a>"}]</span><br>
<br>The contents of the rabbitmq_common directory are as follows:<br><br>./lib<br>./lib/rabbitmq_common<br>./lib/rabbitmq_common/include<br>./lib/rabbitmq_common/include/rabbit_framing_spec.hrl<br>./lib/rabbitmq_common/include/rabbit.hrl<br>
./lib/rabbitmq_common/include/rabbit_framing.hrl<br>./lib/rabbitmq_common/src<br>./lib/rabbitmq_common/src/rabbit_framing_channel.erl<br>./lib/rabbitmq_common/src/rabbit_misc.erl<br>./lib/rabbitmq_common/src/rabbit_writer.erl<br>
./lib/rabbitmq_common/src/rabbit_heartbeat.erl<br>./lib/rabbitmq_common/src/rabbit_binary_parser.erl<br>./lib/rabbitmq_common/src/rabbit_reader.erl<br>./lib/rabbitmq_common/src/rabbit_amqqueue.erl<br>./lib/rabbitmq_common/src/rabbit_framing.erl<br>
./lib/rabbitmq_common/src/rabbit_channel.erl<br>./lib/rabbitmq_common/src/rabbit_binary_generator.erl<br>./lib/rabbitmq_common/ebin<br>./lib/rabbitmq_common/ebin/rabbitmq_common.app ---> I had to write this one, but it's very simple<br>
./_build.cfg<br>./control<br><br>The _build.cfg is for the Sinan Erlang build application and looks like this:<br><br>project : {<br> name : rabbitmq_common,<br> vsn : "1.4.0"<br>},<br>repositories : ["<a href="http://0.0.0.0/erlware">http://0.0.0.0/erlware</a>", "<a href="http://repo.erlware.org/pub">http://repo.erlware.org/pub</a>"],<br>
build_dir : _build,<br>ignore_dirs : ["_", "."],<br>ignore_apps : [],<br>default_task : build<br><br>To build, I type in:<br><br>$ sinan<br>Starting run<br>[check_depends] start<br>[depends] Pulling eunit-2.0 from repository if non-local<br>
[depends] Pulling stdlib-1.15.3 from repository if non-local<br>[depends] Pulling kernel-2.12.3 from repository if non-local<br>[check_depends] stop<br>[build] start<br>[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_writer.erl<br>
[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_reader.erl<br>[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_misc.erl<br>[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_heartbeat.erl<br>
[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_framing.erl<br>[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_framing_channel.erl<br>
[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_channel.erl<br>[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_binary_parser.erl<br>
[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_binary_generator.erl<br>[build] Building /home/efine/work/integrat/rabbitmq_common/otp/lib/rabbitmq_common/src/rabbit_amqqueue.erl<br>
[build] stop<br>run complete<br><br>To create a distribution package, I type in<br><br>$ sinan dist<br><br>To publish the package to the repository servers (which are WebDAV-enabled Web servers), I just enter<br><br>$ faxien publish<br>
<br>To pull down the latest release from the repository servers on a server somewhere else in the world:<br><br>$ faxien install rabbitmq_common<br><br>The same goes for the erlang client.<br><br>One thing that must be mentioned is that sinan and faxien detect exactly which Erlang/OTP modules are being used and package only those modules with the application. That means that the application (e.g. rabbitmq_common) becomes completely standalone (embedded, really) and does not rely on whichever version of Erlang is actually installed on the target server.<br>
<br>Then, in my main application, my app file includes the following:<br><br>... snip ...<br> {applications,<br> [<br> kernel, <br> stdlib,<br> sasl,<br> mnesia,<br>
yaws,<br> erlang_client, % RabbitMQ client<br> rabbitmq_common, % Needed by above client!<br> hglib,<br> ibrowse<br> ]},<br><br>I could send you the contents of the directories of the rabbit_common and erlang_client (after all, it IS your code, just massaged a bit) if you want.<br>
<br>More later, gotta run.<br><br>Regards,<br>Ed<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><font color="#888888">
<br>
</font></blockquote></div><br>