Skip to content

Commit

Permalink
buildworker: start: fix worker startup failure after update
Browse files Browse the repository at this point in the history
Workers are currently refusing to work:

 Unhandled Error
 Traceback (most recent call last):
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 673, in run
     runApp(config)
   File "/opt/venv/lib/python3.11/site-packages/twisted/scripts/twistd.py", line 29, in runApp
     runner.run()
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 370, in run
     self.application = self.createOrGetApplication()
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 437, in createOrGetApplication
     application = getApplication(self.config, passphrase)
 --- <exception caught here> ---
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/app.py", line 446, in getApplication
     application = service.loadApplication(filename, style, passphrase)
   File "/opt/venv/lib/python3.11/site-packages/twisted/application/service.py", line 404, in loadApplication
     application = sob.loadValueFromFile(filename, "application")
   File "/opt/venv/lib/python3.11/site-packages/twisted/persisted/sob.py", line 174, in loadValueFromFile
     codeObj = compile(data, filename, "exec")
 builtins.SyntaxError: keyword argument repeated: connection_string (buildbot.tac, line 49)

as the buildbot.tac template changed in commit 4ba1dcb66155 ("worker:
Add option --connection-string for create-worker") and in version v3.10.0.

So lets use this new `--connection-string` feature and get rid of the
sed-fu.

Fixes: efbddc9 ("Bump buildbot to v3.11.1 release")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
  • Loading branch information
ynezz committed Sep 26, 2024
1 parent ff521bb commit 3812ff7
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions docker/buildworker/files/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@

rm -f /builder/buildbot.tac

use_tls=""
[ "$BUILDWORKER_TLS" = 1 ] && use_tls="--use-tls"
/opt/venv/bin/buildbot-worker create-worker --force --umask="0o22" $use_tls /builder \
"$BUILDWORKER_MASTER" "$BUILDWORKER_NAME" "$BUILDWORKER_PASSWORD"

if [ "$BUILDWORKER_TLS" = 1 ]; then
sed -i \
-e 's#(buildmaster_host, port, #(None, None, #' \
-e 's#allow_shutdown=allow_shutdown#&, connection_string="SSL:%s:%d" %(buildmaster_host, port)#' \
/builder/buildbot.tac
fi
/opt/venv/bin/buildbot-worker create-worker \
--force \
--umask="0o22" \
--connection-string="SSL:$BUILDWORKER_MASTER" \
/builder \
"$BUILDWORKER_MASTER" \
"$BUILDWORKER_NAME" \
"$BUILDWORKER_PASSWORD"

echo "$BUILDWORKER_ADMIN" > /builder/info/admin
echo "$BUILDWORKER_DESCRIPTION" > /builder/info/host
Expand Down

2 comments on commit 3812ff7

@aparcar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks non TLS setups. The line --connection-string="SSL:$BUILDWORKER_MASTER" \ should depend on the _TLS env

@ynezz
Copy link
Member Author

@ynezz ynezz commented on 3812ff7 Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oopsie, sorry #55

Please sign in to comment.