how to setup rebuilderd on Debian (temporary URL)
(version 0.1, based on previous notes but as such untested. feedback much welcome.)
USER=rebuilderd
REBUILDERD_HOSTNAME=rebuilderd.example.org
# to get a working debrebuild (from devscripts) and sbuild with unshare backend
sudo apt install devscripts sbuild uidmap
# todo: check if these are really needed
sudo apt install apt-utils dpkg-dev equivs mmdebstrap python3-pycurl libwww-perl libjson-perl wget libstring-shellquote-perl python3-requests libwww-perl libjson-perl python3-debian debian-keyring debootstrap libarchive13t64 qemu-user-static genext2fs ncompress qemu-user squashfs-tools-ng arch-test fakechroot libdistro-info-perl
sudo mkdir -p /srv/rebuilderd/cache
sudo mkdir -p /srv/rebuilderd/results
sudo chown -R $USER:$USER /srv/rebuilderd
# make sure $USER is mentioned in /etc/sub(uid|gid)
# (this is only the case for installations done with bookworm or later)
for i in uid git ; do
grep $USER /etc/sub$i || echo $USER must be added to /etc/sub$i manually
done
# install rebuilderd
sudo apt install cargo pkg-config liblzma-dev scdoc libzstd-dev libssl-dev libsqlite3-dev jq nginx sqlite3
cd
git clone https://github.com/kpcyrd/rebuilderd && cd rebuilderd
make
sudo make DESTDIR=/opt install
sudo vi /opt/etc/rebuilderd-worker.conf
# use upstream provided default and make sure it has /opt in backend path
[backend."debian"]
path = "/opt/usr/libexec/rebuilderd/rebuilder-debian.sh"
sudo vi /opt/usr/libexec/rebuilderd/rebuilder-debian.sh
# so it has this content:
#!/bin/sh
set -xe
cd "$(dirname "$1")"
/usr/bin/debrebuild --buildresult="${REBUILDERD_OUTDIR}" --builder=sbuild+unshare --cache=/srv/rebuilderd/cache -- "${1}"
#
# FIXME: this should be done using services
#
# then start rebuilderd as $USER in screen:
/opt/usr/bin/rebuilderd -c /opt/etc/rebuilderd.conf
# then as $USER tell it to schedule some work:
env REBUILDERD_COOKIE_PATH=~/.local/share/rebuilderd-auth-cookie /opt/usr/bin/rebuildctl -H http://127.0.0.1:8484 pkgs sync-profile --sync-config /opt/etc/rebuilderd-sync.conf debian-main
# then start two workers as $USER in screen:
cd
mkdir 1 2
cd 1
/opt/usr/bin/rebuilderd-worker -c /opt/etc/rebuilderd-worker.conf connect
cd 2
/opt/usr/bin/rebuilderd-worker -c /opt/etc/rebuilderd-worker.conf connect
# run this in screen to update the list of packages frequently
while true ; do env REBUILDERD_COOKIE_PATH=~/.local/share/rebuilderd-auth-cookie /opt/usr/bin/rebuildctl -H http://127.0.0.1:8484 pkgs sync-profile --sync-config /opt/etc/rebuilderd-sync.conf debian-main ; echo sleeping 3h now ; sleep 3h ; done
#
# FIXME: this should be done, aehm, differently ;)
#
# setup nginx
cd /var/www/html/
wget https://salsa.debian.org/qa/jenkins.debian.net/-/raw/master/hosts/osuosl5-amd64/var/www/html/index.html
sed -i "s#reproduce.debian.net#$REBUILDERD_HOSTNAME#g" index.html
# add to /etc/nginx/sites-enabled/default
location /api/ {
proxy_pass http://127.0.0.1:8484;
}