Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change rickshaw-run and the endpoints to use roadblock from it's nati… #493

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions endpoints/base
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ endpoint_run_dir=""
bootstrap_script="/usr/local/bin/bootstrap"
engine_run_script="/usr/local/bin/engine-script"
roadblock_msgs_dir=""
roadblock_dir="/supply/me"

declare -A clients=()
declare -A servers=()
Expand Down Expand Up @@ -146,14 +147,19 @@ function process_opts() {
local longopts="validate,endpoint-opts:,endpoint-label:,run-id:,base-run-dir:,image:"
local longopts+=",roadblock-server:,roadblock-passwd:,roadblock-id:,osruntime:,max-sample-failures:"
local longopts+=",max-rb-attempts:,endpoint-deploy-timeout:,engine-script-start-timeout:"
local longopts+=",packrat-dir:,bench-ids:"
local longopts+=",packrat-dir:,bench-ids:,roadblock-dir:"
local opts=$(getopt -q -o "" --longoptions "$longopts" -n "getopt.sh" -- "$@");
if [ $? -ne 0 ]; then
exit_error "Unrecognized option specified" endpoint-deploy
fi
eval set -- "$opts";
while true; do
case "$1" in
--roadblock-dir)
shift
roadblock_dir="${1}"
shift
;;
--packrat-dir)
shift
packrat_dir="${1}"
Expand Down Expand Up @@ -574,7 +580,7 @@ function do_roadblock() {
local cmd=""
local role="follower"
ping -w 10 -c 4 localhost
cmd="${cmd} /usr/local/bin/roadblocker.py --role=${role} --redis-server=localhost"
cmd="${cmd} ${roadblock_dir}/roadblocker.py --role=${role} --redis-server=localhost"
cmd="${cmd} --leader-id=${leader} --timeout=${timeout} --redis-password=${rb_passwd}"
cmd="${cmd} --follower-id=${endpoint_label} --message-log=${msgs_log_file}"
if [ -n "${message}" ]; then
Expand Down
8 changes: 7 additions & 1 deletion endpoints/remotehosts/remotehosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ def process_options():
required = True,
type = str)

parser.add_argument("--roadblock-dir",
dest = "roadblock_dir",
help = "Path to the root of the roadblock project directory.",
required = False,
type = str)

parser.add_argument("--roadblock-id",
dest = "roadblock_id",
help = "The roadblock ID to use to build roadblock names.",
Expand Down Expand Up @@ -2206,7 +2212,7 @@ def do_roadblock(label = None, timeout = None, messages = None, wait_for = None,
log.info(ping_log_msg)

cmd = [
"/usr/local/bin/roadblocker.py",
args.roadblock_dir + "/roadblocker.py",
"--role=follower",
"--redis-server=" + redis_server,
"--leader-id=" + leader,
Expand Down
16 changes: 6 additions & 10 deletions rickshaw-run
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,15 @@ my %image_ids; # {$benchmark-or-tool}{$userenv}
my %run; # A multi-dimensional, nested hash, schema TBD
# This hash documents what was run.
my $redis_passwd = "flubber"; # TODO: make this cmdline setting
my $rb_bin = "/usr/local/bin/roadblocker.py";
my $rb_module = "/usr/local/bin/roadblock.py";
my $rb_bin = "roadblocker.py";
my $rb_module = "roadblock.py";
my $messages_ref;
my $default_rb_timeout;
my $collect_sysinfo_timeout;
my $endpoint_deploy_timeout;
my $engine_script_start_timeout;
my $endpoint_move_data_rb_timeout;
my $base_rb_leader_cmd = $rb_bin . " --role=leader --redis-server=localhost" .
" --redis-password=" . $redis_passwd;
my $base_rb_follower_cmd = $rb_bin . " --role=follower --redis-server=localhost" .
" --redis-password=" . $redis_passwd . "\$abort_opt";
my $base_rb_leader_cmd = "--role=leader --redis-server=localhost --redis-password=" . $redis_passwd;
my $config_dir;
my $engine_config_dir;
my $engine_bench_cmds_dir;
Expand Down Expand Up @@ -1428,10 +1425,8 @@ sub process_cmdline() {
}

sub validate_controller_env() {
if (defined $run{'roadblock-dir'} and -e $run{'roadblock-dir'} . "/roadblocker.py") {
copy($run{'roadblock-dir'} . "/roadblocker.py", $rb_bin);
chmod 0755, "$rb_bin";
copy($run{'roadblock-dir'} . "/roadblock.py", $rb_module);
if (defined $run{'roadblock-dir'} and -e $run{'roadblock-dir'} . "/" . $rb_bin) {
$base_rb_leader_cmd = $run{'roadblock-dir'} . "/" . $rb_bin . " " . $base_rb_leader_cmd;
} else {
printf "ERROR, roadblock project directory not defined or roadblocker.py not found";
exit 1;
Expand Down Expand Up @@ -2471,6 +2466,7 @@ sub deploy_endpoints() {
my $pushd_dir = pushd($endpoint_project_dir);
my $cmd = "./" . $type .
" --rickshaw-dir=" . $rickshaw_project_dir .
" --roadblock-dir=" . $run{'roadblock-dir'} .
" --packrat-dir=" . $run{'packrat-dir'} .
" --endpoint-label=" . $label .
" --run-id=" . $run{'id'} .
Expand Down
Loading