Skip to content

Commit

Permalink
services/nomad/build/build-rsyncd.nomad: run an rsyncd for buildsync
Browse files Browse the repository at this point in the history
this allows the builders to push packages to the glibc builder and run
xbps-sign-repos after each transfer. xbps-sign-repos also now only adds
the key to the repodata and cleans old signatures
  • Loading branch information
classabbyamp committed Aug 13, 2023
1 parent 08959cb commit 0fe2dab
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 28 deletions.
59 changes: 59 additions & 0 deletions services/nomad/build/build-rsyncd.nomad
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
job "build-rsyncd" {
type = "service"
datacenters = ["VOID"]
namespace = "build"

group "rsync" {
count = 1
network {
mode = "host"
}

volume "root-pkgs" {
type = "host"
source = "root-pkgs"
read_only = false
}

task "rsyncd" {
driver = "docker"

vault {
policies = ["void-secrets-repomgmt"]
}

config {
image = "ghcr.io/void-linux/infra-rsync:202308" # TODO
volumes = [
"local/buildsync.conf:/etc/rsyncd.conf.d/buildsync.conf",
]
network_mode = "host"
}

volume_mount {
volume = "root-pkgs"
destination = "/pkgs"
}

template {
data = file("xbps-clean-sigs")
destination = "local/xbps-clean-sigs"
perms = "0755"
}

template {
data = <<EOF
[pkgs]
path = /pkgs
read only = no
list = yes
transfer logging = true
timeout = 600
exclude = - .* - *-repodata.* - *-stagedata.* - *.sig - *.sig2
post-xfer exec = /local/xbps-clean-sigs
EOF
destination = "local/buildsync.conf"
}
}
}
}
6 changes: 6 additions & 0 deletions services/nomad/build/xbps-clean-sigs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# Remove signatures that don't have a corresponding package.
find /pkgs \( -name '*.xbps.sig' -o -name '*.xbps.sig2' \) -exec sh -c 'for x in "$@"; do [ -e "${x%.sig*}" ] || rm -- $x; done' _ {} +

exit 0
28 changes: 0 additions & 28 deletions services/nomad/build/xbps-sign-repos

This file was deleted.

0 comments on commit 0fe2dab

Please sign in to comment.