From 0769741a64b32da0d74ea4c07b727bed525d6391 Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 29 Sep 2020 15:44:16 +0200 Subject: [PATCH] config: Restructured Signed-off-by: Thomas Klaehn --- config/__init__.py | 6 +- config/__pycache__/__init__.cpython-36.pyc | Bin 205 -> 0 bytes .../__pycache__/change_sources.cpython-36.pyc | Bin 439 -> 0 bytes config/__pycache__/schedulers.cpython-36.pyc | Bin 546 -> 0 bytes config/__pycache__/workers.cpython-36.pyc | Bin 411 -> 0 bytes config/builders/__init__.py | 3 + config/builders/beaglebone_yocto.py | 21 +++---- config/builders/bicycle_statistics.py | 13 ++--- config/builders/pinetime.py | 36 ++++++++++++ config/builders/raspberrypi3_64.py | 51 +++++++++++++++++ config/builders/raspberrypi4_64.py | 51 +++++++++++++++++ config/change_sources.py | 38 ------------- config/schedulers.py | 53 ------------------ config/workers.py | 10 ---- master.cfg | 10 ++-- 15 files changed, 165 insertions(+), 127 deletions(-) delete mode 100644 config/__pycache__/__init__.cpython-36.pyc delete mode 100644 config/__pycache__/change_sources.cpython-36.pyc delete mode 100644 config/__pycache__/schedulers.cpython-36.pyc delete mode 100644 config/__pycache__/workers.cpython-36.pyc create mode 100644 config/builders/pinetime.py create mode 100644 config/builders/raspberrypi3_64.py create mode 100644 config/builders/raspberrypi4_64.py delete mode 100644 config/change_sources.py delete mode 100644 config/schedulers.py delete mode 100644 config/workers.py diff --git a/config/__init__.py b/config/__init__.py index 16aff3d..6230c6c 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -1,4 +1,4 @@ -from .change_sources import append -from .schedulers import append -from .workers import append +#from .change_sources import append +#from .schedulers import append +#from .workers import append diff --git a/config/__pycache__/__init__.cpython-36.pyc b/config/__pycache__/__init__.cpython-36.pyc deleted file mode 100644 index 66a1f18a7a3d382a7eac0240f8d6fb67a3120378..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 205 zcmXr!<>lhhDUXe3U|@I*#Bjg_WH|tFu?CPxVMt-jVaR2SVq}D{nUL7bP&QLAgC_G! zMxb&{##?NO1qG>jDSnzPxA>AX67$kiy*`6c?v`FUxX>H6{UnR%Hd@$q^EmA5!-a`QpD?LgKQ Lvj7PmMjl20!a*@S diff --git a/config/__pycache__/change_sources.cpython-36.pyc b/config/__pycache__/change_sources.cpython-36.pyc deleted file mode 100644 index 2092ddb28380c044ffeb43b7ae83cf2be6000b68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 439 zcmY*VJx{|h6nsw8e5tKiSr}MQ5K0C%gb)$~VyTc|iiE1vcGI-3W7!T8RX11|_zlbq z{GqH&`~@anQX!Qm-C6d#=R5m!IE>yuUmw;Uz!&Tk?%@()j*%EJB49-_LV%Nn!yMLQ zF6%Sz&CPnuXTb|(E(`A1{&t<{Q+Oyo)gszX~)+%$BrbTI!smSSaR!W&L zp4z2Ix1t1l_vHz}8{EcMx>|5*GhcI6)mk*cROgb;xyc5q65>W$t{-zjQQuX&I*2QT z86j<80hT;t>v6`st2NS6ptywYsOKhy*E;DkE>e!$* zEfHQV^NC>s}a|>+%|Yqx2Rpd zJ=Tpvy&|v?`L5RzH)r00YhRL1$w}}kX!*#=uE@+Kxo_;iEPMwzXZ)Oza99s| diff --git a/config/__pycache__/workers.cpython-36.pyc b/config/__pycache__/workers.cpython-36.pyc deleted file mode 100644 index 3318ddcb3e112e3e2c97576cad8bc83de2dfff5a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 411 zcmYk2&q~8U5XNV=Nt#A0q9^eQA~Yc_+CPX0dhj5-F1?chYmbZqMoT2klPx*k=9~&qDH#9x_=dJ)Q-VC?v=#%9BxEP|6*WB}}2f7s6Wt zLEzA4$_RvrQm!nTJ6g>ptoo{wACQ}5{5^End~TSf_wmI2Z*atOu2V<7oS~5bT3Fo- zZC&lIU5-fRlQ@-m$>Z-`R?yc$5v9d#wSc_bWaX;{Zb*Y3lzBSK_&kZu%0I~xX`7kI G&}4tvvtdvG diff --git a/config/builders/__init__.py b/config/builders/__init__.py index 199b62c..f13f2d1 100644 --- a/config/builders/__init__.py +++ b/config/builders/__init__.py @@ -1,5 +1,7 @@ from .ads1115 import append from .beaglebone_yocto import append +from .raspberrypi3_64 import append +from .raspberrypi4_64 import append from .bicycle_statistics import append from .gpio_ftdi import append from .gpio_sys import append @@ -7,4 +9,5 @@ from .i2c_bb import append from .periflash import append from .test_c import append from .voltage_app import append +from .pinetime import append diff --git a/config/builders/beaglebone_yocto.py b/config/builders/beaglebone_yocto.py index def0c4b..c50fb0a 100644 --- a/config/builders/beaglebone_yocto.py +++ b/config/builders/beaglebone_yocto.py @@ -7,8 +7,7 @@ BRANCH = util.Property('branch', default='master') COMMANDS = [] COMMANDS.append(['repo', 'init', '-u', REPOURL_MANIFEST]) COMMANDS.append(['repo', 'sync']) -COMMANDS.append(['bash', '-c', 'MACHINE=beaglebone-yocto source blackfinn-init-build-env; bitbake console-image']) -COMMANDS.append(['bash', '-c', 'MACHINE=beaglebone-yocto source blackfinn-init-build-env; bitbake console-dev-image']) +COMMANDS.append(['bash', '-c', 'MACHINE=beaglebone-yocto source blackfinn-init-build-env; echo "DL_DIR ?= \\"/yocto/downloads\\"" >> conf/local.conf; echo "SSTATE_DIR ?= \\"/yocto/sstate-cache\\"" >> conf/local.conf; cat conf/local.conf; bitbake docker-image']) # Change sources cs_linux_yocto = changes.GitPoller(project='linux-yocto', repourl=REPOURL_MANIFEST, branches=True, pollInterval=60) @@ -21,22 +20,24 @@ for cmd in COMMANDS: factory.addStep(steps.ShellCommand(command=cmd)) # Worker -beaglebone_yocto_worker = worker.DockerLatentWorker('buildbot-oe-worker', 'pass', - docker_host='tcp://192.168.178.39:2375', - image='buildbot-oe-worker', - volumes=['/var/run/docker.sock:/var/run/docker.sock']) +beaglebone_yocto_worker = worker.DockerLatentWorker('buildbot-worker-openembedded', 'pass', + docker_host='tcp://192.168.178.82:2375', + image='buildbot-worker-openembedded', + volumes=['/var/run/docker.sock:/var/run/docker.sock', + '/srv/yocto/sstate-cache:/yocto/sstate-cache', + '/srv/yocto/downloads:/yocto/downloads']) # Builder -beaglebone_yocto_builder = util.BuilderConfig(name='beaglebone_yocto_builder', - workernames=["buildbot-oe-worker"], +beaglebone_yocto_builder = util.BuilderConfig(name='beaglebone_yocto', + workernames=["buildbot-worker-openembedded"], factory=factory) # Schedulers change_scheduler = schedulers.SingleBranchScheduler(name="beaglebone-yocto", change_filter=util.ChangeFilter(project=['linux-yocto', 'meta-blackfinn']), - treeStableTimer=None, builderNames=["beaglebone_yocto_builder"]) + treeStableTimer=None, builderNames=["beaglebone_yocto"]) -force_scheduler = schedulers.ForceScheduler(name="force_beaglebone-yocto", builderNames=["beaglebone_yocto_builder"]) +force_scheduler = schedulers.ForceScheduler(name="force_beaglebone-yocto", builderNames=["beaglebone_yocto"]) def append(c): diff --git a/config/builders/bicycle_statistics.py b/config/builders/bicycle_statistics.py index 5d0ac13..7cc432c 100644 --- a/config/builders/bicycle_statistics.py +++ b/config/builders/bicycle_statistics.py @@ -5,7 +5,8 @@ REPOYRL_PYTHON = 'https://git.blackfinn.de/python/bicycle-statistics.git' BRANCH = util.Property('branch', default='master') COMMANDS = [] -COMMANDS.append(['docker', 'build', '--no-cache', '-t', 'bicycle-statistics', '.']) +COMMANDS.append(['git', 'clone', '--branch', BRANCH, REPOURL_DOCKER]) +COMMANDS.append(['docker', 'build', '--no-cache', '-t', 'bicycle-statistics', './bicycle-statistics']) COMMANDS.append(['docker', 'rm', '-f', 'bicycle-statistics']) COMMANDS.append(['docker', 'run', '-d', '-v', '/srv/nextcloud/data/tkl/files/Bicycle:/bs_in', '-v', @@ -24,20 +25,18 @@ cs_bicycle_docker = changes.GitPoller(project='bicycle-statistics-docker', # Factory factory = util.BuildFactory() -factory.addStep(steps.Git(repourl=REPOURL_DOCKER, branch=BRANCH)) - for cmd in COMMANDS: factory.addStep(steps.ShellCommand(command=cmd)) # Worker -bicycle_worker = worker.DockerLatentWorker('buildbot-docker-worker', 'pass', - docker_host='tcp://192.168.178.39:2375', - image='buildbot-docker-worker', +bicycle_worker = worker.DockerLatentWorker('buildbot-worker-docker', 'pass', + docker_host='tcp://192.168.178.82:2375', + image='buildbot-worker-docker', volumes=['/var/run/docker.sock:/var/run/docker.sock']) # Builder bicycle_builder = util.BuilderConfig(name='bicycle_statistics', - workernames=["buildbot-docker-worker"], + workernames=["buildbot-worker-docker"], factory=factory) # Schedulers diff --git a/config/builders/pinetime.py b/config/builders/pinetime.py new file mode 100644 index 0000000..3c929a1 --- /dev/null +++ b/config/builders/pinetime.py @@ -0,0 +1,36 @@ +from buildbot.plugins import changes, schedulers, steps, util, worker + +REPOURL = 'https://git.blackfinn.de/smartwatch/narf52.git' + +# Change sources +cs = changes.GitPoller(project='narf52', repourl=REPOURL, branches=True, pollInterval=60) + +# Factory +factory = util.BuildFactory() +factory.addStep(steps.Git(repourl=REPOURL, mode='full')) +factory.addStep(steps.Compile(command=['APPLICATION=blinky', 'PLATFORM=nrf52', 'make', 'all', '-j8'])) + +# Worker +arm_none_eabi_worker = worker.DockerLatentWorker('buildbot-worker-arm-none-eabi', 'pass', docker_host='tcp://192.168.178.82:2375', image='buildbot-worker-arm-none-eabi') + +# Builder +builder = util.BuilderConfig(name='pinetime', workernames=["buildbot-worker-arm-none-eabi"], + factory=factory) + +# Scheduler +# Schedulers +change_scheduler = schedulers.SingleBranchScheduler(name="narf52", + change_filter=util.ChangeFilter(project=['narf52']), + treeStableTimer=None, builderNames=["pinetime"]) + +force_scheduler = schedulers.ForceScheduler(name="force_pinetime", builderNames=["pinetime"]) + + +def append(c): + c['change_source'].append(cs) + c['workers'].append(arm_none_eabi_worker) + c['builders'].append(builder) + c['schedulers'].append(change_scheduler) + c['schedulers'].append(force_scheduler) + return c + diff --git a/config/builders/raspberrypi3_64.py b/config/builders/raspberrypi3_64.py new file mode 100644 index 0000000..a91021f --- /dev/null +++ b/config/builders/raspberrypi3_64.py @@ -0,0 +1,51 @@ +from buildbot.plugins import changes, schedulers, steps, util, worker + +REPOURL_MANIFEST = 'https://git.blackfinn.de/yocto/linux-blackfinn.git' +REPOURL_META_BLACKFINN = 'https://git.blackfinn.de/yocto/meta-blackfinn.git' +BRANCH = util.Property('branch', default='master') + +COMMANDS = [] +COMMANDS.append(['repo', 'init', '-u', REPOURL_MANIFEST]) +COMMANDS.append(['repo', 'sync']) +COMMANDS.append(['bash', '-c', 'MACHINE=raspberrypi3-64 source blackfinn-init-build-env; echo "DL_DIR ?= \\"/yocto/downloads\\"" >> conf/local.conf; echo "SSTATE_DIR ?= \\"/yocto/sstate-cache\\"" >> conf/local.conf; cat conf/local.conf; bitbake docker-image']) + +# Change sources +cs_linux_yocto = changes.GitPoller(project='linux-yocto', repourl=REPOURL_MANIFEST, branches=True, pollInterval=60) +cs_meta_bf = changes.GitPoller(project='meta-blackfinn', repourl=REPOURL_META_BLACKFINN, branches=True, pollInterval=60) + +# Factory +factory = util.BuildFactory() + +for cmd in COMMANDS: + factory.addStep(steps.ShellCommand(command=cmd)) + +# Worker +rpi3_worker = worker.DockerLatentWorker('buildbot-worker-openembedded', 'pass', + docker_host='tcp://192.168.178.82:2375', + image='buildbot-worker-openembedded', + volumes=['/var/run/docker.sock:/var/run/docker.sock', + '/srv/yocto/sstate-cache:/yocto/sstate-cache', + '/srv/yocto/downloads:/yocto/downloads']) + +# Builder +rpi3_builder = util.BuilderConfig(name='raspberrypi3-64', + workernames=["buildbot-worker-openembedded"], + factory=factory) + +# Schedulers +change_scheduler = schedulers.SingleBranchScheduler(name="raspberrypi3-64", + change_filter=util.ChangeFilter(project=['linux-yocto', 'meta-blackfinn']), + treeStableTimer=None, builderNames=["raspberrypi3-64"]) + +force_scheduler = schedulers.ForceScheduler(name="force_raspberrypi3-64", builderNames=["raspberrypi3-64"]) + + +def append(c): + c['change_source'].append(cs_linux_yocto) + c['change_source'].append(cs_meta_bf) + c['workers'].append(rpi3_worker) + c['builders'].append(rpi3_builder) + c['schedulers'].append(change_scheduler) + c['schedulers'].append(force_scheduler) + return c + diff --git a/config/builders/raspberrypi4_64.py b/config/builders/raspberrypi4_64.py new file mode 100644 index 0000000..760253f --- /dev/null +++ b/config/builders/raspberrypi4_64.py @@ -0,0 +1,51 @@ +from buildbot.plugins import changes, schedulers, steps, util, worker + +REPOURL_MANIFEST = 'https://git.blackfinn.de/yocto/linux-blackfinn.git' +REPOURL_META_BLACKFINN = 'https://git.blackfinn.de/yocto/meta-blackfinn.git' +BRANCH = util.Property('branch', default='master') + +COMMANDS = [] +COMMANDS.append(['repo', 'init', '-u', REPOURL_MANIFEST]) +COMMANDS.append(['repo', 'sync']) +COMMANDS.append(['bash', '-c', 'MACHINE=raspberrypi4-64 source blackfinn-init-build-env; echo "DL_DIR ?= \\"/yocto/downloads\\"" >> conf/local.conf; echo "SSTATE_DIR ?= \\"/yocto/sstate-cache\\"" >> conf/local.conf; cat conf/local.conf; bitbake docker-image']) + +# Change sources +cs_linux_yocto = changes.GitPoller(project='linux-yocto', repourl=REPOURL_MANIFEST, branches=True, pollInterval=60) +cs_meta_bf = changes.GitPoller(project='meta-blackfinn', repourl=REPOURL_META_BLACKFINN, branches=True, pollInterval=60) + +# Factory +factory = util.BuildFactory() + +for cmd in COMMANDS: + factory.addStep(steps.ShellCommand(command=cmd)) + +# Worker +rpi4_worker = worker.DockerLatentWorker('buildbot-worker-openembedded', 'pass', + docker_host='tcp://192.168.178.82:2375', + image='buildbot-worker-openembedded', + volumes=['/var/run/docker.sock:/var/run/docker.sock', + '/srv/yocto/sstate-cache:/yocto/sstate-cache', + '/srv/yocto/downloads:/yocto/downloads']) + +# Builder +rpi4_builder = util.BuilderConfig(name='raspberrypi4-64', + workernames=["buildbot-worker-openembedded"], + factory=factory) + +# Schedulers +change_scheduler = schedulers.SingleBranchScheduler(name="raspberrypi4-64", + change_filter=util.ChangeFilter(project=['linux-yocto', 'meta-blackfinn']), + treeStableTimer=None, builderNames=["raspberrypi4-64"]) + +force_scheduler = schedulers.ForceScheduler(name="force_raspberrypi4-64", builderNames=["raspberrypi4-64"]) + + +def append(c): + c['change_source'].append(cs_linux_yocto) + c['change_source'].append(cs_meta_bf) + c['workers'].append(rpi4_worker) + c['builders'].append(rpi4_builder) + c['schedulers'].append(change_scheduler) + c['schedulers'].append(force_scheduler) + return c + diff --git a/config/change_sources.py b/config/change_sources.py deleted file mode 100644 index f825f8f..0000000 --- a/config/change_sources.py +++ /dev/null @@ -1,38 +0,0 @@ -from buildbot.plugins import changes - -cs_test_c = changes.GitPoller(project='test.c', - repourl='https://git.blackfinn.de/tkl/test.c.git', - branches=True, pollInterval=300) - -## gpio_ftdi -#cs_gpio_ftdi = changes.GitPoller(project='gpio_ftdi', -# repourl='https://git.blackfinn.de/adc_gpio_i2c/gpio_ftdi.git', -# branches=True, pollInterval=60) -## gpio_sys -#cs_gpio_sys = changes.GitPoller(project='gpio_sys', -# repourl='https://git.blackfinn.de/adc_gpio_i2c/gpio_sys.git', -# branches=True, pollInterval=60) -## i2c_bb -#cs_i2c_bb = changes.GitPoller(project='i2c_bb', -# repourl='https://git.blackfinn.de/adc_gpio_i2c/i2c_bb.git', -# branches=True, pollInterval=60) - -## ads1115 -#cs_ads1115 = changes.GitPoller(project='ads1115', -# repourl='https://git.blackfinn.de/adc_gpio_i2c/ads1115.git', -# branches=True, pollInterval=60) - -## voltage_app -#cs_voltage_app = changes.GitPoller(project='voltage_app', -# repourl='https://git.blackfinn.de/adc_gpio_i2c/voltage_app.git', -# branches=True, pollInterval=60) - -def append(change_sources): - change_sources.append(cs_test_c) -# change_sources.append(cs_gpio_ftdi) -# change_sources.append(cs_gpio_sys) -# change_sources.append(cs_i2c_bb) -# change_sources.append(cs_ads1115) -# change_sources.append(cs_voltage_app) - return change_sources - diff --git a/config/schedulers.py b/config/schedulers.py deleted file mode 100644 index 3353983..0000000 --- a/config/schedulers.py +++ /dev/null @@ -1,53 +0,0 @@ -from buildbot.plugins import schedulers, util - -sched_a1 = schedulers.SingleBranchScheduler(name="test_c", - change_filter=util.ChangeFilter(project='test.c'), - treeStableTimer=None, builderNames=["test.c"]) -sched_a2 = schedulers.ForceScheduler(name="force_test_c", builderNames=["test.c"]) - -#sched_b1 = schedulers.SingleBranchScheduler(name="gpio_ftdi", -# change_filter=util.ChangeFilter(project='gpio_ftdi'), -# treeStableTimer=None, builderNames=["gpio_ftdi"]) - -#sched_b2 = schedulers.ForceScheduler(name="force_gpio_ftdi", builderNames=["gpio_ftdi"]) - -#sched_c1 = schedulers.SingleBranchScheduler(name="gpio_sys", -# change_filter=util.ChangeFilter(project='gpio_sys'), -# treeStableTimer=None, builderNames=["gpio_sys"]) -#sched_c2 = schedulers.ForceScheduler(name="force_gpio_sys", builderNames=["gpio_sys"]) - -#sched_d1 = schedulers.SingleBranchScheduler(name="i2c_bb", -# change_filter=util.ChangeFilter(project='i2c_bb'), -# treeStableTimer=None, builderNames=["i2c_bb"]) - -#sched_d2 = schedulers.ForceScheduler(name="force_i2c_bb", builderNames=["i2c_bb"]) - -#sched_e1 = schedulers.SingleBranchScheduler(name="ads1115", -# change_filter=util.ChangeFilter(project=['i2c_bb', 'ads1115']), -# treeStableTimer=None, builderNames=["ads1115"]) - -#sched_e2 = schedulers.ForceScheduler(name="force_ads1115", builderNames=["ads1115"]) - -#sched_f1 = schedulers.SingleBranchScheduler(name="voltage_app", -# change_filter=util.ChangeFilter(project=['voltage_app', -# 'ads1115', -# 'i2c_bb']), -# treeStableTimer=None, builderNames=["voltage_app"]) - -#sched_f2 = schedulers.ForceScheduler(name="force_voltage_app", builderNames=["voltage_app"]) - -def append(schedulers): - schedulers.append(sched_a1) - schedulers.append(sched_a2) -# schedulers.append(sched_b1) -# schedulers.append(sched_b2) -# schedulers.append(sched_c1) -# schedulers.append(sched_c2) -# schedulers.append(sched_d1) -# schedulers.append(sched_d2) -# schedulers.append(sched_e1) -# schedulers.append(sched_e2) -# schedulers.append(sched_f1) -# schedulers.append(sched_f2) - return schedulers - diff --git a/config/workers.py b/config/workers.py deleted file mode 100644 index 0678880..0000000 --- a/config/workers.py +++ /dev/null @@ -1,10 +0,0 @@ -from buildbot.plugins import worker - -cpp_worker = worker.DockerLatentWorker('buildbot-cpp-worker', 'pass', - docker_host='tcp://192.168.178.39:2375', - image='buildbot-cpp-worker') - -def append(workers): - workers.append(cpp_worker) - return workers - diff --git a/master.cfg b/master.cfg index e80d284..ca6dfcb 100644 --- a/master.cfg +++ b/master.cfg @@ -3,10 +3,7 @@ from buildbot.plugins import * -#import config.workers -import config.change_sources -import config.schedulers -from config.builders import * +import config.builders c = BuildmasterConfig = {} @@ -18,9 +15,10 @@ c['change_source'] = [] c['schedulers'] = [] c['builders'] = [] -c = config.builders.periflash.append(c) -c = config.builders.bicycle_statistics.append(c) c = config.builders.beaglebone_yocto.append(c) +c = config.builders.raspberrypi3_64.append(c) +c = config.builders.raspberrypi4_64.append(c) +c = config.builders.bicycle_statistics.append(c) ####### BUILDBOT SERVICES