You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2026/05/26 00:33:46 UTC
(airavata-custos) 02/02: Adding new users to test slurm cluster
This is an automated email from the ASF dual-hosted git repository.
DImuthuUpe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git
commit 161a1bd4ccfba7601c3cbb507185936d78b02857
Author: DImuthuUpe <di...@gmail.com>
AuthorDate: Mon May 25 20:33:38 2026 -0400
Adding new users to test slurm cluster
---
dev-ops/local-slurm/docker/Dockerfile.base | 7 +++++++
dev-ops/local-slurm/scripts/bootstrap-accounting.sh | 11 +++++++++++
dev-ops/local-slurm/scripts/entrypoint-login.sh | 6 ++----
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/dev-ops/local-slurm/docker/Dockerfile.base b/dev-ops/local-slurm/docker/Dockerfile.base
index f252d76d5..e3392d486 100644
--- a/dev-ops/local-slurm/docker/Dockerfile.base
+++ b/dev-ops/local-slurm/docker/Dockerfile.base
@@ -20,6 +20,13 @@ RUN dnf -y install epel-release \
RUN useradd -r -u 995 -g 0 -s /sbin/nologin slurm \
&& install -d -o slurm -g 0 -m 0755 /var/spool/slurm /var/log/slurm /var/run/slurm /etc/slurm
+# Test users baked into the base image so UIDs match across login,
+# slurmctld, and slurmd containers (slurmctld/slurmd both do pwd lookups
+# and slurmd execs the job as the submitting user).
+RUN useradd -m -u 1000 -s /bin/bash testuser \
+ && useradd -m -u 1001 -s /bin/bash testuser2 \
+ && useradd -m -u 1002 -s /bin/bash testuser3
+
RUN wget -q https://download.schedmd.com/slurm/slurm-${SLURM_VERSION}.tar.bz2 \
&& tar -xjf slurm-${SLURM_VERSION}.tar.bz2 \
&& cd slurm-${SLURM_VERSION} \
diff --git a/dev-ops/local-slurm/scripts/bootstrap-accounting.sh b/dev-ops/local-slurm/scripts/bootstrap-accounting.sh
index a8494393c..2c6427294 100755
--- a/dev-ops/local-slurm/scripts/bootstrap-accounting.sh
+++ b/dev-ops/local-slurm/scripts/bootstrap-accounting.sh
@@ -19,6 +19,17 @@ CLUSTER="${CLUSTER_NAME:-artisan}"
if ! sacctmgr -in show cluster format=cluster | grep -qw "$CLUSTER"; then
sacctmgr -i add cluster "$CLUSTER"
fi
+
+# slurm.conf sets AccountingStorageEnforce=...,qos,..., which means every
+# association must have at least one allowed QoS and a default QoS or the
+# controller rejects submissions with the misleading error "Invalid account
+# or account/partition combination specified". Ensure the built-in `normal`
+# QoS is allowed on the cluster and set as the default for new associations.
+if ! sacctmgr -in show qos format=name | grep -qw "normal"; then
+ sacctmgr -i add qos normal
+fi
+sacctmgr -i modify cluster "$CLUSTER" set QOS=normal DefaultQOS=normal >/dev/null
+
if ! sacctmgr -in show account format=account | grep -qw "root"; then
sacctmgr -i add account root Description="root account" Organization="$CLUSTER"
fi
diff --git a/dev-ops/local-slurm/scripts/entrypoint-login.sh b/dev-ops/local-slurm/scripts/entrypoint-login.sh
index 4f77e0ca5..4ef755819 100755
--- a/dev-ops/local-slurm/scripts/entrypoint-login.sh
+++ b/dev-ops/local-slurm/scripts/entrypoint-login.sh
@@ -8,10 +8,8 @@ install -d -m 0755 -o munge -g munge /var/run/munge
install -d -m 0700 -o munge -g munge /var/log/munge /var/lib/munge
runuser -u munge -- /usr/sbin/munged --force
-# Ensure the default test user exists
-id -u testuser >/dev/null 2>&1 || useradd -m -s /bin/bash testuser
-id -u testuser2 >/dev/null 2>&1 || useradd -m -s /bin/bash testuser2
-id -u testuser3 >/dev/null 2>&1 || useradd -m -s /bin/bash testuser3
+# testuser{,2,3} are baked into the base image with fixed UIDs so they
+# match across login/slurmctld/slurmd. Nothing to create here.
# Start sshd in the foreground
exec /usr/sbin/sshd -D -e