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:44 UTC
(airavata-custos) branch master updated (f8fb89a52 -> 161a1bd4c)
This is an automated email from the ASF dual-hosted git repository.
DImuthuUpe pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git
from f8fb89a52 Add AMIE connector integration test suite (#483)
new a73f07e32 Adding qos to association
new 161a1bd4c Adding new users to test slurm cluster
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../SLURM/Association-Mapper/internal/operations/types.go | 6 ++++++
.../internal/subscribers/accountsub_integration_test.go | 6 +++---
.../SLURM/Association-Mapper/internal/subscribers/members.go | 2 ++
.../internal/subscribers/members_integration_test.go | 12 ++++++------
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 ++----
7 files changed, 37 insertions(+), 13 deletions(-)
(airavata-custos) 02/02: Adding new users to test slurm cluster
Posted by di...@apache.org.
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
(airavata-custos) 01/02: Adding qos to association
Posted by di...@apache.org.
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 a73f07e32ed1e3a88e2068f3d100d3ea3b690055
Author: DImuthuUpe <di...@gmail.com>
AuthorDate: Mon May 25 20:33:12 2026 -0400
Adding qos to association
---
.../SLURM/Association-Mapper/internal/operations/types.go | 6 ++++++
.../internal/subscribers/accountsub_integration_test.go | 6 +++---
.../SLURM/Association-Mapper/internal/subscribers/members.go | 2 ++
.../internal/subscribers/members_integration_test.go | 12 ++++++------
4 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/connectors/SLURM/Association-Mapper/internal/operations/types.go b/connectors/SLURM/Association-Mapper/internal/operations/types.go
index 75aaca6bd..e00e83d3f 100644
--- a/connectors/SLURM/Association-Mapper/internal/operations/types.go
+++ b/connectors/SLURM/Association-Mapper/internal/operations/types.go
@@ -43,6 +43,9 @@ type Association struct {
ParentAccount string `json:"parent_account,omitempty"`
IsDefault *bool `json:"is_default,omitempty"`
ID int64 `json:"id_association,omitempty"`
+ // QoS is the list of QoS names permitted for this association
+ // (e.g. ["normal"]). Marshaled to the top-level `qos` field on the wire.
+ QoS []string `json:"-"`
// Limits is a logical grouping — slurmrestd v0.0.41 actually encodes limits
// in a nested `max` object per-association. We translate between the two
// shapes in Marshal/UnmarshalJSON below.
@@ -108,6 +111,7 @@ type assocWire struct {
ParentAccount string `json:"parent_account,omitempty"`
IsDefault *bool `json:"is_default,omitempty"`
ID int64 `json:"id_association,omitempty"`
+ QoS []string `json:"qos,omitempty"`
Max *assocMax `json:"max,omitempty"`
}
@@ -120,6 +124,7 @@ func (a Association) MarshalJSON() ([]byte, error) {
ParentAccount: a.ParentAccount,
IsDefault: a.IsDefault,
ID: a.ID,
+ QoS: a.QoS,
}
m := &assocMax{}
touched := false
@@ -163,6 +168,7 @@ func (a *Association) UnmarshalJSON(data []byte) error {
a.ParentAccount = w.ParentAccount
a.IsDefault = w.IsDefault
a.ID = w.ID
+ a.QoS = w.QoS
a.Limits = AssocLimits{}
if w.Max != nil {
if w.Max.Jobs != nil && w.Max.Jobs.Per != nil {
diff --git a/connectors/SLURM/Association-Mapper/internal/subscribers/accountsub_integration_test.go b/connectors/SLURM/Association-Mapper/internal/subscribers/accountsub_integration_test.go
index 613d778bc..867f5ff29 100644
--- a/connectors/SLURM/Association-Mapper/internal/subscribers/accountsub_integration_test.go
+++ b/connectors/SLURM/Association-Mapper/internal/subscribers/accountsub_integration_test.go
@@ -219,7 +219,7 @@ func TestSubscribeToComputeAllocationResourceMappingCreation(t *testing.T) {
clusterName := "artisan"
projectID := "project-001"
computeAllocationID := "compute-allocation-001"
- computeAllocationName := "MD Allocation"
+ computeAllocationName := "md-allocation"
partitionName := "compute"
allocationResourceId := "allocation-resource-001"
allocationMappingId := "allocation-mapping-001"
@@ -289,7 +289,7 @@ func TestSubscribeToComputeAllocationResourceMappingWrongClusterCreation(t *test
clusterName := "wrong_cluster_name" // this is intentionally wrong to simulate the error case
projectID := "project-001"
computeAllocationID := "compute-allocation-001"
- computeAllocationName := "MD Allocation"
+ computeAllocationName := "md-allocation"
partitionName := "compute"
allocationResourceId := "allocation-resource-001"
allocationMappingId := "allocation-mapping-001"
@@ -363,7 +363,7 @@ func TestSubscribeToComputeAllocationResourceMappingWrongResourceTypeCreation(t
clusterName := "artisan"
projectID := "project-001"
computeAllocationID := "compute-allocation-001"
- computeAllocationName := "MD Allocation"
+ computeAllocationName := "md-allocation"
partitionName := "compute"
allocationResourceId := "allocation-resource-001"
allocationMappingId := "allocation-mapping-001"
diff --git a/connectors/SLURM/Association-Mapper/internal/subscribers/members.go b/connectors/SLURM/Association-Mapper/internal/subscribers/members.go
index c36cfc453..1d8b294fd 100644
--- a/connectors/SLURM/Association-Mapper/internal/subscribers/members.go
+++ b/connectors/SLURM/Association-Mapper/internal/subscribers/members.go
@@ -62,6 +62,7 @@ func (a *AssociationSubscriber) SubscribeToComputeAllocationMembershipCreation(
Cluster: cluster.Name,
User: csu.LocalUsername,
Partition: resources[0].Name, // TODO: do for each resource
+ QoS: []string{"normal"},
}
err = a.slurmClient.UpsertAssociation(association)
@@ -155,6 +156,7 @@ func (a *AssociationSubscriber) SubscribeToComputeAllocationMembershipResourceOv
Cluster: cluster.Name,
User: csu.LocalUsername,
Partition: allocationResource.Name,
+ QoS: []string{"normal"},
Limits: limits,
}
diff --git a/connectors/SLURM/Association-Mapper/internal/subscribers/members_integration_test.go b/connectors/SLURM/Association-Mapper/internal/subscribers/members_integration_test.go
index 7eae76ea0..3bd90837d 100644
--- a/connectors/SLURM/Association-Mapper/internal/subscribers/members_integration_test.go
+++ b/connectors/SLURM/Association-Mapper/internal/subscribers/members_integration_test.go
@@ -24,7 +24,7 @@ func TestSubscribeToComputeAllocationMembershipCreation(t *testing.T) {
clusterID := "cluster-001"
clusterName := "artisan"
computeAllocationID := "compute-allocation-001"
- computeAllocationName := "MD Allocation"
+ computeAllocationName := "md-allocation"
partitionName := "compute"
allocationResourceId := "allocation-resource-001"
//allocationMappingId := "allocation-mapping-001"
@@ -131,7 +131,7 @@ func TestSubscribeToComputeAllocationMembershipResourceOverrideCreation(t *testi
clusterID := "cluster-001"
clusterName := "artisan"
computeAllocationID := "compute-allocation-001"
- computeAllocationName := "MD Allocation"
+ computeAllocationName := "md-allocation"
partitionName := "compute"
allocationResourceId := "allocation-resource-001"
//allocationMappingId := "allocation-mapping-001"
@@ -152,13 +152,13 @@ func TestSubscribeToComputeAllocationMembershipResourceOverrideCreation(t *testi
GrpTRES: []operations.TRES{
{
Type: "cpu",
- Count: 100,
+ Count: 10,
},
},
GrpTRESMins: []operations.TRES{
{
Type: "cpu",
- Count: 1000,
+ Count: 2,
},
},
},
@@ -227,8 +227,8 @@ func TestSubscribeToComputeAllocationMembershipResourceOverrideCreation(t *testi
ID: "override-001",
ComputeAllocationMembershipID: "membership-001",
ComputeAllocationResourceID: allocationResourceId,
- OverrideResourceAmount: 50,
- OverrideResourceTime: 500,
+ OverrideResourceAmount: 1,
+ OverrideResourceTime: 1,
}
associationSubscriber := NewAssociationSubscriber(client, nil, mockCoreService)