From c81b498df13c294045cfe1f4e24f39148b130923 Mon Sep 17 00:00:00 2001 From: Ilker Manap Date: Tue, 27 Oct 2026 02:12:08 +0100 Subject: [PATCH] compute image: dbus for slurmd's systemd scope; controller slurm.conf sync timer Co-Authored-By: Claude Fable 5.1 --- deploy/install.sh | 5 +++++ deploy/rollcall-controller-sync.service | 12 ++++++++++++ deploy/rollcall-controller-sync.timer | 9 +++++++++ images/compute-debian13/packages.list | 1 + 4 files changed, 27 insertions(+) create mode 100644 deploy/rollcall-controller-sync.service create mode 100644 deploy/rollcall-controller-sync.timer diff --git a/deploy/install.sh b/deploy/install.sh index 29f39fd..06561b3 100644 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -31,8 +31,13 @@ chgrp -R rollcall /etc/rollcall/overlays install -d -m 0755 /var/lib/rollcall install -d -m 0755 -o rollcall -g rollcall /var/lib/rollcall/dnsmasq install -m 0644 rollcall-dnsmasq.path rollcall-dnsmasq.service /etc/systemd/system/ +# optional: this host is also the Slurm controller -> keep its slurm.conf rendered from the profile +install -m 0644 rollcall-controller-sync.service rollcall-controller-sync.timer /etc/systemd/system/ systemctl daemon-reload systemctl enable --now rollcall-dnsmasq.path >/dev/null 2>&1 || true +if systemctl list-unit-files slurmctld.service >/dev/null 2>&1 && [ -d /etc/slurm ]; then + systemctl enable --now rollcall-controller-sync.timer >/dev/null 2>&1 || true +fi systemctl enable --now rollcall.service systemctl restart rollcall.service sleep 1 diff --git a/deploy/rollcall-controller-sync.service b/deploy/rollcall-controller-sync.service new file mode 100644 index 0000000..94eb4b4 --- /dev/null +++ b/deploy/rollcall-controller-sync.service @@ -0,0 +1,12 @@ +[Unit] +Description=rollcall: keep the local Slurm controller's slurm.conf in sync with the rendered profile +After=rollcall.service + +[Service] +Type=oneshot +# PROFILE is the profile whose overlay carries slurm.conf +Environment=PROFILE=compute +ExecStart=/bin/sh -c 'set -e; new=$(/usr/local/bin/rollcall render "$PROFILE" etc/slurm/slurm.conf) || exit 0; \ + if ! printf "%%s\n" "$new" | grep -v "^# rendered by rollcall" | cmp -s - <(grep -v "^# rendered by rollcall" /etc/slurm/slurm.conf 2>/dev/null); then \ + printf "%%s\n" "$new" > /etc/slurm/slurm.conf.new && mv /etc/slurm/slurm.conf.new /etc/slurm/slurm.conf; \ + systemctl try-restart slurmctld.service; echo "slurm.conf updated"; fi' diff --git a/deploy/rollcall-controller-sync.timer b/deploy/rollcall-controller-sync.timer new file mode 100644 index 0000000..54c24c7 --- /dev/null +++ b/deploy/rollcall-controller-sync.timer @@ -0,0 +1,9 @@ +[Unit] +Description=rollcall: controller slurm.conf sync every minute + +[Timer] +OnBootSec=1min +OnUnitActiveSec=1min + +[Install] +WantedBy=timers.target diff --git a/images/compute-debian13/packages.list b/images/compute-debian13/packages.list index 362369a..6a2d565 100644 --- a/images/compute-debian13/packages.list +++ b/images/compute-debian13/packages.list @@ -33,3 +33,4 @@ firmware-qlogic firmware-realtek amd64-microcode intel-microcode +dbus