-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
services/nomad/build/buildsync-{aarch64,musl}.nomad: use lsyncd
instead of a cron job, use rwc to trigger rsync jobs. This should also push to the glibc builder now, instead of the glibc builder pulling from the other builders
- Loading branch information
1 parent
2270f36
commit 0faaad5
Showing
2 changed files
with
58 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ job "buildsync-aarch64" { | |
namespace = "build" | ||
|
||
group "rsync" { | ||
count = 1 | ||
network { mode = "bridge" } | ||
|
||
volume "root-pkgs" { | ||
|
@@ -13,20 +14,11 @@ job "buildsync-aarch64" { | |
} | ||
|
||
task "rsync" { | ||
leader = true | ||
driver = "docker" | ||
|
||
vault { | ||
policies = ["void-secrets-buildsync"] | ||
} | ||
|
||
config { | ||
image = "eeacms/rsync" | ||
args = ["client"] | ||
} | ||
|
||
env { | ||
CRON_TASK_1="*/5 * * * * flock -n /run/rsync.lock rsync -vurk -e 'ssh -i /secrets/id_rsa -o UserKnownHostsFile=/local/known_hosts' --exclude '*.sig' --delete-after -f '+ */' -f '+ aarch64*-repodata' -f '+ *.aarch64*.xbps' -f '+ *.noarch*.xbps' -f '+ otime' -f '- *' [email protected]:/hostdir/binpkgs/ /pkgs/aarch64" | ||
image = "ghcr.io/void-linux/infra-lsyncd:202308" # TODO | ||
volumes = ["local/lsyncd.conf:/etc/lsyncd.conf"] | ||
} | ||
|
||
volume_mount { | ||
|
@@ -36,19 +28,34 @@ job "buildsync-aarch64" { | |
|
||
template { | ||
data = <<EOF | ||
{{- with secret "secret/buildsync/ssh" -}} | ||
{{.Data.private_key}} | ||
{{- end -}} | ||
EOF | ||
destination = "secrets/id_rsa" | ||
perms = "0400" | ||
} | ||
settings { | ||
statusFile = "/tmp/lsyncd.status", | ||
nodaemon = true, | ||
} | ||
template { | ||
data = <<EOF | ||
b-fsn-de.node.consul ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP1ykMRsB3/DOv/NhnhajQIB99xUdM7RauBS5ptj2i4q | ||
sync { | ||
default.rsync, | ||
source = "/pkgs/aarch64", | ||
target = "[email protected]::/pkgs/aarch64", | ||
delay = 15, | ||
filter = { | ||
"+ */", | ||
"+ *-repodata", | ||
"+ *.xbps", | ||
"+ otime", | ||
"- .*", | ||
"- *", | ||
}, | ||
rsync = { | ||
verbose = true, | ||
update = true, | ||
copy_dirlinks = true, | ||
_extra = { "--delete-after" }, | ||
} | ||
} | ||
EOF | ||
destination = "local/known_hosts" | ||
destination = "local/lsyncd.conf" | ||
perms = "0755" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ job "buildsync-musl" { | |
namespace = "build" | ||
|
||
group "rsync" { | ||
count = 1 | ||
network { mode = "bridge" } | ||
|
||
volume "root-pkgs" { | ||
|
@@ -13,20 +14,11 @@ job "buildsync-musl" { | |
} | ||
|
||
task "rsync" { | ||
leader = true | ||
driver = "docker" | ||
|
||
vault { | ||
policies = ["void-secrets-buildsync"] | ||
} | ||
|
||
config { | ||
image = "eeacms/rsync" | ||
args = ["client"] | ||
} | ||
|
||
env { | ||
CRON_TASK_1="*/5 * * * * flock -n /run/rsync.lock rsync -vurk -e 'ssh -i /secrets/id_rsa -o UserKnownHostsFile=/local/known_hosts' --exclude '*.sig' --delete-after -f '+ */' -f '+ *-repodata' -f '+ *.xbps' -f '+ otime' -f '- *' [email protected]:/hostdir/binpkgs/ /pkgs/musl/" | ||
image = "ghcr.io/void-linux/infra-lsyncd:202308" # TODO | ||
volumes = ["local/lsyncd.conf:/etc/lsyncd.conf"] | ||
} | ||
|
||
volume_mount { | ||
|
@@ -36,19 +28,34 @@ job "buildsync-musl" { | |
|
||
template { | ||
data = <<EOF | ||
{{- with secret "secret/buildsync/ssh" -}} | ||
{{.Data.private_key}} | ||
{{- end -}} | ||
EOF | ||
destination = "secrets/id_rsa" | ||
perms = "0400" | ||
} | ||
settings { | ||
statusFile = "/tmp/lsyncd.status", | ||
nodaemon = true, | ||
} | ||
template { | ||
data = <<EOF | ||
a-hel-fi.node.consul ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIW8voCZh9nQpdx3fAsvfZO4mCYv0/OUVNPF9A/GsHtX | ||
sync { | ||
default.rsync, | ||
source = "/pkgs/musl", | ||
target = "[email protected]::/pkgs/musl", | ||
delay = 15, | ||
filter = { | ||
"+ */", | ||
"+ *-repodata", | ||
"+ *.xbps", | ||
"+ otime", | ||
"- .*", | ||
"- *", | ||
}, | ||
rsync = { | ||
verbose = true, | ||
update = true, | ||
copy_dirlinks = true, | ||
_extra = { "--delete-after" }, | ||
} | ||
} | ||
EOF | ||
destination = "local/known_hosts" | ||
destination = "local/lsyncd.conf" | ||
perms = "0755" | ||
} | ||
} | ||
} | ||
|