Using rebar & reltool

89 views
Skip to first unread message

Julian Wachholz

unread,
May 31, 2014, 2:07:46 PM5/31/14
to chica...@googlegroups.com
Hi ChicagoBoss

Even though I'm quite the newbie to Erlang and still reading through Programming Erlang[1] I'd love to be able to do stuff cleanly.
So I've come across the Draw[2] example on Github and tried getting it to run on my own toy project that I use to learn CB with.
So far I've got it to compile, all that's needed now that my application is actually started and I can reach the site on localhost:8001.

Any hints or mistakes pointed out would be very helpful, this is all I've got so far: [3].

Cheers
Julian



Jesse Gumm

unread,
May 31, 2014, 5:21:40 PM5/31/14
to chica...@googlegroups.com
Reltool is a mysterious beast, and takes some finagling to truly tame
it. And *even then*, you never truly have it tamed.

What I'm planning on doing, as my learning experiment for a new tool
to add to CB is to use relx (https://github.com/erlware/relx) to
create releases. It's all the rage these days when it comes to
simplifying the confusion that comes with reltool, relup, and the
likes.

I spent weeks dancing with rebar and reltool, uncertain if certain
issues are user error, rebar's fault, or reltool's fault, and in the
end, there were issues with all three. And despite that time spent
working on reltool, I'm not even remotely comfortable with it.

My goal is going to be reworking the application creation process for
CB such that it will include a "make release" to use to make it
directly from your application. I would feel terrible if I have to
tell new users to dive into the reltool.config file to figure out
what's going on there.

I think releases are freaking amazing, and yet reltool is an exercise
in frustration. So if you're feeling saucy, feel free to jump into
relx and see if it isn't easier for you.

-Jesse
> --
> You received this message because you are subscribed to the Google Groups
> "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to chicagoboss...@googlegroups.com.
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/chicagoboss/22fb7bdd-30fe-46e0-943f-17c744f69440%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Julian Wachholz

unread,
Jun 2, 2014, 8:40:32 AM6/2/14
to chica...@googlegroups.com
Hi Jesse

Thanks for the hints, I tried my luck and so far it seems very
promising. But since CB still needs to compile the apps individually
I'm having some issues getting that to work, but it might be a start.
https://github.com/julianwachholz/hello_chicago/tree/feature/relx
Hopefully I can somehow help in this, having a nice release tool would
be infinitely useful.

Cheers
> To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/CAPTXyXcT1nN7PbNg-z8PeQazqAqFLYqAwiq-29AdK5Rf5AqMiA%40mail.gmail.com.

chan sisowath

unread,
Jun 2, 2014, 10:49:58 PM6/2/14
to chica...@googlegroups.com
the actual boss rebar plugin doing some something wrong with the vsn number of an given app, reltool use that number to generate the packaged application, i guess relx also.

then fix that number before doing make rel or make dist ;)

chan



chan sisowath

unread,
Jun 18, 2014, 5:35:35 AM6/18/14
to chica...@googlegroups.com
i just fixed draw to make it compile and start properly

>cd draw
>make dist


David Welton

