Skip to content

Commit 4965d45

Browse files
classabbyampthe-maldridge
authored andcommitted
services/nomad/build/timefiles: only run on shadow
now that shadow is the first place a repository is assembled, this shouldn't run on builders
1 parent e6042c5 commit 4965d45

1 file changed

Lines changed: 27 additions & 36 deletions

File tree

services/nomad/build/timefiles.nomad

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,44 @@ job "timefiles" {
33
datacenters = ["VOID"]
44
namespace = "build"
55

6-
dynamic "group" {
7-
for_each = [ "glibc", "aarch64", "musl", ]
8-
labels = [ "timefiles-${group.value}" ]
6+
group "timefiles" {
7+
count = 1
98

10-
content {
11-
count = 1
12-
network { mode = "bridge" }
9+
volume "root_mirror" {
10+
type = "host"
11+
source = "root_mirror"
12+
read_only = false
13+
}
1314

14-
dynamic "volume" {
15-
for_each = [ "${group.value}" ]
16-
labels = [ "${volume.value}_hostdir" ]
15+
task "timefiles" {
16+
driver = "docker"
1717

18-
content {
19-
type = "host"
20-
source = "${volume.value}_hostdir"
21-
read_only = false
22-
}
18+
config {
19+
image = "ghcr.io/void-linux/void-glibc:20240526R1"
20+
command = "/local/run.sh"
2321
}
2422

25-
task "timefiles" {
26-
driver = "docker"
27-
28-
config {
29-
image = "ghcr.io/void-linux/void-glibc:20240526R1"
30-
command = "/local/run.sh"
31-
}
32-
33-
volume_mount {
34-
volume = "${group.value}_hostdir"
35-
destination = "/hostdir"
36-
}
23+
volume_mount {
24+
volume = "root_mirror"
25+
destination = "/mirror"
26+
}
3727

38-
template {
39-
data = <<EOF
28+
template {
29+
data = <<EOF
4030
#!/bin/sh
4131
4232
while true ; do
43-
t="$(date +%s)"
44-
for dir in / /nonfree /debug /multilib /multilib/nonfree /nonfree ; do
45-
echo "$t">"/hostdir/binpkgs/$dir/otime"
46-
done
47-
sleep 60
33+
t="$(date +%s)"
34+
for dir in / /nonfree /debug /multilib /multilib/nonfree /nonfree; do
35+
[ -e "/mirror/current/$dir" ] && echo "$t">"/mirror/current/$dir/otime"
36+
[ -e "/mirror/current/musl/$dir" ] && echo "$t">"/mirror/current/musl/$dir/otime"
37+
[ -e "/mirror/current/aarch64/$dir" ] && echo "$t">"/mirror/current/aarch64/$dir/otime"
38+
done
39+
sleep 60
4840
done
4941
EOF
50-
destination = "local/run.sh"
51-
perms = "0755"
52-
}
42+
destination = "local/run.sh"
43+
perms = "0755"
5344
}
5445
}
5546
}

0 commit comments

Comments
 (0)