-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from basho/ku-node-package-rebased
Node-package integration to build debs and rpms
- Loading branch information
Showing
13 changed files
with
246 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
ebin/ | ||
deps/ | ||
tests/ | ||
basho_bench | ||
/basho_bench | ||
/rel/basho_bench | ||
package | ||
.rebar | ||
*~ | ||
#*# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*- | ||
%% ex: ts=4 sw=4 et | ||
|
||
%% | ||
%% Packaging | ||
%% | ||
{package_name, "basho-bench"}. | ||
{package_install_name, "basho_bench"}. | ||
{package_install_user, "basho-bench"}. | ||
{package_install_group, "basho-bench"}. | ||
{package_install_user_desc, "Basho-bench user"}. | ||
{package_shortdesc, "Basho benchmarking tool"}. | ||
{package_desc, "Benchmarking tool"}. | ||
{package_commands, {list, [[{name, "basho_bench"}]]}}. | ||
{package_patch_dir, "basho-patches"}. | ||
{bin_or_sbin, "bin"}. | ||
{license_type, "OSS"}. | ||
{copyright, "2014 Basho Technologies, Inc"}. | ||
{vendor_name, "Basho Technologies, Inc"}. | ||
{vendor_url, "http://basho.com"}. | ||
{vendor_contact_name, "Basho Package Maintainer"}. | ||
{vendor_contact_email, "[email protected]"}. | ||
{license_full_text, "This software is provided under license from Basho Technologies."}. | ||
{solaris_pkgname, "BASHObasho-bench"}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/sh | ||
|
||
# Pull environment for this install | ||
. "{{runner_base_dir}}/lib/env.sh" | ||
|
||
# Make sure CWD is set to runner run dir | ||
cd $RUNNER_BASE_DIR/lib/basho_bench*/ebin | ||
|
||
ERL_LIBS=$RUNNER_BASE_DIR $ERTS_PATH/escript basho_bench.beam "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/usr/bin/env escript | ||
%%! -noshell -noinput | ||
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*- | ||
%% ex: ft=erlang ts=4 sw=4 et | ||
|
||
-define(TIMEOUT, 60000). | ||
-define(INFO(Fmt,Args), io:format(Fmt,Args)). | ||
|
||
main([NodeName, Cookie, ReleasePackage]) -> | ||
TargetNode = start_distribution(NodeName, Cookie), | ||
{ok, Vsn} = rpc:call(TargetNode, release_handler, unpack_release, | ||
[ReleasePackage], ?TIMEOUT), | ||
?INFO("Unpacked Release ~p~n", [Vsn]), | ||
{ok, OtherVsn, Desc} = rpc:call(TargetNode, release_handler, | ||
check_install_release, [Vsn], ?TIMEOUT), | ||
{ok, OtherVsn, Desc} = rpc:call(TargetNode, release_handler, | ||
install_release, [Vsn], ?TIMEOUT), | ||
?INFO("Installed Release ~p~n", [Vsn]), | ||
ok = rpc:call(TargetNode, release_handler, make_permanent, [Vsn], ?TIMEOUT), | ||
?INFO("Made Release ~p Permanent~n", [Vsn]); | ||
main(_) -> | ||
init:stop(1). | ||
|
||
start_distribution(NodeName, Cookie) -> | ||
MyNode = make_script_node(NodeName), | ||
{ok, _Pid} = net_kernel:start([MyNode, shortnames]), | ||
erlang:set_cookie(node(), list_to_atom(Cookie)), | ||
TargetNode = make_target_node(NodeName), | ||
case {net_kernel:hidden_connect_node(TargetNode), | ||
net_adm:ping(TargetNode)} of | ||
{true, pong} -> | ||
ok; | ||
{_, pang} -> | ||
io:format("Node ~p not responding to pings.\n", [TargetNode]), | ||
init:stop(1) | ||
end, | ||
TargetNode. | ||
|
||
make_target_node(Node) -> | ||
[_, Host] = string:tokens(atom_to_list(node()), "@"), | ||
list_to_atom(lists:concat([Node, "@", Host])). | ||
|
||
make_script_node(Node) -> | ||
list_to_atom(lists:concat([Node, "_upgrader_", os:getpid()])). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Name of the node | ||
-name [email protected] | ||
|
||
## Cookie for distributed erlang | ||
-setcookie healthb | ||
|
||
## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive | ||
## (Disabled by default..use with caution!) | ||
##-heart | ||
|
||
## Enable kernel poll and a few async threads | ||
##+K true | ||
##+A 5 | ||
|
||
## Increase number of concurrent ports/sockets | ||
##-env ERL_MAX_PORTS 4096 | ||
|
||
## Tweak GC to run more often | ||
##-env ERL_FULLSWEEP_AFTER 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
%% -*- mode: erlang -*- | ||
%% ex: ft=erlang | ||
{sys, [ | ||
{lib_dirs, ["../deps"]}, | ||
{erts, [{mod_cond, derived}, {app_file, strip}]}, | ||
{app_file, strip}, | ||
{rel, "basho_bench", "0.10.0", | ||
[ | ||
kernel, | ||
stdlib, | ||
bear, | ||
lager, | ||
folsom, | ||
goldrush, | ||
riakc, | ||
ibrowse, | ||
mochiweb | ||
]}, | ||
{rel, "start_clean", "", | ||
[ | ||
kernel, | ||
stdlib | ||
]}, | ||
{boot_rel, "basho_bench"}, | ||
{profile, embedded}, | ||
{incl_cond, derived}, | ||
{excl_archive_filters, [".*"]}, %% Do not archive built libs | ||
{excl_sys_filters, ["^bin/(?!start_clean.boot)", | ||
"^erts.*/bin/(dialyzer|typer)", | ||
"^erts.*/(doc|info|include|lib|man|src)"]}, | ||
{excl_app_filters, ["\.gitignore"]}, | ||
{app, basho_bench, [{mod_cond, app}, {incl_cond, include}, {lib_dir, ".."}]}, | ||
{app, hipe, [{incl_cond, exclude}]} | ||
]}. | ||
|
||
{target_dir, "basho_bench"}. | ||
{overlay_vars, "vars.config"}. | ||
|
||
{overlay, [ | ||
{template, "../deps/node_package/priv/base/env.sh", | ||
"lib/env.sh"}, | ||
{mkdir, "data/b_b"}, | ||
|
||
%% Copy base files for starting and interacting w/ node | ||
{copy, "../deps/node_package/priv/base/erl", | ||
"{{erts_vsn}}/bin/erl"}, | ||
{copy, "../deps/node_package/priv/base/nodetool", | ||
"{{erts_vsn}}/bin/nodetool"}, | ||
{template, "../deps/node_package/priv/base/env.sh", | ||
"lib/env.sh"}, | ||
{copy, "files/vm.args", "etc/vm.args"}, | ||
|
||
{template, "files/basho_bench", "bin/basho_bench"}, | ||
|
||
{copy, "../examples/cs.config.sample", "etc/cs.config"}, | ||
{copy, "../examples/riakc_pb.config", "etc/riakc_pb.config"}, | ||
{copy, "../examples/httpraw.config", "etc/httpraw.config"}, | ||
{copy, "../examples/http.config", "etc/http.config"}, | ||
{copy, "../examples/null_test.config", "etc/null_test.config"} | ||
|
||
%%{copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"}, | ||
|
||
]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*- | ||
%% ex: ts=4 sw=4 et | ||
|
||
%% Platform-specific installation paths | ||
{platform_bin_dir, "./bin"}. | ||
{platform_data_dir, "./data"}. | ||
{platform_etc_dir, "./etc"}. | ||
{platform_lib_dir, "./lib"}. | ||
{platform_log_dir, "./log"}. | ||
|
||
%% | ||
{data_dir, "{{target_dir}}/data"}. | ||
{runner_script_dir, "\`cd \\`dirname $0\\` && /bin/pwd\`"}. | ||
{runner_base_dir, "{{runner_script_dir}}/.."}. | ||
{runner_etc_dir, "$RUNNER_BASE_DIR/etc"}. | ||
{runner_log_dir, "$RUNNER_BASE_DIR/log"}. | ||
{runner_lib_dir, "$RUNNER_BASE_DIR/lib"}. | ||
{runner_patch_dir, "$RUNNER_BASE_DIR/lib/basho-patches"}. | ||
{pipe_dir, "/tmp/$RUNNER_BASE_DIR/"}. | ||
{runner_user, ""}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters