diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-03-26 15:39:42 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-03-26 15:39:42 +0200 |
commit | 18e8736a93b252465ca537e978c5b0b8a3219751 (patch) | |
tree | 6bb37b84f3895ee54c42f2fb008f8623009ae77b | |
parent | e98ae6619dc9ec3201c47589476e84dda7406e71 (diff) |
Add buildos.{build,bootstrap,interactive}_timeout.<toolchain> cmdline variables
-rwxr-xr-x | buildos | 53 |
1 files changed, 45 insertions, 8 deletions
@@ -287,21 +287,37 @@ function print () tu="$(toolchain_value "$tp" toolchain_url)" tt="$(toolchain_value "$tp" toolchain_trust)" - echo "$tn.nice: $tc" - echo "$tn.bridge: $tb" - echo "$tn.instances: $ti" - echo "$tn.interactive: $ta" - echo "$tn.toolchain_url: $tu" - echo "$tn.toolchain_trust: $tt" + tbt="$(toolchain_value "$tp" build_timeout)" + tst="$(toolchain_value "$tp" bootstrap_timeout)" + tat="$(toolchain_value "$tp" interactive_timeout)" + + echo "$tn.nice: $tc" + echo "$tn.bridge: $tb" + echo "$tn.instances: $ti" + echo "$tn.interactive: $ta" + echo "$tn.toolchain_url: $tu" + echo "$tn.toolchain_trust: $tt" + + if [ -n "$tbt" ]; then + echo "$tn.build_timeout: $tbt" + fi + + if [ -n "$tst" ]; then + echo "$tn.bootstrap_timeout: $tst" + fi + + if [ -n "$tat" ]; then + echo "$tn.interactive_timeout: $tat" + fi n="${tp}controller_url[@]" for i in "${!n}"; do - echo "$tn.controller_url: $i" + echo "$tn.controller_url: $i" done n="${tp}controller_trust[@]" for i in "${!n}"; do - echo "$tn.controller_trust: $i" + echo "$tn.controller_trust: $i" done echo @@ -814,6 +830,10 @@ function bbot_start () # <toolchain-name> <toolchain-index> local tv="$(toolchain_value "$tp" toolchain_fver)" local ts="$(toolchain_value "$tp" toolchain_file_csum)" + local tbt="$(toolchain_value "$tp" build_timeout)" + local tst="$(toolchain_value "$tp" bootstrap_timeout)" + local tat="$(toolchain_value "$tp" interactive_timeout)" + local id="/build/bots/$tn" mkdir -p "$id" @@ -889,6 +909,23 @@ function bbot_start () # <toolchain-name> <toolchain-index> -e "s#^ExecStart=[^ ]+(.*)#ExecStart=$id/bin/bbot-agent\1#" \ "$id/lib/systemd/system/bbot-agent@.service" + # Patch in build/bootstrap/interactive timeouts. + # + if [ -n "$tbt" ]; then + sed -i -r -e "s/^(Environment=BUILD_TIMEOUT)=.*/\1=$tbt/" \ + "$id/lib/systemd/system/bbot-agent@.service" + fi + + if [ -n "$tst" ]; then + sed -i -r -e "s/^(Environment=BOOTSTRAP_TIMEOUT)=.*/\1=$tst/" \ + "$id/lib/systemd/system/bbot-agent@.service" + fi + + if [ -n "$tat" ]; then + sed -i -r -e "s/^(Environment=INTERACTIVE_TIMEOUT)=.*/\1=$tat/" \ + "$id/lib/systemd/system/bbot-agent@.service" + fi + # Patch in the controller URLs. These can contain special characters # like `&` so we have to escape them. # |