Skip to content

Commit a044a09

Browse files
classabbyampthe-maldridge
authored andcommitted
services/nomad/build/buildbot*: make buildroot a host volume
also increase the recent build count 20 -> 30
1 parent bcc5f4f commit a044a09

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

services/nomad/build/buildbot-worker.nomad

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,25 @@ job "buildbot-worker" {
4040
}
4141
}
4242

43+
dynamic "volume" {
44+
for_each = [ "${group.value.name}" ]
45+
labels = [ "${volume.value}_buildrootdir" ]
46+
47+
content {
48+
type = "host"
49+
source = "${volume.value}_buildrootdir"
50+
read_only = false
51+
}
52+
}
53+
4354
// https://github.com/hashicorp/nomad/issues/8892
4455
task "prep-host-dirs" {
4556
driver = "docker"
4657

4758
config {
4859
image = "ghcr.io/void-linux/void-glibc-full:20240526R1"
4960
command = "chown"
50-
args = ["418:418", "/hostdir", "/workdir"]
61+
args = ["418:418", "/hostdir", "/workdir", "/buildroots"]
5162
}
5263

5364
volume_mount {
@@ -60,6 +71,11 @@ job "buildbot-worker" {
6071
destination = "/workdir"
6172
}
6273

74+
volume_mount {
75+
volume = "${group.value.name}_buildrootdir"
76+
destination = "/buildroots"
77+
}
78+
6379
lifecycle {
6480
hook = "prestart"
6581
}
@@ -94,6 +110,11 @@ job "buildbot-worker" {
94110
destination = "/workdir"
95111
}
96112

113+
volume_mount {
114+
volume = "${group.value.name}_buildrootdir"
115+
destination = "/buildroots"
116+
}
117+
97118
template {
98119
data = <<EOF
99120
{{ range service "buildbot-worker" -}}

services/nomad/build/buildbot.cfg

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ c = BuildmasterConfig = {
6262
'auth': netauth,
6363
'ui_default_config': {
6464
'Links.build_link_template': "%(build_number)",
65+
'Home.max_recent_builds': 30,
6566
'Waterfall.number_background_waterfall': True,
6667
'Waterfall.show_builders_without_builds': True,
6768
'Builders.show_workers_name': True,
@@ -124,7 +125,7 @@ c['schedulers'].append(schedulers.ForceScheduler(
124125
distdir = lambda f: util.Interpolate(f'/workdir/%(prop:name)s/void-packages/{f}')
125126
bulkdir = lambda f: util.Interpolate(f'/workdir/%(prop:name)s/xbps-bulk/{f}')
126127
hostdir = '/hostdir'
127-
buildroot = 'buildroot'
128+
buildroot = lambda: util.Interpolate(f'/buildroots/%(prop:name)s/buildroot')
128129
builddir = lambda: util.Interpolate('builddir-%(prop:buildnumber)s')
129130
do_sync = lambda: util.Interpolate('%(prop:sync)s') == "True"
130131
hide_skipped = lambda results, _: results == SKIPPED
@@ -138,7 +139,7 @@ def make_xbps_src_cmd(props, cmd):
138139
command = [
139140
distdir('xbps-src'),
140141
'-H', hostdir,
141-
'-m', buildroot,
142+
'-m', buildroot(),
142143
'-A', props.getProperty('host'),
143144
]
144145

@@ -158,7 +159,7 @@ def make_xbps_bulk_cmd(props):
158159
bulkdir('configure'),
159160
'-h', hostdir,
160161
'-d', distdir(''),
161-
'-m', f'../{buildroot}',
162+
'-m', buildroot(),
162163
'-t',
163164
]
164165
if props.getProperty('cross') == 'True':

0 commit comments

Comments
 (0)