Merge lp:~eday/burrow/bootstrap into lp:~burrow-core/burrow/cactus

Proposed by Eric Day
Status: Merged
Approved by: Eric Day
Approved revision: 2
Merged at revision: 2
Proposed branch: lp:~eday/burrow/bootstrap
Merge into: lp:~burrow-core/burrow/cactus
Diff against target: 738 lines (+661/-0)
14 files modified
.bzrignore (+4/-0)
README (+52/-0)
apps/burrow/src/burrow.app.src (+30/-0)
apps/burrow/src/burrow.erl (+49/-0)
apps/burrow/src/burrow_app.erl (+32/-0)
apps/burrow/src/burrow_sup.erl (+32/-0)
rebar.config (+20/-0)
rel/files/app.config (+21/-0)
rel/files/burrow (+155/-0)
rel/files/erl (+34/-0)
rel/files/nodetool (+138/-0)
rel/files/vm.args (+32/-0)
rel/reltool.config (+46/-0)
start (+16/-0)
To merge this branch: bzr merge lp:~eday/burrow/bootstrap
Reviewer Review Type Date Requested Status
Devin Carlen Approve
Vish Ishaya Approve
Review via email: mp+50848@code.launchpad.net

Description of the change

Created initial OTP application and supervisor skeleton. Also includes README and configuration for building releases.

To post a comment you must log in.
Revision history for this message
Vish Ishaya (vishvananda) wrote :

Is there any reason to go through the approval process for the first few releases? It seems like overkill if you are the only one currently committing code. That said, i branched and ran the coverage tests and managed to start the application so that is an lgtm from me.

review: Approve
Revision history for this message
Eric Day (eday) wrote :

I think there is still value in it to make sure I'm not screwing anything up. I can just commit straight to trunk and ping you guys if you'd rather not use this process though. :)

Revision history for this message
Devin Carlen (devcamcar) wrote :

approve

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

The attempt to merge lp:~eday/burrow/bootstrap into lp:burrow failed. Below is the output from the failed tests.

/usr/bin/env: escript: No such file or directory

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

The attempt to merge lp:~eday/burrow/bootstrap into lp:burrow failed. Below is the output from the failed tests.

