Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
N/A
-
None
Description
For install and upgrade tests we use LibVirt managed KVMs.
We currently have one LibVirt worker that handles these types of workers (bg-bbw5-x64). We need an automatic way of creating VMs for all major operating systems and platforms that we are supporting (basically, for all the OSs and platforms for which we create Docker images - see https://github.com/MariaDB/mariadb.org-tools/blob/master/.github/workflows/bb_containers.yml)
VM creation
Create the image and configure LibVirt to use it. The current naming scheme consists in "buildbot-osname". Probably we need to adjust that.
Setup the base image (see VM installed packages below)
Configure LibVirt hook to always start from a clean VM
VM installed packages
The VMs need to be clean and have nothing installed except:
- buildbot-worker - Python package that needs to be installed similar to the steps in the Dockerfile creation (https://github.com/MariaDB/mariadb.org-tools/blob/bd5c4a6a072e8c9232e203ec985efcf25843fd1d/buildbot.mariadb.org/ci_build_images/common.Dockerfile#L29)
- configure a buildbot.tac that is unique for each worker similar to:
import fnmatch
|
import os
|
import sys
|
|
from twisted.application import service
|
from twisted.python.log import FileLogObserver
|
from twisted.python.log import ILogObserver
|
|
from buildbot_worker.bot import Worker
|
|
# setup worker
|
basedir = os.path.abspath(os.path.dirname(__file__))
|
application = service.Application('buildbot-worker')
|
|
|
application.setComponent(ILogObserver, FileLogObserver(sys.stdout).emit)
|
# and worker on the same process!
|
buildmaster_host = os.environ.get("BUILDMASTER", 'buildbot.mariadb.org')
|
port = int(os.environ.get("BUILDMASTER_PORT", 9990))
|
workername = os.environ.get("WORKERNAME", 'buildbot-ubuntu1804')
|
passwd = os.environ.get("WORKERPASS", 'PASSWORD')
|
|
# delete the password from the environ so that it is not leaked in the log
|
blacklist = os.environ.get("WORKER_ENVIRONMENT_BLACKLIST", "WORKERPASS").split()
|
for name in list(os.environ.keys()):
|
for toremove in blacklist:
|
if fnmatch.fnmatch(name, toremove):
|
del os.environ[name]
|
|
keepalive = 600
|
umask = None
|
maxdelay = 300
|
allow_shutdown = None
|
maxretries = 10
|
|
s = Worker(buildmaster_host, port, workername, passwd, basedir,
|
keepalive, umask=umask, maxdelay=maxdelay,
|
allow_shutdown=allow_shutdown, maxRetries=maxretries)
|
s.setServiceParent(application)
|
Attention the WORKERNAME must match the name of the LibVirt VM. The password also needs to be set.
- Ideally, include a possibility to easily add packages if needed.
Attachments
Issue Links
- is part of
-
MDBF-121 Add remaining installation and upgrade tests
- Closed