From 74308ab241d265c4cf270d1758ecd85f3ea726e4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 6 Apr 2017 12:43:08 +0200 Subject: Pass toolchain id and number to bbot agent --- buildos | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'buildos') diff --git a/buildos b/buildos index b0095a0..0461e68 100755 --- a/buildos +++ b/buildos @@ -610,9 +610,13 @@ function bbot_check () # # Build and start bbot agent using the bpkg configuration created by # toolchain_bootstrap(). # -function bbot_start () # +function bbot_start () # { local tn="$1" + local ti="$2" + + local tp="${toolchains["$tn"]}" + local ts="$(toolchain_value "$tp" toolchain_file_csum)" local id="/build/bbot/$tn" mkdir -p "$id" @@ -668,6 +672,8 @@ function bbot_start () # -e "s/%[iI]/$tn/g" \ -e "s/^(Environment=CPU)=.*/\1=$cpu_slice/" \ -e "s/^(Environment=RAM)=.*/\1=$ram_slice/" \ + -e "s/^(Environment=TOOLCHAIN_ID)=.*/\1=$ts/" \ + -e "s/^(Environment=TOOLCHAIN_NUM)=.*/\1=$ti/" \ "$id/lib/systemd/system/bbot-agent@.service" sudo ln -sf "$id/lib/systemd/system/bbot-agent@.service" \ @@ -804,8 +810,11 @@ EOF # if [ "${#toolchain_names[@]}" -eq "${#toolchain_boots[@]}" ]; then + ti=0 # Toolchain index. for tn in "${toolchain_boots[@]}"; do + ti=$(($ti + 1)) + # Skip those that failed to bootstrap. # if [ -z "$tn" ]; then @@ -846,7 +855,7 @@ EOF # Note: appending to the same log. # - bbot_start "$tn" 2>&1 | tee -a "$tr/bbot-$count.log" 1>&2 + bbot_start "$tn" "$ti" 2>&1 | tee -a "$tr/bbot-$count.log" 1>&2 if [ "${PIPESTATUS[0]}" -eq 0 ]; then s="${s}started bbot-agent@$tn" -- cgit v1.1