==> burrow (compile)
Compiled src/burrow_app.erl
Compiled src/burrow.erl
Compiled src/burrow_sup.erl
==> rel (compile)
==> tmpzx6Ljg (compile)
==> burrow (eunit)
src/burrow.erl:41: can't find include lib "eunit/include/eunit.hrl"
src/burrow.erl:44: undefined macro 'assertEqual'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2011-02-23 02:09:57 +0000
@@ -0,0 +1,4 @@
1apps/burrow/.eunit/
2apps/burrow/doc
3apps/burrow/ebin
4rel/burrow/
05
=== added file 'README'
--- README 1970-01-01 00:00:00 +0000
+++ README 2011-02-23 02:09:57 +0000
@@ -0,0 +1,52 @@
1# Copyright (C) 2011 OpenStack LLC.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15Welcome to Burrow, the OpenStack Queue Service!
16
17To build the source, run:
18
19./rebar compile
20
21To start Burrow directly from the source after compiling, run:
22
23./start
24
25To run the unittests and produce coverage output, run:
26
27./rebar compile eunit
28
29To build the code documentation (output in apps/burrow/doc), run:
30
31./rebar doc
32
33To build a release, run:
34
35./rebar generate
36
37To start and stop the release, run:
38
39./rel/burrow/bin/burrow <start|stop>
40
41To run the release attached to a console, run:
42
43./rel/burrow/bin/burrow console
44
45If you would like more information on this project, see:
46
47https://launchpad.net/burrow
48http://wiki.openstack.org/QueueService
49
50For information on the mailing list, IRC, and contributing, see:
51
52http://wiki.openstack.org/HowToContribute
053
=== added directory 'apps'
=== added directory 'apps/burrow'
=== added directory 'apps/burrow/src'
=== added file 'apps/burrow/src/burrow.app.src'
--- apps/burrow/src/burrow.app.src 1970-01-01 00:00:00 +0000
+++ apps/burrow/src/burrow.app.src 2011-02-23 02:09:57 +0000
@@ -0,0 +1,30 @@
1% Copyright (C) 2011 OpenStack LLC.
2%
3% Licensed under the Apache License, Version 2.0 (the "License");
4% you may not use this file except in compliance with the License.
5% You may obtain a copy of the License at
6%
7% http://www.apache.org/licenses/LICENSE-2.0
8%
9% Unless required by applicable law or agreed to in writing, software
10% distributed under the License is distributed on an "AS IS" BASIS,
11% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12% See the License for the specific language governing permissions and
13% limitations under the License.
14
15{application, burrow, [
16 {description, "Burrow - OpenStack Queue Service"},
17 {vsn, "2011.2"},
18 {modules, [
19 burrow,
20 burrow_app,
21 burrow_sup
22 ]},
23 {applications, [
24 kernel,
25 stdlib
26 ]},
27 {registered, []},
28 {mod, {burrow_app, []}},
29 {env, []}
30]}.
031
=== added file 'apps/burrow/src/burrow.erl'
--- apps/burrow/src/burrow.erl 1970-01-01 00:00:00 +0000
+++ apps/burrow/src/burrow.erl 2011-02-23 02:09:57 +0000
@@ -0,0 +1,49 @@
1% Copyright (C) 2011 OpenStack LLC.
2%
3% Licensed under the Apache License, Version 2.0 (the "License");
4% you may not use this file except in compliance with the License.
5% You may obtain a copy of the License at
6%
7% http://www.apache.org/licenses/LICENSE-2.0
8%
9% Unless required by applicable law or agreed to in writing, software
10% distributed under the License is distributed on an "AS IS" BASIS,
11% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12% See the License for the specific language governing permissions and
13% limitations under the License.
14
15% @doc Main functions for Burrow.
16
17-module(burrow).
18
19-export([start/0, stop/0, restart/0]).
20
21% @doc Start Burrow.
22start() ->
23 application:start(?MODULE).
24
25% @doc Stop Burrow.
26stop() ->
27 application:stop(?MODULE).
28
29% @doc Restart Burrow.
30restart() ->
31 case stop() of
32 ok -> start();
33 Error -> Error
34 end.
35
36%
37% Test functions.
38%
39
40-ifdef(TEST).
41-include_lib("eunit/include/eunit.hrl").
42
43application_test() ->
44 ?assertEqual(ok, start()),
45 ?assertEqual(ok, restart()),
46 ?assertEqual(ok, stop()),
47 ?assertEqual({error, {not_started, burrow}}, restart()).
48
49-endif.
050
=== added file 'apps/burrow/src/burrow_app.erl'
--- apps/burrow/src/burrow_app.erl 1970-01-01 00:00:00 +0000
+++ apps/burrow/src/burrow_app.erl 2011-02-23 02:09:57 +0000
@@ -0,0 +1,32 @@
1% Copyright (C) 2011 OpenStack LLC.
2%
3% Licensed under the Apache License, Version 2.0 (the "License");
4% you may not use this file except in compliance with the License.
5% You may obtain a copy of the License at
6%
7% http://www.apache.org/licenses/LICENSE-2.0
8%
9% Unless required by applicable law or agreed to in writing, software
10% distributed under the License is distributed on an "AS IS" BASIS,
11% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12% See the License for the specific language governing permissions and
13% limitations under the License.
14
15% @doc Application module for burrow. This contains callbacks for the
16% application behaviour.
17
18-module(burrow_app).
19
20-behaviour(application).
21-export([start/2, stop/1]).
22
23% @doc Start callback for the application behaviour. This starts the root
24% supervisor process and all components of the server. See application(3erl)
25% for more details.
26start(_Type, _Args) ->
27 burrow_sup:start_link().
28
29% @doc Stop callback for the application behaviour. See application(3erl)
30% for more details.
31stop(_State) ->
32 ok.
033
=== added file 'apps/burrow/src/burrow_sup.erl'
--- apps/burrow/src/burrow_sup.erl 1970-01-01 00:00:00 +0000
+++ apps/burrow/src/burrow_sup.erl 2011-02-23 02:09:57 +0000
@@ -0,0 +1,32 @@
1% Copyright (C) 2011 OpenStack LLC.
2%
3% Licensed under the Apache License, Version 2.0 (the "License");
4% you may not use this file except in compliance with the License.
5% You may obtain a copy of the License at
6%
7% http://www.apache.org/licenses/LICENSE-2.0
8%
9% Unless required by applicable law or agreed to in writing, software
10% distributed under the License is distributed on an "AS IS" BASIS,
11% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12% See the License for the specific language governing permissions and
13% limitations under the License.
14
15% @doc Supervisor module for burrow. This contains callbacks for the root
16% supervisor behaviour.
17
18-module(burrow_sup).
19
20-export([start_link/0]).
21
22-behaviour(supervisor).
23-export([init/1]).
24
25% @doc Start and link to the supervisor process.
26start_link() ->
27 supervisor:start_link({local, ?MODULE}, ?MODULE, []).
28
29% @doc Callback for the supervisor behaviour. See supervisor(3erl) for
30% more details.
31init([]) ->
32 {ok, {{one_for_one, 5, 10}, []}}.
033
=== added file 'rebar'
1Binary files rebar 1970-01-01 00:00:00 +0000 and rebar 2011-02-23 02:09:57 +0000 differ34Binary files rebar 1970-01-01 00:00:00 +0000 and rebar 2011-02-23 02:09:57 +0000 differ
=== added file 'rebar.config'
--- rebar.config 1970-01-01 00:00:00 +0000
+++ rebar.config 2011-02-23 02:09:57 +0000
@@ -0,0 +1,20 @@
1% Copyright (C) 2011 OpenStack LLC.
2%
3% Licensed under the Apache License, Version 2.0 (the "License");
4% you may not use this file except in compliance with the License.
5% You may obtain a copy of the License at
6%
7% http://www.apache.org/licenses/LICENSE-2.0
8%
9% Unless required by applicable law or agreed to in writing, software
10% distributed under the License is distributed on an "AS IS" BASIS,
11% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12% See the License for the specific language governing permissions and
13% limitations under the License.
14
15{sub_dirs, [
16 "apps/burrow",
17 "rel"
18]}.
19
20{cover_enabled, true}.
021
=== added directory 'rel'
=== added directory 'rel/files'
=== added file 'rel/files/app.config'
--- rel/files/app.config 1970-01-01 00:00:00 +0000
+++ rel/files/app.config 2011-02-23 02:09:57 +0000
@@ -0,0 +1,21 @@
1% Copyright (C) 2011 OpenStack LLC.
2%
3% Licensed under the Apache License, Version 2.0 (the "License");
4% you may not use this file except in compliance with the License.
5% You may obtain a copy of the License at
6%
7% http://www.apache.org/licenses/LICENSE-2.0
8%
9% Unless required by applicable law or agreed to in writing, software
10% distributed under the License is distributed on an "AS IS" BASIS,
11% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12% See the License for the specific language governing permissions and
13% limitations under the License.
14
15[{sasl, [
16 {sasl_error_logger, {file, "log/sasl-error.log"}},
17 {errlog_type, error},
18 {error_logger_mf_dir, "log/sasl"}, % Log directory
19 {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size
20 {error_logger_mf_maxfiles, 5} % 5 files max
21]}].
022
=== added file 'rel/files/burrow'
--- rel/files/burrow 1970-01-01 00:00:00 +0000
+++ rel/files/burrow 2011-02-23 02:09:57 +0000
@@ -0,0 +1,155 @@
1#!/bin/bash
2# -*- tab-width:4;indent-tabs-mode:nil -*-
3# ex: ts=4 sw=4 et
4
5RUNNER_SCRIPT_DIR=$(cd ${0%/*} && pwd)
6
7RUNNER_BASE_DIR=${RUNNER_SCRIPT_DIR%/*}
8RUNNER_ETC_DIR=$RUNNER_BASE_DIR/etc
9RUNNER_LOG_DIR=$RUNNER_BASE_DIR/log
10# Note the trailing slash on $PIPE_DIR/
11PIPE_DIR=/tmp/$RUNNER_BASE_DIR/
12RUNNER_USER=
13
14# Make sure this script is running as the appropriate user
15if [ ! -z "$RUNNER_USER" ] && [ `whoami` != "$RUNNER_USER" ]; then
16 exec sudo -u $RUNNER_USER -i $0 $@
17fi
18
19# Make sure CWD is set to runner base dir
20cd $RUNNER_BASE_DIR
21
22# Make sure log directory exists
23mkdir -p $RUNNER_LOG_DIR
24
25# Extract the target node name from node.args
26NAME_ARG=`grep -e '-[s]*name' $RUNNER_ETC_DIR/vm.args`
27if [ -z "$NAME_ARG" ]; then
28 echo "vm.args needs to have either -name or -sname parameter."
29 exit 1
30fi
31
32# Extract the target cookie
33COOKIE_ARG=`grep -e '-setcookie' $RUNNER_ETC_DIR/vm.args`
34if [ -z "$COOKIE_ARG" ]; then
35 echo "vm.args needs to have a -setcookie parameter."
36 exit 1
37fi
38
39# Identify the script name
40SCRIPT=`basename $0`
41
42# Parse out release and erts info
43START_ERL=`cat $RUNNER_BASE_DIR/releases/start_erl.data`
44ERTS_VSN=${START_ERL% *}
45APP_VSN=${START_ERL#* }
46
47# Add ERTS bin dir to our path
48ERTS_PATH=$RUNNER_BASE_DIR/erts-$ERTS_VSN/bin
49
50# Setup command to control the node
51NODETOOL="$ERTS_PATH/escript $ERTS_PATH/nodetool $NAME_ARG $COOKIE_ARG"
52
53# Check the first argument for instructions
54case "$1" in
55 start)
56 # Make sure there is not already a node running
57 RES=`$NODETOOL ping`
58 if [ "$RES" = "pong" ]; then
59 echo "Node is already running!"
60 exit 1
61 fi
62 HEART_COMMAND="$RUNNER_BASE_DIR/bin/$SCRIPT start"
63 export HEART_COMMAND
64 mkdir -p $PIPE_DIR
65 $ERTS_PATH/run_erl -daemon $PIPE_DIR $RUNNER_LOG_DIR "exec $RUNNER_BASE_DIR/bin/$SCRIPT console" 2>&1
66 ;;
67
68 stop)
69 # Wait for the node to completely stop...
70 case `uname -s` in
71 Linux|Darwin|FreeBSD|DragonFly|NetBSD|OpenBSD)
72 # PID COMMAND
73 PID=`ps ax -o pid= -o command=|\
74 grep "$RUNNER_BASE_DIR/.*/[b]eam"|awk '{print $1}'`
75 ;;
76 SunOS)
77 # PID COMMAND
78 PID=`ps -ef -o pid= -o args=|\
79 grep "$RUNNER_BASE_DIR/.*/[b]eam"|awk '{print $1}'`
80 ;;
81 CYGWIN*)
82 # UID PID PPID TTY STIME COMMAND
83 PID=`ps -efW|grep "$RUNNER_BASE_DIR/.*/[b]eam"|awk '{print $2}'`
84 ;;
85 esac
86 $NODETOOL stop
87 while `kill -0 $PID 2>/dev/null`;
88 do
89 sleep 1
90 done
91 ;;
92
93 restart)
94 ## Restart the VM without exiting the process
95 $NODETOOL restart
96 ;;
97
98 reboot)
99 ## Restart the VM completely (uses heart to restart it)
100 $NODETOOL reboot
101 ;;
102
103 ping)
104 ## See if the VM is alive
105 $NODETOOL ping
106 ;;
107
108 attach)
109 # Make sure a node IS running
110 RES=`$NODETOOL ping`
111 if [ "$RES" != "pong" ]; then
112 echo "Node is not running!"
113 exit 1
114 fi
115
116 shift
117 $ERTS_PATH/to_erl $PIPE_DIR
118 ;;
119
120 console|console_clean)
121 # .boot file typically just $SCRIPT (ie, the app name)
122 # however, for debugging, sometimes start_clean.boot is useful:
123 case "$1" in
124 console) BOOTFILE=$SCRIPT ;;
125 console_clean) BOOTFILE=start_clean ;;
126 esac
127 # Setup beam-required vars
128 ROOTDIR=$RUNNER_BASE_DIR
129 BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
130 EMU=beam
131 PROGNAME=`echo $0 | sed 's/.*\\///'`
132 CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$BOOTFILE -embedded -config $RUNNER_ETC_DIR/app.config -args_file $RUNNER_ETC_DIR/vm.args -- ${1+"$@"}"
133 export EMU
134 export ROOTDIR
135 export BINDIR
136 export PROGNAME
137
138 # Dump environment info for logging purposes
139 echo "Exec: $CMD"
140 echo "Root: $ROOTDIR"
141
142 # Log the startup
143 logger -t "$SCRIPT[$$]" "Starting up"
144
145 # Start the VM
146 exec $CMD
147 ;;
148
149 *)
150 echo "Usage: $SCRIPT {start|stop|restart|reboot|ping|console|attach}"
151 exit 1
152 ;;
153esac
154
155exit 0
0156
=== added file 'rel/files/erl'
--- rel/files/erl 1970-01-01 00:00:00 +0000
+++ rel/files/erl 2011-02-23 02:09:57 +0000
@@ -0,0 +1,34 @@
1#!/bin/bash
2
3## This script replaces the default "erl" in erts-VSN/bin. This is necessary
4## as escript depends on erl and in turn, erl depends on having access to a
5## bootscript (start.boot). Note that this script is ONLY invoked as a side-effect
6## of running escript -- the embedded node bypasses erl and uses erlexec directly
7## (as it should).
8##
9## Note that this script makes the assumption that there is a start_clean.boot
10## file available in $ROOTDIR/release/VSN.
11
12# Determine the abspath of where this script is executing from.
13ERTS_BIN_DIR=$(cd ${0%/*} && pwd)
14
15# Now determine the root directory -- this script runs from erts-VSN/bin,
16# so we simply need to strip off two dirs from the end of the ERTS_BIN_DIR
17# path.
18ROOTDIR=${ERTS_BIN_DIR%/*/*}
19
20# Parse out release and erts info
21START_ERL=`cat $ROOTDIR/releases/start_erl.data`
22ERTS_VSN=${START_ERL% *}
23APP_VSN=${START_ERL#* }
24
25BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
26EMU=beam
27PROGNAME=`echo $0 | sed 's/.*\\///'`
28CMD="$BINDIR/erlexec"
29export EMU
30export ROOTDIR
31export BINDIR
32export PROGNAME
33
34exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"}
0\ No newline at end of file35\ No newline at end of file
136
=== added file 'rel/files/nodetool'
--- rel/files/nodetool 1970-01-01 00:00:00 +0000
+++ rel/files/nodetool 2011-02-23 02:09:57 +0000
@@ -0,0 +1,138 @@
1%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
2%% ex: ft=erlang ts=4 sw=4 et
3%% -------------------------------------------------------------------
4%%
5%% nodetool: Helper Script for interacting with live nodes
6%%
7%% -------------------------------------------------------------------
8
9main(Args) ->
10 ok = start_epmd(),
11 %% Extract the args
12 {RestArgs, TargetNode} = process_args(Args, [], undefined),
13
14 %% See if the node is currently running -- if it's not, we'll bail
15 case {net_kernel:hidden_connect_node(TargetNode), net_adm:ping(TargetNode)} of
16 {true, pong} ->
17 ok;
18 {_, pang} ->
19 io:format("Node ~p not responding to pings.\n", [TargetNode]),
20 halt(1)
21 end,
22
23 case RestArgs of
24 ["ping"] ->
25 %% If we got this far, the node already responsed to a ping, so just dump
26 %% a "pong"
27 io:format("pong\n");
28 ["stop"] ->
29 io:format("~p\n", [rpc:call(TargetNode, init, stop, [], 60000)]);
30 ["restart"] ->
31 io:format("~p\n", [rpc:call(TargetNode, init, restart, [], 60000)]);
32 ["reboot"] ->
33 io:format("~p\n", [rpc:call(TargetNode, init, reboot, [], 60000)]);
34 ["rpc", Module, Function | RpcArgs] ->
35 case rpc:call(TargetNode, list_to_atom(Module), list_to_atom(Function),
36 [RpcArgs], 60000) of
37 ok ->
38 ok;
39 {badrpc, Reason} ->
40 io:format("RPC to ~p failed: ~p\n", [TargetNode, Reason]),
41 halt(1);
42 _ ->
43 halt(1)
44 end;
45 ["rpcterms", Module, Function, ArgsAsString] ->
46 case rpc:call(TargetNode, list_to_atom(Module), list_to_atom(Function),
47 consult(ArgsAsString), 60000) of
48 {badrpc, Reason} ->
49 io:format("RPC to ~p failed: ~p\n", [TargetNode, Reason]),
50 halt(1);
51 Other ->
52 io:format("~p\n", [Other])
53 end;
54 Other ->
55 io:format("Other: ~p\n", [Other]),
56 io:format("Usage: nodetool {ping|stop|restart|reboot}\n")
57 end,
58 net_kernel:stop().
59
60process_args([], Acc, TargetNode) ->
61 {lists:reverse(Acc), TargetNode};
62process_args(["-setcookie", Cookie | Rest], Acc, TargetNode) ->
63 erlang:set_cookie(node(), list_to_atom(Cookie)),
64 process_args(Rest, Acc, TargetNode);
65process_args(["-name", TargetName | Rest], Acc, _) ->
66 ThisNode = append_node_suffix(TargetName, "_maint_"),
67 {ok, _} = net_kernel:start([ThisNode, longnames]),
68 process_args(Rest, Acc, nodename(TargetName));
69process_args(["-sname", TargetName | Rest], Acc, _) ->
70 ThisNode = append_node_suffix(TargetName, "_maint_"),
71 {ok, _} = net_kernel:start([ThisNode, shortnames]),
72 process_args(Rest, Acc, nodename(TargetName));
73process_args([Arg | Rest], Acc, Opts) ->
74 process_args(Rest, [Arg | Acc], Opts).
75
76
77start_epmd() ->
78 [] = os:cmd(epmd_path() ++ " -daemon"),
79 ok.
80
81epmd_path() ->
82 ErtsBinDir = filename:dirname(escript:script_name()),
83 Name = "epmd",
84 case os:find_executable(Name, ErtsBinDir) of
85 false ->
86 case os:find_executable(Name) of
87 false ->
88 io:format("Could not find epmd.~n"),
89 halt(1);
90 GlobalEpmd ->
91 GlobalEpmd
92 end;
93 Epmd ->
94 Epmd
95 end.
96
97
98nodename(Name) ->
99 case string:tokens(Name, "@") of
100 [_Node, _Host] ->
101 list_to_atom(Name);
102 [Node] ->
103 [_, Host] = string:tokens(atom_to_list(node()), "@"),
104 list_to_atom(lists:concat([Node, "@", Host]))
105 end.
106
107append_node_suffix(Name, Suffix) ->
108 case string:tokens(Name, "@") of
109 [Node, Host] ->
110 list_to_atom(lists:concat([Node, Suffix, os:getpid(), "@", Host]));
111 [Node] ->
112 list_to_atom(lists:concat([Node, Suffix, os:getpid()]))
113 end.
114
115
116%%
117%% Given a string or binary, parse it into a list of terms, ala file:consult/0
118%%
119consult(Str) when is_list(Str) ->
120 consult([], Str, []);
121consult(Bin) when is_binary(Bin)->
122 consult([], binary_to_list(Bin), []).
123
124consult(Cont, Str, Acc) ->
125 case erl_scan:tokens(Cont, Str, 0) of
126 {done, Result, Remaining} ->
127 case Result of
128 {ok, Tokens, _} ->
129 {ok, Term} = erl_parse:parse_term(Tokens),
130 consult([], Remaining, [Term | Acc]);
131 {eof, _Other} ->
132 lists:reverse(Acc);
133 {error, Info, _} ->
134 {error, Info}
135 end;
136 {more, Cont1} ->
137 consult(Cont1, eof, Acc)
138 end.
0139
=== added file 'rel/files/vm.args'
--- rel/files/vm.args 1970-01-01 00:00:00 +0000
+++ rel/files/vm.args 2011-02-23 02:09:57 +0000
@@ -0,0 +1,32 @@
1# Copyright (C) 2011 OpenStack LLC.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# Name of the node
16-name burrow@127.0.0.1
17
18# Cookie for distributed erlang
19-setcookie burrow
20
21# Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
22# (Disabled by default..use with caution!)
23#-heart
24
25# Enable kernel polling
26+K true
27
28# Increase number of concurrent ports/sockets
29-env ERL_MAX_PORTS 16384
30
31# Tweak GC to run more often
32-env ERL_FULLSWEEP_AFTER 10
033
=== added file 'rel/reltool.config'
--- rel/reltool.config 1970-01-01 00:00:00 +0000
+++ rel/reltool.config 2011-02-23 02:09:57 +0000
@@ -0,0 +1,46 @@
1% Copyright (C) 2011 OpenStack LLC.
2%
3% Licensed under the Apache License, Version 2.0 (the "License");
4% you may not use this file except in compliance with the License.
5% You may obtain a copy of the License at
6%
7% http://www.apache.org/licenses/LICENSE-2.0
8%
9% Unless required by applicable law or agreed to in writing, software
10% distributed under the License is distributed on an "AS IS" BASIS,
11% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12% See the License for the specific language governing permissions and
13% limitations under the License.
14
15{sys, [
16 {lib_dirs, ["../apps"]},
17 {rel, "burrow", "2011.2", [
18 burrow,
19 kernel,
20 stdlib,
21 sasl
22 ]},
23 {rel, "start_clean", "", [
24 kernel,
25 stdlib
26 ]},
27 {boot_rel, "burrow"},
28 {profile, embedded},
29 {excl_sys_filters, [
30 "^bin/.*",
31 "^erts.*/bin/(dialyzer|typer)"
32 ]},
33 {app, burrow, [{incl_cond, include}]},
34 {app, sasl, [{incl_cond, include}]}
35]}.
36
37{target_dir, "burrow"}.
38
39{overlay, [
40 {mkdir, "log/sasl"},
41 {copy, "files/erl", "{{erts_vsn}}/bin/erl"},
42 {copy, "files/nodetool", "{{erts_vsn}}/bin/nodetool"},
43 {copy, "files/burrow", "bin/burrow"},
44 {copy, "files/app.config", "etc/app.config"},
45 {copy, "files/vm.args", "etc/vm.args"}
46]}.
047
=== added file 'start'
--- start 1970-01-01 00:00:00 +0000
+++ start 2011-02-23 02:09:57 +0000
@@ -0,0 +1,16 @@
1#!/bin/sh
2# Copyright (C) 2011 OpenStack LLC.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16erl -pa apps/burrow/ebin -s burrow start

Subscribers

People subscribed via source and target branches

to all changes: