-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All buildbot.tac files refactor - use Path
Autogen buildbot.tac sets the basedir as two folders up, while other buildbot.tac files set basedir as one folder up. All the files are the same otherwise.
- Loading branch information
Showing
8 changed files
with
248 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,57 @@ | ||
import os | ||
# -*- python -*- | ||
# ex: set filetype=python: | ||
from pathlib import Path | ||
|
||
from twisted.application import service | ||
from twisted.python.log import FileLogObserver, ILogObserver | ||
from twisted.python.logfile import LogFile | ||
|
||
from buildbot.master import BuildMaster | ||
|
||
basedir = "." | ||
log_basedir = "/var/log/buildbot/" | ||
|
||
rotateLength = 20000000 | ||
# This buildbot.tac file is a basis for non-autogen masters. | ||
# The folder structure for autogen masters is: | ||
# | ||
# <srcdir> | ||
# └── master-xxxxxx | ||
# ├── buildbot.tac | ||
# ├── master.cfg | ||
# ├── master-config.yaml | ||
# └── master-private.cfg | ||
# | ||
# Thus basedir is one levels below this file's position. | ||
buildbot_tac_dir = Path(__file__).resolve().parent | ||
basedir = buildbot_tac_dir.parent | ||
|
||
# Hard coded as it runs in containers. | ||
# TODO(cvicentiu) this should come as an environment variable. | ||
log_basedir_path = Path("/var/log/buildbot/") | ||
log_basedir = log_basedir_path.as_posix() # Kept in case buildbot uses it. | ||
|
||
rotateLength = 10000000 | ||
maxRotatedFiles = 30 | ||
configfile = "master.cfg" | ||
|
||
# Default umask for server | ||
umask = None | ||
master_name = buildbot_tac_dir.name | ||
# Last two directories. autogen and <master-name> | ||
cfg_from_basedir = (buildbot_tac_dir / "master.cfg").relative_to(basedir) | ||
|
||
# if this is a relocatable tac file, get the directory containing the TAC | ||
if basedir == ".": | ||
import os | ||
configfile = cfg_from_basedir.as_posix() | ||
|
||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
# Default umask for server | ||
umask = None | ||
|
||
# note: this line is matched against to check that this is a buildmaster | ||
# directory; do not edit it. | ||
application = service.Application('buildmaster') # fmt: skip | ||
from twisted.python.log import FileLogObserver, ILogObserver | ||
from twisted.python.logfile import LogFile | ||
|
||
# This logfile is monitored. It must end in .log. | ||
logfile = LogFile.fromFullPath( | ||
os.path.join(log_basedir, "master-docker-non-standard-2.log"), | ||
str(log_basedir_path / f"{master_name}.log"), | ||
rotateLength=rotateLength, | ||
maxRotatedFiles=maxRotatedFiles, | ||
) | ||
application.setComponent(ILogObserver, FileLogObserver(logfile).emit) | ||
|
||
m = BuildMaster(basedir, configfile, umask) | ||
m = BuildMaster(str(basedir), configfile, umask) | ||
m.setServiceParent(application) | ||
m.log_rotation.rotateLength = rotateLength | ||
m.log_rotation.maxRotatedFiles = maxRotatedFiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,57 @@ | ||
import os | ||
# -*- python -*- | ||
# ex: set filetype=python: | ||
from pathlib import Path | ||
|
||
from twisted.application import service | ||
from twisted.python.log import FileLogObserver, ILogObserver | ||
from twisted.python.logfile import LogFile | ||
|
||
from buildbot.master import BuildMaster | ||
|
||
basedir = "." | ||
log_basedir = "/var/log/buildbot/" | ||
|
||
rotateLength = 20000000 | ||
# This buildbot.tac file is a basis for non-autogen masters. | ||
# The folder structure for autogen masters is: | ||
# | ||
# <srcdir> | ||
# └── master-xxxxxx | ||
# ├── buildbot.tac | ||
# ├── master.cfg | ||
# ├── master-config.yaml | ||
# └── master-private.cfg | ||
# | ||
# Thus basedir is one levels below this file's position. | ||
buildbot_tac_dir = Path(__file__).resolve().parent | ||
basedir = buildbot_tac_dir.parent | ||
|
||
# Hard coded as it runs in containers. | ||
# TODO(cvicentiu) this should come as an environment variable. | ||
log_basedir_path = Path("/var/log/buildbot/") | ||
log_basedir = log_basedir_path.as_posix() # Kept in case buildbot uses it. | ||
|
||
rotateLength = 10000000 | ||
maxRotatedFiles = 30 | ||
configfile = "master.cfg" | ||
|
||
# Default umask for server | ||
umask = None | ||
master_name = buildbot_tac_dir.name | ||
# Last two directories. autogen and <master-name> | ||
cfg_from_basedir = (buildbot_tac_dir / "master.cfg").relative_to(basedir) | ||
|
||
# if this is a relocatable tac file, get the directory containing the TAC | ||
if basedir == ".": | ||
import os | ||
configfile = cfg_from_basedir.as_posix() | ||
|
||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
# Default umask for server | ||
umask = None | ||
|
||
# note: this line is matched against to check that this is a buildmaster | ||
# directory; do not edit it. | ||
application = service.Application('buildmaster') # fmt: skip | ||
from twisted.python.log import FileLogObserver, ILogObserver | ||
from twisted.python.logfile import LogFile | ||
|
||
# This logfile is monitored. It must end in .log. | ||
logfile = LogFile.fromFullPath( | ||
os.path.join(log_basedir, "master-docker-non-standard.log"), | ||
str(log_basedir_path / f"{master_name}.log"), | ||
rotateLength=rotateLength, | ||
maxRotatedFiles=maxRotatedFiles, | ||
) | ||
application.setComponent(ILogObserver, FileLogObserver(logfile).emit) | ||
|
||
m = BuildMaster(basedir, configfile, umask) | ||
m = BuildMaster(str(basedir), configfile, umask) | ||
m.setServiceParent(application) | ||
m.log_rotation.rotateLength = rotateLength | ||
m.log_rotation.maxRotatedFiles = maxRotatedFiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,57 @@ | ||
import os | ||
# -*- python -*- | ||
# ex: set filetype=python: | ||
from pathlib import Path | ||
|
||
from twisted.application import service | ||
from twisted.python.log import FileLogObserver, ILogObserver | ||
from twisted.python.logfile import LogFile | ||
|
||
from buildbot.master import BuildMaster | ||
|
||
basedir = "." | ||
log_basedir = "/var/log/buildbot/" | ||
# This buildbot.tac file is a basis for non-autogen masters. | ||
# The folder structure for autogen masters is: | ||
# | ||
# <srcdir> | ||
# └── master-xxxxxx | ||
# ├── buildbot.tac | ||
# ├── master.cfg | ||
# ├── master-config.yaml | ||
# └── master-private.cfg | ||
# | ||
# Thus basedir is one levels below this file's position. | ||
buildbot_tac_dir = Path(__file__).resolve().parent | ||
basedir = buildbot_tac_dir.parent | ||
|
||
# Hard coded as it runs in containers. | ||
# TODO(cvicentiu) this should come as an environment variable. | ||
log_basedir_path = Path("/var/log/buildbot/") | ||
log_basedir = log_basedir_path.as_posix() # Kept in case buildbot uses it. | ||
|
||
rotateLength = 10000000 | ||
maxRotatedFiles = 10 | ||
configfile = "master.cfg" | ||
maxRotatedFiles = 30 | ||
|
||
# Default umask for server | ||
umask = None | ||
master_name = buildbot_tac_dir.name | ||
# Last two directories. autogen and <master-name> | ||
cfg_from_basedir = (buildbot_tac_dir / "master.cfg").relative_to(basedir) | ||
|
||
# if this is a relocatable tac file, get the directory containing the TAC | ||
if basedir == ".": | ||
import os | ||
configfile = cfg_from_basedir.as_posix() | ||
|
||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
# Default umask for server | ||
umask = None | ||
|
||
# note: this line is matched against to check that this is a buildmaster | ||
# directory; do not edit it. | ||
application = service.Application('buildmaster') # fmt: skip | ||
from twisted.python.log import FileLogObserver, ILogObserver | ||
from twisted.python.logfile import LogFile | ||
|
||
# This logfile is monitored. It must end in .log. | ||
logfile = LogFile.fromFullPath( | ||
os.path.join(log_basedir, "master-galera.log"), | ||
str(log_basedir_path / f"{master_name}.log"), | ||
rotateLength=rotateLength, | ||
maxRotatedFiles=maxRotatedFiles, | ||
) | ||
application.setComponent(ILogObserver, FileLogObserver(logfile).emit) | ||
|
||
m = BuildMaster(basedir, configfile, umask) | ||
m = BuildMaster(str(basedir), configfile, umask) | ||
m.setServiceParent(application) | ||
m.log_rotation.rotateLength = rotateLength | ||
m.log_rotation.maxRotatedFiles = maxRotatedFiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,57 @@ | ||
import os | ||
# -*- python -*- | ||
# ex: set filetype=python: | ||
from pathlib import Path | ||
|
||
from twisted.application import service | ||
from twisted.python.log import FileLogObserver, ILogObserver | ||
from twisted.python.logfile import LogFile | ||
|
||
from buildbot.master import BuildMaster | ||
|
||
basedir = "." | ||
log_basedir = "/var/log/buildbot/" | ||
# This buildbot.tac file is a basis for non-autogen masters. | ||
# The folder structure for autogen masters is: | ||
# | ||
# <srcdir> | ||
# └── master-xxxxxx | ||
# ├── buildbot.tac | ||
# ├── master.cfg | ||
# ├── master-config.yaml | ||
# └── master-private.cfg | ||
# | ||
# Thus basedir is one levels below this file's position. | ||
buildbot_tac_dir = Path(__file__).resolve().parent | ||
basedir = buildbot_tac_dir.parent | ||
|
||
# Hard coded as it runs in containers. | ||
# TODO(cvicentiu) this should come as an environment variable. | ||
log_basedir_path = Path("/var/log/buildbot/") | ||
log_basedir = log_basedir_path.as_posix() # Kept in case buildbot uses it. | ||
|
||
rotateLength = 10000000 | ||
maxRotatedFiles = 10 | ||
configfile = "master.cfg" | ||
maxRotatedFiles = 30 | ||
|
||
# Default umask for server | ||
umask = None | ||
master_name = buildbot_tac_dir.name | ||
# Last two directories. autogen and <master-name> | ||
cfg_from_basedir = (buildbot_tac_dir / "master.cfg").relative_to(basedir) | ||
|
||
# if this is a relocatable tac file, get the directory containing the TAC | ||
if basedir == ".": | ||
import os | ||
configfile = cfg_from_basedir.as_posix() | ||
|
||
basedir = os.path.abspath(os.path.dirname(__file__)) | ||
# Default umask for server | ||
umask = None | ||
|
||
# note: this line is matched against to check that this is a buildmaster | ||
# directory; do not edit it. | ||
application = service.Application('buildmaster') # fmt: skip | ||
from twisted.python.log import FileLogObserver, ILogObserver | ||
from twisted.python.logfile import LogFile | ||
|
||
# This logfile is monitored. It must end in .log. | ||
logfile = LogFile.fromFullPath( | ||
os.path.join(log_basedir, "master-libvirt.log"), | ||
str(log_basedir_path / f"{master_name}.log"), | ||
rotateLength=rotateLength, | ||
maxRotatedFiles=maxRotatedFiles, | ||
) | ||
application.setComponent(ILogObserver, FileLogObserver(logfile).emit) | ||
|
||
m = BuildMaster(basedir, configfile, umask) | ||
m = BuildMaster(str(basedir), configfile, umask) | ||
m.setServiceParent(application) | ||
m.log_rotation.rotateLength = rotateLength | ||
m.log_rotation.maxRotatedFiles = maxRotatedFiles |
Oops, something went wrong.