Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
-ensure tool_name gets into ES
-void duplicate tool collection on remotehost endpoints that have same
host
-disable debug logging
  • Loading branch information
atheurer committed Nov 29, 2023
1 parent 5bceab2 commit 79687d6
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 23 deletions.
36 changes: 20 additions & 16 deletions endpoints/remotehost/remotehost
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,19 @@ function remotehost_req_check() {

function exec_pod() {
local engine_label=$1; shift
local tool=""
tool=$1; shift
local tool_name="none"
if [ $# -gt 0 ]; then
tool_name=$1; shift
fi
local os_runtime="pod"

env_tool_file="${engine_label}_env.txt"
get_image profiler $tool_count this_image
get_image profiler 1 this_image

echo "rickshaw_host=$controller_ipaddr" >> ${endpoint_run_dir}/${env_tool_file}
echo "endpoint_run_dir=$endpoint_run_dir" >> ${endpoint_run_dir}/${env_tool_file}
echo "cs_label=$engine_label" >> ${endpoint_run_dir}/${env_tool_file}
echo "tool_name=$tool" >> ${endpoint_run_dir}/${env_tool_file}
echo "tool_name=$tool_name" >> ${endpoint_run_dir}/${env_tool_file}
echo "base_run_dir=$base_run_dir" >> ${endpoint_run_dir}/${env_tool_file}
echo "endpoint=remotehost" >> ${endpoint_run_dir}/${env_tool_file}
echo "max_rb_attempts=$max_rb_attempts" >> ${endpoint_run_dir}/${env_tool_file}
Expand Down Expand Up @@ -382,17 +384,20 @@ function launch_osruntime() {
set_total_cpupart

# Launch the tool engines (support only pods)
local tools=`awk -F: '{print $1}' $config_dir/tool-cmds/profiler/start`
echo "Creating a pod for each of these tools: $tools"
tool_count=1
echo "Going to create a pod for each tool"
for tool in $tools; do
# This label will not work with mulitple remotehost endpoints!
engine_label=profiler-$endpoint_label-$tool_count
exec_pod $engine_label $tool
new_remotehost_followers+=" $engine_label"
let tool_count=$tool_count+1
done
if [ "$disable_tools" != "1" ]; then
local tools=`awk -F: '{print $1}' $config_dir/tool-cmds/profiler/start`
echo "Creating a pod for each of these tools: $tools"
tool_count=1
echo "Going to create a pod for each tool"
for tool in $tools; do
engine_label=profiler-$endpoint_label-$tool_count
exec_pod $engine_label $tool
new_remotehost_followers+=" $engine_label"
let tool_count=$tool_count+1
done
else
echo "Not launching osruntimes for tools because disable-tools = 1"
fi

# For each client and server launch the actual script which will run it.
count=1
Expand Down Expand Up @@ -501,7 +506,6 @@ function launch_osruntime() {
echo "max_sample_failures=$max_sample_failures" >> ${endpoint_run_dir}/${env_file}
echo "max_rb_attempts=$max_rb_attempts" >> ${endpoint_run_dir}/${env_file}
echo "ssh_id=${ssh_id}" >> ${endpoint_run_dir}/${env_file}
#echo "disable_tools=$this_disable_tools" >> ${endpoint_run_dir}/${env_file}
# For one-tool-per-engine, client and server engines never run tools
echo "disable_tools=1" >> ${endpoint_run_dir}/${env_file}

Expand Down
10 changes: 5 additions & 5 deletions engine/engine-script
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,20 @@ roadblock_rc=$?
roadblock_exit_on_error ${roadblock_rc}


do_roadblock start-tools-begin ${default_timeout}
roadblock_rc=$?
roadblock_exit_on_error ${roadblock_rc}

start_stop_tools_opt=""
if [ "$cs_type" == "profiler" ]; then
if [ -z "$tool_name" ]; then
echo "env:"
env
exit_error "tool_name not defined [$tool_name], exiting"
fi
start_stop_tools_opt=$tool_name
start_stop_tools_opt=$tool_name
fi

do_roadblock start-tools-begin ${default_timeout}
roadblock_rc=$?
roadblock_exit_on_error ${roadblock_rc}

start_tools $start_stop_tools_opt

do_roadblock start-tools-end ${default_timeout}
Expand Down
2 changes: 1 addition & 1 deletion rickshaw-index
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ sub index_metrics {
my $eng_env_fh = new IO::Uncompress::UnXz $eng_env_file, Transparent => 1 || die "[ERROR]could not open file " . $eng_env_file;
# Cull out env vars which we want as metadata
#printf "Looking for engine env vars\n";
my @varnames = ('HOSTNAME', 'engine_type', 'engine_role', 'benchmark_group', 'benchmark_role', 'hosted_by', 'hypervisor_host', 'osruntime', 'endpoint_label', 'userenv');
my @varnames = ('HOSTNAME', 'tool_name', 'engine_type', 'engine_role', 'benchmark_group', 'benchmark_role', 'hosted_by', 'hypervisor_host', 'osruntime', 'endpoint_label', 'userenv');
while (<$eng_env_fh>) {
chomp;
foreach my $varname (@varnames) {
Expand Down
18 changes: 17 additions & 1 deletion rickshaw-run
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use toolbox::logging;
use toolbox::run;
use toolbox::jsonsettings;

$toolbox::logging::debug = 1;
$toolbox::logging::debug = 0;

my $ug = Data::UUID->new;
my %defaults = ( "num-samples" => 1, "tool-group" => "default", "test-order" => "s",
Expand Down Expand Up @@ -2086,6 +2086,7 @@ sub remove_ssh_keys() {
sub deploy_endpoints() {
# Deploy ths endpoints so they are ready to run benchmark and tools.
# Each endpoint is responible for launching a osruntime for each client and server.
my %remote_hosts;
print "\nDeploying endpoints\n";
$endpoint_deploy_timeout += scalar @endpoints * 120;
foreach my $engine (keys %clients_servers) {
Expand All @@ -2111,6 +2112,21 @@ sub deploy_endpoints() {
if (defined $run{'bench-ids'}) {
$bench_ids_opt = " --bench-ids=$run{'bench-ids'}";
}
if ($type eq "remotehost") {
# Get the host so we can detect multiple endpoints with the same host and enable tools on only the first one
# example opts: host:remote_host1,user:root,client:1,osruntime:podman,userenv:userenv1
foreach my $opt (split(",", $opts)) {
if ($opt =~ /^host:(.*)$/) {
if (exists $remote_hosts{$1}) {
# This host has already been used, disable tools for the next remotehost command
$opts .= ",disable-tools:1"
} else {
$remote_hosts{$1} = 1;
}
}
}
}

my $this_endpoint_run_dir = $base_endpoint_run_dir . "/" . $label;
mkdir($this_endpoint_run_dir);
die "Could not create $this_endpoint_run_dir" if ! -e $this_endpoint_run_dir;
Expand Down

0 comments on commit 79687d6

Please sign in to comment.