capricorn 0.2.25 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. data/LICENSE +19 -0
  2. data/README.md +1 -0
  3. data/bin/capricorn-app-scaffolder +27 -0
  4. data/bin/capricorn-gem-spec +33 -0
  5. data/bin/capricornctl +12 -0
  6. data/bin/capricornd +31 -0
  7. data/erlang/lib/bert/doc/overview.edoc +4 -0
  8. data/erlang/lib/bert/ebin/bert.app +9 -0
  9. data/erlang/lib/bert/rebar.config +3 -0
  10. data/erlang/lib/bert/src/bert.erl +69 -0
  11. data/erlang/lib/bertio/doc/overview.edoc +4 -0
  12. data/erlang/lib/bertio/ebin/bertio.app +9 -0
  13. data/erlang/lib/bertio/rebar.config +3 -0
  14. data/erlang/lib/bertio/src/bertio.erl +28 -0
  15. data/erlang/lib/bertrpc/doc/overview.edoc +4 -0
  16. data/erlang/lib/bertrpc/ebin/bertrpc.app +12 -0
  17. data/erlang/lib/bertrpc/include/bertrpc.hrl +1 -0
  18. data/erlang/lib/bertrpc/rebar.config +5 -0
  19. data/erlang/lib/bertrpc/src/bertrpc.erl +471 -0
  20. data/erlang/lib/bertrpc/src/bertrpc_hello_world.erl +148 -0
  21. data/erlang/lib/bertrpc/src/fd_tcp.erl +376 -0
  22. data/erlang/lib/capricorn/doc/overview.edoc +4 -0
  23. data/erlang/lib/capricorn/ebin/capricorn.app +56 -0
  24. data/erlang/lib/capricorn/include/capricorn.hrl +76 -0
  25. data/erlang/lib/capricorn/rebar.config +3 -0
  26. data/erlang/lib/capricorn/src/cap_application.erl +170 -0
  27. data/erlang/lib/capricorn/src/cap_cluster.erl +121 -0
  28. data/erlang/lib/capricorn/src/cap_cluster_gems.erl +422 -0
  29. data/erlang/lib/capricorn/src/cap_config.erl +25 -0
  30. data/erlang/lib/capricorn/src/cap_dets_updater.erl +26 -0
  31. data/erlang/lib/capricorn/src/cap_event_sup.erl +35 -0
  32. data/erlang/lib/capricorn/src/cap_events.erl +24 -0
  33. data/erlang/lib/capricorn/src/cap_external_api.erl +87 -0
  34. data/erlang/lib/capricorn/src/cap_external_apps_api.erl +125 -0
  35. data/erlang/lib/capricorn/src/cap_external_gems_api.erl +85 -0
  36. data/erlang/lib/capricorn/src/cap_external_machines_api.erl +18 -0
  37. data/erlang/lib/capricorn/src/cap_gem_utils.erl +111 -0
  38. data/erlang/lib/capricorn/src/cap_internal_api.erl +69 -0
  39. data/erlang/lib/capricorn/src/cap_internal_apps_api.erl +38 -0
  40. data/erlang/lib/capricorn/src/cap_log.erl +113 -0
  41. data/erlang/lib/capricorn/src/cap_machine.erl +338 -0
  42. data/erlang/lib/capricorn/src/cap_machine_apps.erl +410 -0
  43. data/erlang/lib/capricorn/src/cap_machine_apps_sup.erl +57 -0
  44. data/erlang/lib/capricorn/src/cap_sup.erl +200 -0
  45. data/erlang/lib/capricorn/src/cap_util.erl +278 -0
  46. data/erlang/lib/capricorn/src/capricorn.erl +45 -0
  47. data/erlang/lib/capricorn/src/capricorn_app.erl +36 -0
  48. data/erlang/lib/emq/ebin/emq.app +17 -0
  49. data/erlang/lib/emq/src/emq.erl +261 -0
  50. data/erlang/lib/emq/src/emq_app.erl +11 -0
  51. data/erlang/lib/emq/src/emq_pool.erl +178 -0
  52. data/erlang/lib/emq/src/emq_queue.erl +332 -0
  53. data/erlang/lib/emq/src/emq_status.erl +148 -0
  54. data/erlang/lib/emq/src/emq_sup.erl +132 -0
  55. data/erlang/lib/gcd/ebin/gcd.app +18 -0
  56. data/erlang/lib/gcd/include/gcd.hrl +5 -0
  57. data/erlang/lib/gcd/rebar.config +3 -0
  58. data/erlang/lib/gcd/src/gcd.erl +51 -0
  59. data/erlang/lib/gcd/src/gcd_app.erl +13 -0
  60. data/erlang/lib/gcd/src/gcd_event.erl +39 -0
  61. data/erlang/lib/gcd/src/gcd_server.erl +30 -0
  62. data/erlang/lib/gcd/src/gcd_srv.erl +186 -0
  63. data/erlang/lib/gcd/src/gcd_sup.erl +18 -0
  64. data/erlang/rebar +0 -0
  65. data/erlang/rebar.config +9 -0
  66. data/erlang/rel/overlay/bin/capricornd +146 -0
  67. data/erlang/rel/overlay/erts-vsn/bin/erl +34 -0
  68. data/erlang/rel/overlay/erts-vsn/bin/nodetool +80 -0
  69. data/erlang/rel/overlay/etc/capricorn/app.config +59 -0
  70. data/erlang/rel/overlay/etc/capricorn/cluster-vm.args +21 -0
  71. data/erlang/rel/overlay/etc/capricorn/machine-vm.args +21 -0
  72. data/erlang/rel/reltool.config +43 -0
  73. data/ext/Makefile +2 -0
  74. data/ext/extconf.rb +1 -0
  75. data/lib/capricorn-client.rb +86 -0
  76. data/lib/capricorn-client/cli/applications.rb +256 -0
  77. data/lib/capricorn-client/cli/gems.rb +57 -0
  78. data/lib/capricorn-client/cli/machines.rb +9 -0
  79. data/lib/capricorn-client/helpers.rb +62 -0
  80. data/lib/capricorn.rb +5 -99
  81. data/lib/capricorn/driver.rb +86 -0
  82. data/lib/capricorn/recipes/apache-debian.rb +112 -0
  83. data/lib/capricorn/recipes/centos-plesk.rb +162 -0
  84. data/lib/capricorn/recipes/macports.rb +54 -0
  85. data/lib/capricorn/system_context.rb +49 -0
  86. data/lib/capricorn/version.rb +5 -0
  87. metadata +233 -74
  88. data/app_generators/engine/engine_generator.rb +0 -40
  89. data/app_generators/engine/templates/Gmfile +0 -20
  90. data/app_generators/engine/templates/MIT-LICENSE.txt +0 -20
  91. data/app_generators/engine/templates/README.rdoc +0 -7
  92. data/app_generators/engine/templates/config/initializers/rails_init.rb +0 -1
  93. data/app_generators/engine/templates/config/routes.rb +0 -2
  94. data/app_generators/engine/templates/gitignore +0 -9
  95. data/app_generators/engine/templates/init.rb +0 -1
  96. data/app_generators/engine/templates/lib/engine.rb +0 -4
  97. data/app_generators/engine/templates/rails/init.rb +0 -1
  98. data/app_generators/engine/templates/tasks/engine_tasks.rake +0 -4
  99. data/bin/capricorn +0 -20
  100. data/lib/capricorn/actor.rb +0 -23
  101. data/lib/capricorn/actor/actions.rb +0 -76
  102. data/lib/capricorn/actors/apache_actor.rb +0 -56
  103. data/lib/capricorn/actors/base_actor.rb +0 -335
  104. data/lib/capricorn/actors/host_file_actor.rb +0 -77
  105. data/lib/capricorn/actors/mysql_actor.rb +0 -20
  106. data/lib/capricorn/actors/passenger_actor.rb +0 -28
  107. data/lib/capricorn/actors/plesk_actor.rb +0 -228
  108. data/lib/capricorn/actors/sqlite3_actor.rb +0 -44
  109. data/lib/capricorn/app_runner.rb +0 -108
  110. data/lib/capricorn/apps/dev.rb +0 -15
  111. data/lib/capricorn/apps/engines.rb +0 -33
  112. data/lib/capricorn/apps/jobs.rb +0 -35
  113. data/lib/capricorn/apps/satellite.rb +0 -68
  114. data/lib/capricorn/apps/server.rb +0 -73
  115. data/lib/capricorn/client.rb +0 -48
  116. data/lib/capricorn/client/auth_token.rb +0 -98
  117. data/lib/capricorn/daemon.rb +0 -81
  118. data/lib/capricorn/exception_handler.rb +0 -79
  119. data/lib/capricorn/extentions/rubygems_plugin.rb +0 -27
  120. data/lib/capricorn/extentions/thor_extentions.rb +0 -32
  121. data/lib/capricorn/job_queue.rb +0 -203
  122. data/lib/capricorn/satellite.rb +0 -52
  123. data/lib/capricorn/satellite/actions.rb +0 -55
  124. data/lib/capricorn/satellite/dependency_loader.rb +0 -82
  125. data/lib/capricorn/satellite/persistence.rb +0 -50
  126. data/lib/capricorn/server.rb +0 -144
  127. data/lib/capricorn/server/daemon.rb +0 -83
  128. data/lib/capricorn/server/proxy.rb +0 -25
  129. data/lib/capricorn/server/security.rb +0 -120
  130. data/lib/capricorn/system.rb +0 -218
  131. data/lib/capricorn/system/config.rb +0 -49
  132. data/lib/capricorn/system/helper.rb +0 -21
  133. data/lib/capricorn/system/options.rb +0 -79
  134. data/lib/capricorn/system/process_user.rb +0 -73
  135. data/lib/capricorn/system/satellites.rb +0 -44
  136. data/lib/capricorn/system/shell.rb +0 -80
  137. data/lib/rubygems_plugin.rb +0 -1
  138. data/spec/actor/actions_spec.rb +0 -13
  139. data/spec/spec_helper.rb +0 -1