unread,
Jul 3, 2014, 10:34:57 AM7/3/14
to chica...@googlegroups.com
On Sat, May 31, 2014 at 11:21 PM, Jesse Gumm <gu...@sigma-star.com> wrote:
> Reltool is a mysterious beast, and takes some finagling to truly tame
> it. And *even then*, you never truly have it tamed.
>
> What I'm planning on doing, as my learning experiment for a new tool
> to add to CB is to use relx (https://github.com/erlware/relx) to
> create releases. It's all the rage these days when it comes to
> simplifying the confusion that comes with reltool, relup, and the
> likes.
>
> I spent weeks dancing with rebar and reltool, uncertain if certain
> issues are user error, rebar's fault, or reltool's fault, and in the
> end, there were issues with all three. And despite that time spent
> working on reltool, I'm not even remotely comfortable with it.
>
> My goal is going to be reworking the application creation process for
> CB such that it will include a "make release" to use to make it
> directly from your application. I would feel terrible if I have to
> tell new users to dive into the reltool.config file to figure out
> what's going on there.
>
> I think releases are freaking amazing, and yet reltool is an exercise
> in frustration. So if you're feeling saucy, feel free to jump into
> relx and see if it isn't easier for you.

Any word on this?

Does CB play well with releases at this point even without this?

--
David N. Welton

http://www.welton.it/davidw/

http://www.dedasys.com/

Jesse Gumm

unread,
Jul 3, 2014, 7:22:29 PM7/3/14
to chica...@googlegroups.com
I haven't had a chance yet to tinker with CB and releases or relx yet.
I've been tinkering with SimpleBridge lately to finish up the 2.0
branch and knock out any more bugs (along with making a test suite for
it), and then updating CB to use it.

That said, I can't think of a reason why CB wouldn't work with
releases - it's a pretty standard Erlang app.

-Jesse
> --
> You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/CA%2Bb9R_vLnj4Z2%3DNgx0LiHTJ0wWuT1e_0HpqCc6%2BTYwvV2LKzDg%40mail.gmail.com.

David Welton

unread,
Jul 4, 2014, 8:23:25 AM7/4/14
to chica...@googlegroups.com
On Fri, Jul 4, 2014 at 1:22 AM, Jesse Gumm <gu...@sigma-star.com> wrote:
> I haven't had a chance yet to tinker with CB and releases or relx yet.
> I've been tinkering with SimpleBridge lately to finish up the 2.0
> branch and knock out any more bugs (along with making a test suite for
> it), and then updating CB to use it.
>
> That said, I can't think of a reason why CB wouldn't work with
> releases - it's a pretty standard Erlang app.

I've started looking at how it works, and there are some things I'm
unsure of. I'll try and post a working example once I have something.

Why are there a bunch of .app files in boss's ebin/ directory?

-rw-r--r-- 1 davidw davidw 2.8K Jun 9 16:19 ebin/boss.app
-rw-r--r-- 1 davidw davidw 292 Jun 9 16:16 ebin/boss_db_test.app
-rw-r--r-- 1 davidw davidw 317 Jun 9 16:16 ebin/boss_session_test.app
-rw-r--r-- 1 davidw davidw 365 Jun 9 16:16 ebin/boss_translator.app
-rw-r--r-- 1 davidw davidw 187 Jun 9 16:16 ebin/bson.app
-rw-r--r-- 1 davidw davidw 631 Jun 9 16:16 ebin/erlydtl.app
-rw-r--r-- 1 davidw davidw 673 Jun 9 16:16 ebin/medici.app
-rw-r--r-- 1 davidw davidw 335 Jun 9 16:16 ebin/mongodb.app

Jesse Gumm

unread,
Jul 4, 2014, 8:47:20 AM7/4/14
to chica...@googlegroups.com

Weird. I don't know.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
Visit this group at http://groups.google.com/group/chicagoboss.

David Welton

unread,
Jul 4, 2014, 8:56:43 AM7/4/14
to chica...@googlegroups.com
On Fri, Jul 4, 2014 at 2:47 PM, Jesse Gumm <gu...@sigma-star.com> wrote:

^^^^^^^^^^^^ enjoy your holiday! It's not a day off over here though.

> Weird. I don't know.

Can we nuke them and see if something breaks? :-)

David Welton

unread,
Jul 4, 2014, 11:04:49 AM7/4/14
to chica...@googlegroups.com
After fixing a CB bug, I've got something that at least starts without
doing a crash dump, but it's pretty far from working, it would seem.

Some things that will need work:

* Where does boss.config get copied?

* The various .app files need sorting out so that the right stuff gets
copied in, I think. I noticed that in boss.app.src, there are very
few dependencies listed. That's likely a bug of its own.

* I wonder about stuff in priv/init - with a release, applications can
be started properly, so maybe that's for the best...

* It seems to default to production. It'd probably be handy to be
able to use releases for development too, to test that everything is
in the right place anf functions. I'll have to see how that can be
accomplished.

Given all the above, I'm guessing no one has done this before?

David Welton

unread,
Jul 8, 2014, 10:15:11 AM7/8/14
to chica...@googlegroups.com
Ok, some progress!

I managed to build and run a release with relx.

-- relx.config --------------
{release, {myapp, "1.0.0"},
[
boss,
boss_db,
bson,
cowboy,
cowlib,
crypto,
dh_date,
edown,
epgsql,
erlando,
erlang_localtime,
erlmc,
erlware_commons,
erlydtl,
ets_cache,
eunit_formatters,
exec,
gen_leader,
gen_server2,
gen_smtp,
goldrush,
gproc,
ibrowse,
jaderl,
jsx,
lager,
lager_syslog,
mimetypes,
mochicow,
mochiweb,
myapp,
{observer, load},
os_mon,
poolboy,
protobuffs,
qdate,
ranch,
rebar_vsn_plugin,
redo,
{runtime_tools, load},
simple_bridge,
syntax_tools,
syslog,
tiny_pq,
tinymq,
{wx, load}
]}.
{extended_start_script, true}.

{sys_config, "./boss.config"}.
{vm_args, "./vm.args"}.
----

-- vm.args ----------------
-setcookie somecookie
-name my...@localhost.localdomain
---------------------------------

It does require my fork of boss_db, which is getting somewhat ahead of
the CB one. In particular, boss_db.app.src does not have a lot of its
dependencies listed in 'applications'.

So far it seems to run in production mode by default.

I think the list of stuff included needs some tuning, which I'll be doing.

This is definitely the direction to take for deployment, in my opinion.

Jesse Gumm

unread,
Jul 9, 2014, 12:51:50 PM7/9/14
to chica...@googlegroups.com
Very cool, David!

Today's project is dedicated to merging all the new CB stuff.
> --
> You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/CA%2Bb9R_ukaLi9MonCgUaOj0VyawQEiS0ihEBYhkXBEg1K8aRJOg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



Reply all
Reply to author
Forward
0 new messages