Skip to content

Commit 4c53d48

Browse files
classabbyampthe-maldridge
authored andcommitted
services/nomad/build/buildbot: native aarch64 worker, use remote repo (shadow) only
1 parent c9f4ee9 commit 4c53d48

2 files changed

Lines changed: 34 additions & 54 deletions

File tree

services/nomad/build/buildbot.cfg

Lines changed: 25 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ from pathlib import Path
1010
from twisted.internet import defer
1111
from twisted.python import log
1212

13-
from buildbot.process.results import SUCCESS, SKIPPED
13+
from buildbot.process.results import SUCCESS
1414
from buildbot.plugins import util, secrets, reporters, worker, schedulers
1515
from buildbot.plugins import steps
1616

@@ -129,13 +129,19 @@ c['schedulers'].append(schedulers.ForceScheduler(
129129

130130
# ###### BUILDERS
131131

132-
distdir = lambda f: util.Interpolate(f'/workdir/%(prop:name)s/void-packages/{f}')
133-
bulkdir = lambda f: util.Interpolate(f'/workdir/%(prop:name)s/xbps-bulk/{f}')
132+
def distdir(f):
133+
return util.Interpolate(f'/workdir/%(prop:name)s/void-packages/{f}')
134+
135+
def bulkdir(f):
136+
return util.Interpolate(f'/workdir/%(prop:name)s/xbps-bulk/{f}')
137+
134138
hostdir = '/hostdir'
135-
buildroot = lambda: util.Interpolate(f'/buildroots/%(prop:name)s/buildroot')
136-
builddir = lambda: util.Interpolate('builddir-%(prop:buildnumber)s')
137-
do_sync = lambda: util.Interpolate('%(prop:sync)s') == "True"
138-
hide_skipped = lambda results, _: results == SKIPPED
139+
140+
def buildroot():
141+
return util.Interpolate('/buildroots/%(prop:name)s/buildroot')
142+
143+
def builddir():
144+
return util.Interpolate('builddir-%(prop:buildnumber)s')
139145

140146

141147
factory = util.BuildFactory()
@@ -198,7 +204,7 @@ def make_xbps_bulk_cmd(props):
198204
'-h', hostdir,
199205
'-d', distdir(''),
200206
'-m', buildroot(),
201-
'-t',
207+
'-t', '-s', '-S',
202208
]
203209
if props.getProperty('cross') == 'True':
204210
command += ['-a', props.getProperty('target')]
@@ -229,32 +235,21 @@ def build_packages(props):
229235
return cmds
230236

231237

232-
@util.renderer
233-
def make_prune_cmd(props):
234-
return ['bash', '-c',
235-
util.Interpolate(f"""
236-
export XBPS_TARGET_ARCH="%(prop:target)s"
237-
for repo in / /debug /nonfree /bootstrap; do
238-
xbps-rindex -r "{hostdir}/binpkgs/$repo"
239-
done
240-
if [ "$XBPS_TARGET_ARCH" = i686 ]; then
241-
for repo in /multilib /multilib/nonfree /multilib/bootstrap; do
242-
XBPS_TARGET_ARCH=x86_64 xbps-rindex -r "{hostdir}/binpkgs/$repo"
243-
done
244-
fi
245-
""")]
246-
247238
@util.renderer
248239
def make_rsync_cmd(props):
249-
return ['bash', '-c',
240+
return ['bash', '-e', '-c',
250241
util.Interpolate("""
251-
rsync -vurk --delete-after --delay-updates \
252-
--filter='+ */' --filter='+ %(prop:target)s-repodata' --filter='+ *.%(prop:target)s.xbps' \
253-
--filter='+ otime' --filter='- .*' --filter='- *' \
242+
echo "=> Syncing packages to the shadow repository..."
243+
rsync -vurk --delete-after \
244+
--filter='+ */' --filter='+ *.%(prop:target)s.xbps' \
245+
--filter='- .*' --filter='- *' \
254246
--password-file=/secrets/rsync/password /hostdir/binpkgs/ \
255247
{{ range nomadService 1 $allocID "build-rsyncd" -}}
256-
rsync://buildsync-%(prop:worker)s@{{ .Address }}:{{ .Port }}/%(prop:worker)s
257-
{{ end -}}""")]
248+
rsync://buildsync@{{ .Address }}:{{ .Port }}/incoming-%(prop:target)s
249+
{{ end -}}
250+
echo "=> Cleaning built packages..."
251+
find /hostdir/binpkgs -name '*.xbps' -o -name '*-repodata' -print -delete
252+
""")]
258253

259254

260255
factory.addStep(GitWithDiff(
@@ -350,18 +345,6 @@ factory.addStep(steps.ShellSequence(
350345
timeout=14400,
351346
))
352347

353-
factory.addStep(steps.ShellCommand(
354-
command=make_prune_cmd,
355-
name='prune_packages',
356-
description='removing obsolete packages',
357-
descriptionDone='removed obsolete packages',
358-
haltOnFailure=True,
359-
logEnviron=False,
360-
usePTY=True,
361-
workdir='.',
362-
timeout=14400,
363-
))
364-
365348
factory.addStep(steps.ShellCommand(
366349
command=make_rsync_cmd,
367350
name='sync_packages',
@@ -371,8 +354,6 @@ factory.addStep(steps.ShellCommand(
371354
logEnviron=False,
372355
usePTY=True,
373356
workdir='.',
374-
doStepIf=do_sync(),
375-
hideStepIf=hide_skipped,
376357
timeout=14400,
377358
decodeRC={
378359
0: SUCCESS,
@@ -393,8 +374,7 @@ for b in builders:
393374
'target': targetarch,
394375
'cross': str(hostarch != targetarch),
395376
'worker': b['worker'],
396-
'sync': str(b['sync']),
397-
'bootstrap_args': b.get('bootstrap_args', '-N'),
377+
'bootstrap_args': b.get('bootstrap_args', ''),
398378
}
399379

400380
c['builders'].append(util.BuilderConfig(

services/nomad/build/buildbot.nomad

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ EOF
107107
{ name = "aarch64", max-builds = 2 },
108108
],
109109
builders = [
110-
{ name = "x86_64", host = "x86_64", worker = "glibc", sync = false },
111-
{ name = "i686", host = "i686", worker = "glibc", sync = false },
112-
{ name = "armv7l", host = "x86_64", target = "armv7l", worker = "glibc", sync = false },
113-
{ name = "armv6l", host = "x86_64", target = "armv6l", worker = "glibc", sync = false },
114-
{ name = "x86_64-musl", host = "x86_64-musl", worker = "musl", sync = true },
115-
{ name = "armv7l-musl", host = "x86_64-musl", target = "armv7l-musl", worker = "musl", sync = true },
116-
{ name = "armv6l-musl", host = "x86_64-musl", target = "armv6l-musl", worker = "musl", sync = true },
117-
{ name = "aarch64", host = "x86_64", target = "aarch64", worker = "aarch64", sync = true, bootstrap_args = "" },
118-
{ name = "aarch64-musl", host = "x86_64-musl", target = "aarch64-musl", worker = "aarch64", sync = true, bootstrap_args = "" },
110+
{ name = "x86_64", host = "x86_64", worker = "glibc", },
111+
{ name = "i686", host = "i686", worker = "glibc", },
112+
{ name = "armv7l", host = "x86_64", target = "armv7l", worker = "glibc", },
113+
{ name = "armv6l", host = "x86_64", target = "armv6l", worker = "glibc", },
114+
{ name = "x86_64-musl", host = "x86_64-musl", worker = "musl", },
115+
{ name = "armv7l-musl", host = "x86_64-musl", target = "armv7l-musl", worker = "musl", },
116+
{ name = "armv6l-musl", host = "x86_64-musl", target = "armv6l-musl", worker = "musl", },
117+
{ name = "aarch64", host = "aarch64", worker = "aarch64" },
118+
{ name = "aarch64-musl", host = "aarch64-musl", worker = "aarch64" },
119119
],
120120
})
121121
destination = "local/workers.json"

0 commit comments

Comments
 (0)