gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-deployment] branch master updated (128130a -> 4aadff0)


From: gnunet
Subject: [taler-deployment] branch master updated (128130a -> 4aadff0)
Date: Mon, 12 Jun 2023 20:58:14 +0200

This is an automated email from the git hooks/post-receive script.

devan-carpenter pushed a change to branch master
in repository deployment.

    from 128130a  -logging
     new 0f6749e  systemd: add service for container buildbot-worker
     new fc3375c  buildbot: add python syntax metadata to config
     new 559f6cd  buildbot: update copyright and authoriship header
     new 740aeef  buildbot: add a container factory and builder
     new 4aadff0  buildbot: prep workspace for the container jobs

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 buildbot/master.cfg                                | 94 +++++++++++++++++++++-
 ...k.service => buildbot-worker-container.service} |  6 +-
 2 files changed, 96 insertions(+), 4 deletions(-)
 copy systemd-services/{buildbot-worker-compilecheck.service => 
buildbot-worker-container.service} (61%)

diff --git a/buildbot/master.cfg b/buildbot/master.cfg
index 65a812d..dcb043f 100644
--- a/buildbot/master.cfg
+++ b/buildbot/master.cfg
@@ -1,6 +1,9 @@
+# -*- python -*-
+# ex: set syntax=python:
+
 ##
 # This file is part of TALER
-# (C) 2016-2022 Taler Systems SA
+# (C) 2016-2023 Taler Systems SA
 #
 # TALER is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Affero General Public
@@ -20,8 +23,11 @@
 # @author Marcello Stanisci
 # @author ng0
 # @author Christian Grothoff
+# @author Devan Carpenter
 import re
+
 from getpass import getuser
+
 from buildbot.steps.source.git import Git
 from buildbot.steps.shell import ShellCommand
 from buildbot.plugins import *
@@ -156,6 +162,22 @@ def update_deployment(factory):
     ))
 
 
+# Convenience function that builds and runs a container.
+def container_run_step(factory, WORK_DIR, containerName,
+                       jobCmd="/workdir/ci/ci.sh"):
+    factory.addStep(steps.ShellSequence(
+        name="container build and run",
+        commands=[
+            util.ShellArg(command=["podman", "build", "-t", containerName,
+                                   "."]),
+            util.ShellArg(command=["podman", "run", "-ti", "--rm", "--volume",
+                                   "$PWD:/workdir", "--workdir", "/workdir",
+                                   containerName, jobCmd]),
+        ],
+        haltOnFailure=True,
+        workdir=WORK_DIR
+    ))
+
 ##################################################################
 ######################## JOBS ####################################
 ##################################################################
@@ -1156,6 +1178,76 @@ BUILDERS.append(util.BuilderConfig(
 EMAIL_ALERTS.append("packaging-debian-builder")
 EMAIL_ALERTS.append("packaging-ubuntu-builder")
 
+#############################################
+# 19: CONTAINER FACTORY #####################
+#############################################
+##
+# These factories uses the standard podman worker.
+WORKERS.append(worker.Worker("container-worker", "container-pass"))
+
+#
+# container_repos = ["backoffice", "wallet-core", "bank", "exchange",
+#                    "merchant", "deployment", "twister", "sync",
+#                           "help", "taler-merchant-demos", "challenger"]
+#
+container_repos = ["wallet-core"]
+
+for reponame in container_repos:
+    ##
+    # Factory-wide variables
+    REPO_URL = "https://git.taler.net/"; + reponame[0] + ".git"
+    CONTAINER_WORKDIR = f"/home/container-worker/workspace/{reponame[0]}"
+
+    # Create a factory
+    container_factory = util.BuildFactory()
+    container_factory.workdir = CONTAINER_WORKDIR
+
+    # Setup workspace
+    container_factory.addStep(ShellCommand(
+        name="workspace",
+        descriptionDone="Workspace directory check",
+        command=f"test -d {CONTAINER_WORKDIR} || mkdir -p {CONTAINER_WORKDIR}",
+        haltOnFailure=True,
+    ))
+
+    # Ensure repo is cloned or clean.
+    # Git() will clone repo if it doesn't exist.
+    # Method fresh runs 'git clean -f -f -d -x', if checkout already exists.
+    # Only works with mode='full'
+    # Will checkout value of "branch" property from job properties.
+    # 
https://docs.buildbot.net/latest/manual/configuration/steps/source_git.html
+    container_factory.addStep(Git(
+        name="git",
+        repourl=REPO_URL,
+        mode='full',
+        method='fresh',
+        haltOnFailure=True,
+    ))
+
+    # Run container step with default commands
+    container_run_step(container_factory, CONTAINER_WORKDIR, reponame[0])
+
+    BUILDERS.append(util.BuilderConfig(
+        name=f"{reponame[0]}-builder",
+        workernames=["container-worker"],
+        factory=container_factory
+    ))
+    # Buildmaster is notified whenever deployment.git changes
+    SCHEDULERS.append(schedulers.SingleBranchScheduler(
+        name="container-scheduler",
+        change_filter=util.ChangeFilter(
+            branch="dev/dvn/container-ci",
+            project_re=f"({reponame[0]})"
+        ),
+        treeStableTimer=None,
+        builderNames=[f"{reponame[0]}-builder"]
+    ))
+
+## TODO: TBD
+#EMAIL_ALERTS.append("container-builder")
+
+
+
 ################ 99: debug stuff JOB ###################################
 
 # This does nothing, just a starting point for a factory.
diff --git a/systemd-services/buildbot-worker-compilecheck.service 
b/systemd-services/buildbot-worker-container.service
similarity index 61%
copy from systemd-services/buildbot-worker-compilecheck.service
copy to systemd-services/buildbot-worker-container.service
index d0df3d7..70d57c4 100644
--- a/systemd-services/buildbot-worker-compilecheck.service
+++ b/systemd-services/buildbot-worker-container.service
@@ -1,9 +1,9 @@
 [Unit]
-Description=Buildbot worker service for compile and check
-AssertPathExists=%h/worker
+Description=Buildbot worker service for container worker
+AssertPathExists=/home/container-worker/worker
 
 [Service]
-WorkingDirectory=%h
+WorkingDirectory=/home/container-worker/
 ExecStart=/usr/bin/buildbot-worker start --nodaemon worker
 ExecReload=/usr/bin/buildbot-worker restart --nodaemon worker
 ExecStop=/usr/bin/buildbot-worker stop worker

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]