@@ -0,0 +1,18 @@
1
+ -module(gcd_sup).
2
+ -behaviour(supervisor).
3
+
4
+ -export([start_link/0]).
5
+ -export([init/1]).
6
+
7
+ start_link() ->
8
+ supervisor:start_link({local, gcd_sup}, ?MODULE, []).
9
+
10
+ init([]) ->
11
+ {ok, {{one_for_one, 10, 3600},[
12
+ {gcd_srv,
13
+ {gcd_srv, start_link, []},
14
+ permanent,
15
+ brutal_kill,
16
+ worker,
17
+ [gcd_srv]}
18
+ ]}}.
data/erlang/rebar ADDED
Binary file
@@ -0,0 +1,9 @@
1
+ {sub_dirs, [
2
+ "lib/bert",
3
+ "lib/bertio",
4
+ "lib/bertrpc",
5
+ "lib/gcd",
6
+ "lib/emq",
7
+ "lib/capricorn",
8
+ "rel"
9
+ ]}.
@@ -0,0 +1,146 @@
1
+ #!/bin/bash
2
+
3
+ RUNNER_SCRIPT_DIR=$(cd ${0%/*} && pwd)
4
+
5
+ RDIR="$1"
6
+ shift
7
+
8
+ RUNNER_BASE_DIR=${RDIR}
9
+ RUNNER_SRC_DIR=${RUNNER_SCRIPT_DIR%/*}
10
+ RUNNER_ETC_DIR=$RUNNER_BASE_DIR/etc/capricorn
11
+ RUNNER_LOG_DIR=$RUNNER_BASE_DIR/var/log
12
+ PIPE_DIR=/tmp/$RUNNER_BASE_DIR/
13
+ RUNNER_USER=
14
+
15
+ # Make sure this script is running as the appropriate user
16
+ if [ ! -z "$RUNNER_USER" ] && [ `whoami` != "$RUNNER_USER" ]; then
17
+ exec sudo -u $RUNNER_USER -i $0 $@
18
+ fi
19
+
20
+ # Make sure CWD is set to runner base dir
21
+ cd $RUNNER_BASE_DIR
22
+
23
+ NODETYPE="$1"
24
+ if [ -z "$NODETYPE" ]; then
25
+ echo "Usage: $SCRIPT {machine|cluster} {start|stop|restart|reboot|ping|console|attach}"
26
+ exit 1
27
+ fi
28
+ shift
29
+
30
+ # Make sure log directory exists
31
+ mkdir -p $RUNNER_LOG_DIR
32
+
33
+ # Extract the target node name from node.args
34
+ NAME_ARG=`grep -e '-[s]*name' $RUNNER_ETC_DIR/$NODETYPE-vm.args`
35
+ if [ -z "$NAME_ARG" ]; then
36
+ echo "$NODETYPE-vm.args needs to have either -name or -sname parameter."
37
+ exit 1
38
+ fi
39
+
40
+ # Extract the target cookie
41
+ COOKIE_ARG=`grep -e '-setcookie' $RUNNER_ETC_DIR/$NODETYPE-vm.args`
42
+ if [ -z "$COOKIE_ARG" ]; then
43
+ echo "$NODETYPE-vm.args needs to have a -setcookie parameter."
44
+ exit 1
45
+ fi
46
+
47
+ # Identify the script name
48
+ SCRIPT=`basename $0`
49
+
50
+ # Parse out release and erts info
51
+ START_ERL=`cat $RUNNER_SRC_DIR/releases/start_erl.data`
52
+ ERTS_VSN=${START_ERL% *}
53
+ APP_VSN=${START_ERL#* }
54
+
55
+ # Add ERTS bin dir to our path
56
+ ERTS_PATH=$RUNNER_SRC_DIR/erts-$ERTS_VSN/bin
57
+
58
+ # Setup command to control the node
59
+ NODETOOL="$ERTS_PATH/escript $ERTS_PATH/nodetool $NAME_ARG $COOKIE_ARG"
60
+
61
+ # Check the first argument for instructions
62
+ case "$1" in
63
+ start)
64
+ # Make sure there is not already a node running
65
+ RES=`$NODETOOL ping`
66
+ if [ "$RES" == "pong" ]; then
67
+ echo "Node is already running!"
68
+ exit 1
69
+ fi
70
+ export HEART_COMMAND="$RUNNER_BASE_DIR/bin/$SCRIPT $NODETYPE start"
71
+ mkdir -p $PIPE_DIR
72
+ $ERTS_PATH/run_erl -daemon $PIPE_DIR $RUNNER_LOG_DIR "exec $RUNNER_BASE_DIR/bin/$SCRIPT $NODETYPE console" 2>&1
73
+ ;;
74
+
75
+ stop)
76
+ # Wait for the node to completely stop...
77
+ PID=`ps -ef|grep "$RUNNER_SRC_DIR/.*/[b]eam.smp|awk '{print $2}'"`
78
+ $NODETOOL stop
79
+ while `kill -0 $PID 2>/dev/null`;
80
+ do
81
+ sleep 1
82
+ done
83
+ ;;
84
+
85
+ restart)
86
+ ## Restart the VM without exiting the process
87
+ $NODETOOL restart
88
+ ;;
89
+
90
+ reboot)
91
+ ## Restart the VM completely (uses heart to restart it)
92
+ $NODETOOL reboot
93
+ ;;
94
+
95
+ ping)
96
+ ## See if the VM is alive
97
+ $NODETOOL ping
98
+ ;;
99
+
100
+ attach)
101
+ # Make sure a node IS running
102
+ RES=`$NODETOOL ping`
103
+ if [ "$RES" != "pong" ]; then
104
+ echo "Node is not running!"
105
+ exit 1
106
+ fi
107
+
108
+ shift
109
+ $ERTS_PATH/to_erl $PIPE_DIR
110
+ ;;
111
+
112
+ console)
113
+ RES=`$NODETOOL ping`
114
+ if [ "$RES" == "pong" ]; then
115
+ echo "Node is already running - use 'capricorn attach' instead"
116
+ exit 1
117
+ fi
118
+ # Setup beam-required vars
119
+ ROOTDIR=$RUNNER_SRC_DIR
120
+ BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
121
+ EMU=beam
122
+ PROGNAME=`echo $0 | sed 's/.*\///'`
123
+ CMD="$BINDIR/erlexec -boot $RUNNER_SRC_DIR/releases/$APP_VSN/capricorn -embedded -config $RUNNER_ETC_DIR/app.config -args_file $RUNNER_ETC_DIR/$NODETYPE-vm.args -node_type $NODETYPE -- ${1+"$@"}"
124
+ export EMU
125
+ export ROOTDIR
126
+ export BINDIR
127
+ export PROGNAME
128
+
129
+ # Dump environment info for logging purposes
130
+ echo "Exec: $CMD"
131
+ echo "Root: $ROOTDIR"
132
+
133
+ # Log the startup
134
+ logger -t "$SCRIPT[$$]" "Starting up"
135
+
136
+ # Start the VM
137
+ exec $CMD
138
+ ;;
139
+
140
+ *)
141
+ echo "Usage: $SCRIPT {machine|cluster} {start|stop|restart|reboot|ping|console|attach}"
142
+ exit 1
143
+ ;;
144
+ esac
145
+
146
+ exit 0
@@ -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.
13
+ ERTS_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.
18
+ ROOTDIR=${ERTS_BIN_DIR%/*/*}
19
+
20
+ # Parse out release and erts info
21
+ START_ERL=`cat $ROOTDIR/releases/start_erl.data`
22
+ ERTS_VSN=${START_ERL% *}
23
+ APP_VSN=${START_ERL#* }
24
+
25
+ BINDIR=$ROOTDIR/erts-$ERTS_VSN/bin
26
+ EMU=beam
27
+ PROGNAME=`echo $0 | sed 's/.*\///'`
28
+ CMD="$BINDIR/erlexec"
29
+ export EMU
30
+ export ROOTDIR
31
+ export BINDIR
32
+ export PROGNAME
33
+
34
+ exec $CMD -boot $ROOTDIR/releases/$APP_VSN/start_clean ${1+"$@"}
@@ -0,0 +1,80 @@
1
+ %% -*- erlang -*-
2
+ %% -------------------------------------------------------------------
3
+ %%
4
+ %% nodetool: Helper Script for interacting with live nodes
5
+ %%
6
+ %% -------------------------------------------------------------------
7
+
8
+ main(Args) ->
9
+ %% Extract the args
10
+ {RestArgs, TargetNode} = process_args(Args, [], undefined),
11
+
12
+ %% See if the node is currently running -- if it's not, we'll bail
13
+ case net_adm:ping(TargetNode) of
14
+ pong ->
15
+ ok;
16
+ pang ->
17
+ io:format("Node ~p not responding to pings.\n", [TargetNode]),
18
+ halt(1)
19
+ end,
20
+
21
+ case RestArgs of
22
+ ["ping"] ->
23
+ %% If we got this far, the node already responsed to a ping, so just dump
24
+ %% a "pong"
25
+ io:format("pong\n");
26
+ ["stop"] ->
27
+ io:format("~p\n", [rpc:call(TargetNode, init, stop, [], 60000)]);
28
+ ["restart"] ->
29
+ io:format("~p\n", [rpc:call(TargetNode, init, restart, [], 60000)]);
30
+ ["reboot"] ->
31
+ io:format("~p\n", [rpc:call(TargetNode, init, reboot, [], 60000)]);
32
+ ["rpc", Module, Function | RpcArgs] ->
33
+ case rpc:call(TargetNode, list_to_atom(Module), list_to_atom(Function), [RpcArgs], 60000) of
34
+ ok ->
35
+ ok;
36
+ {badrpc, Reason} ->
37
+ io:format("RPC to ~p failed: ~p\n", [TargetNode, Reason]),
38
+ halt(1);
39
+ _ ->
40
+ halt(1)
41
+ end;
42
+ Other ->
43
+ io:format("Other: ~p\n", [Other]),
44
+ io:format("Usage: nodetool {ping|stop|restart|reboot}\n")
45
+ end,
46
+ net_kernel:stop().
47
+
48
+ process_args([], Acc, TargetNode) ->
49
+ {lists:reverse(Acc), TargetNode};
50
+ process_args(["-setcookie", Cookie | Rest], Acc, TargetNode) ->
51
+ erlang:set_cookie(node(), list_to_atom(Cookie)),
52
+ process_args(Rest, Acc, TargetNode);
53
+ process_args(["-name", TargetName | Rest], Acc, _) ->
54
+ ThisNode = append_node_suffix(TargetName, "_maint_"),
55
+ {ok, _} = net_kernel:start([ThisNode, longnames]),
56
+ process_args(Rest, Acc, nodename(TargetName));
57
+ process_args(["-sname", TargetName | Rest], Acc, _) ->
58
+ ThisNode = append_node_suffix(TargetName, "_maint_"),
59
+ {ok, _} = net_kernel:start([ThisNode, shortnames]),
60
+ process_args(Rest, Acc, nodename(TargetName));
61
+ process_args([Arg | Rest], Acc, Opts) ->
62
+ process_args(Rest, [Arg | Acc], Opts).
63
+
64
+
65
+ nodename(Name) ->
66
+ case string:tokens(Name, "@") of
67
+ [_Node, _Host] ->
68
+ list_to_atom(Name);
69
+ [Node] ->
70
+ [_, Host] = string:tokens(atom_to_list(node()), "@"),
71
+ list_to_atom(lists:concat([Node, "@", Host]))
72
+ end.
73
+
74
+ append_node_suffix(Name, Suffix) ->
75
+ case string:tokens(Name, "@") of
76
+ [Node, Host] ->
77
+ list_to_atom(lists:concat([Node, Suffix, os:getpid(), "@", Host]));
78
+ [Node] ->
79
+ list_to_atom(lists:concat([Node, Suffix, os:getpid()]))
80
+ end.
@@ -0,0 +1,59 @@
1
+ [
2
+ %% Capricorn config
3
+ {capricorn, [
4
+
5
+ {cluster, [
6
+ {database, "var/run/capricorn-cluster"},
7
+
8
+ {api, [
9
+ % {stats, cap_service_stats}
10
+ ]},
11
+
12
+ {daemons, [
13
+ % {backup, {cap_daemon_backup,start_link,[]}}
14
+ ]},
15
+
16
+ {event_handlers, [
17
+ % {backup, {cap_daemon_backup,[]}}
18
+ ]}
19
+ ]},
20
+
21
+ {machine, [
22
+ % location of the cluster node
23
+ {cluster, 'cluster@127.0.0.1'},
24
+
25
+ % path to gem repo
26
+ {gems_path, "/opt/local/lib/ruby/gems/1.8"},
27
+
28
+ {database, "var/run/capricorn-machine"},
29
+
30
+ {recipe, "macports"},
31
+
32
+ {api, [
33
+ % {users, cap_service_users}
34
+ ]},
35
+
36
+ {daemons, [
37
+ % {backup, {cap_daemon_backup,start_link,[]}}
38
+ ]},
39
+
40
+ {event_handlers, [
41
+ % {backup, {cap_daemon_backup,[]}}
42
+ ]}
43
+ ]},
44
+
45
+ {log, [
46
+ {file, "var/log/capricorn.log"},
47
+ {level, debug}
48
+ ]}
49
+ ]},
50
+
51
+ %% SASL config
52
+ {sasl, [
53
+ {sasl_error_logger, {file, "var/log/sasl-error.log"}},
54
+ {errlog_type, error},
55
+ {error_logger_mf_dir, "var/log/sasl"}, % Log directory
56
+ {error_logger_mf_maxbytes, 10485760}, % 10 MB max file size
57
+ {error_logger_mf_maxfiles, 5} % 5 files max
58
+ ]}
59
+ ].
@@ -0,0 +1,21 @@
1
+
2
+ ## Name of the capricorn node
3
+ -name cluster@127.0.0.1
4
+
5
+ ## Cookie for distributed erlang
6
+ -setcookie capricorn
7
+
8
+ ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
9
+ ## (Disabled by default..use with caution!)
10
+ ##-heart
11
+
12
+ ## Enable kernel poll and a few async threads
13
+ +K true
14
+ +A 5
15
+
16
+ ## Increase number of concurrent ports/sockets
17
+ -env ERL_MAX_PORTS 4096
18
+
19
+ ## Tweak GC to run more often
20
+ -env ERL_FULLSWEEP_AFTER 10
21
+
@@ -0,0 +1,21 @@
1
+
2
+ ## Name of the capricorn node
3
+ -name machine-001@127.0.0.1
4
+
5
+ ## Cookie for distributed erlang
6
+ -setcookie capricorn
7
+
8
+ ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
9
+ ## (Disabled by default..use with caution!)
10
+ ##-heart
11
+
12
+ ## Enable kernel poll and a few async threads
13
+ +K true
14
+ +A 5
15
+
16
+ ## Increase number of concurrent ports/sockets
17
+ -env ERL_MAX_PORTS 4096
18
+
19
+ ## Tweak GC to run more often
20
+ -env ERL_FULLSWEEP_AFTER 10
21
+
@@ -0,0 +1,43 @@
1
+ {sys, [
2
+ {lib_dirs, ["../lib"]},
3
+ {rel, "capricorn", "1.0.0", [
4
+ kernel,
5
+ stdlib,
6
+ sasl,
7
+ inets,
8
+ bert,
9
+ bertio,
10
+ bertrpc,
11
+ gcd,
12
+ emq,
13
+ capricorn
14
+ ]},
15
+ {rel, "start_clean", "", [
16
+ kernel,
17
+ stdlib
18
+ ]},
19
+ {boot_rel, "capricorn"},
20
+ {profile, embedded},
21
+ {excl_sys_filters, [
22
+ "^bin/.*",
23
+ "^erts.*/bin/(dialyzer|typer)"
24
+ ]},
25
+ % {excl_archive_filters, [".*"]},
26
+ {app, bert, [{incl_cond, include}]},
27
+ {app, bertio, [{incl_cond, include}]},
28
+ {app, bertrpc, [{incl_cond, include}]},
29
+ {app, gcd, [{incl_cond, include}]},
30
+ {app, emq, [{incl_cond, include}]},
31
+ {app, capricorn, [{incl_cond, include}]},
32
+ {app, sasl, [{incl_cond, include}]}
33
+ ]}.
34
+
35
+ {rebar, [
36
+ {empty_dirs, [
37
+ "var/run/capricorn-machine",
38
+ "var/run/capricorn-cluster",
39
+ "var/log/sasl"
40
+ ]},
41
+
42
+ {overlay, "overlay"}
43
+ ]}.