# user(s) | 386 |
# project(s) | 14 |
# build(s) | 3075 |
# transform(s) | 60 |
Avg build time | 11.0s |
Queue len | 0 (0.0) |
Status | idle |
The following steps will let you create a bootable Xen guest image within approximately 5 minutes. The recipe assumes that you have rebar – the build tool from Basho – installed.
1. Create a sample rebar-based project.
mkdir sample1 cd sample1 rebar create-app appid=sample1 rm src/sample1_* cat >src/sample1.erl -module(sample1). -compile(export_all). hello() -> hi. ^D
2. Create rebar.config.
cat >rebar.config {plugins,[ling_builder]}. {deps,[{ling_builder,".*", {git,"git://github.com/maximk/ling_builder.git","master"}}]}. {ling_builder_opts,[{build_host,"build.erlangonxen.org"}, {username,"test"}, {password,"test"}]}. ^D
3. Fetch dependencies and build the project.
rebar get-deps rebar compile
4. Enqueue the project with the Erlang on Xen Build Service.
rebar ling-build-image
The command reports that the image is written to ‘vmling’.
5. Create a domain configuration file.
cat >domain_config kernel = "vmling" name = "sample1" memory = 512 ^D
6. Boot the Xen image by running the following command as root.
xl create -c domain_config
The boot process should culminate in the standard Erlang shell prompt. Beware that the recipe uses public ‘test’ account. To have a bit of a private space, you need to register and update your rebar.config accordingly.
7. Run the application code.
sample1:hello().