Skip to content

Commit

Permalink
Modify test_slurm_accounting to cover issue aws#5151
Browse files Browse the repository at this point in the history
Modify integration test test_slurm_accounting to verify that
the Slurm database password is unchanged after a cluster update
that modifies the Slurm queues without modifying the Slurm
accounting configuration.

Signed-off-by: Jacopo De Amicis <[email protected]>
  • Loading branch information
jdeamicis committed Apr 17, 2023
1 parent 0c1692b commit 4f18614
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/integration-tests/tests/schedulers/test_slurm_accounting.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ def _test_that_slurmdbd_is_running(remote_command_executor):
assert_that(_is_accounting_enabled(remote_command_executor)).is_true()


def _test_slurm_accounting_password(remote_command_executor):
storage_pass = remote_command_executor.run_remote_command(
"sudo grep StoragePass /opt/slurm/etc/slurm_parallelcluster_slurmdbd.conf |" "sed -e 's/StoragePass=//g'",
hide=True,
).stdout.strip()
assert_that(storage_pass).is_not_equal_to("dummy")


@pytest.mark.usefixtures("os", "instance", "scheduler")
def test_slurm_accounting(
region,
Expand Down Expand Up @@ -161,6 +169,17 @@ def test_slurm_accounting(
_test_require_server_identity(remote_command_executor, test_resources_dir, region)
_test_jobs_get_recorded(scheduler_commands)

# Update the queues to check that bug with the Slurm Accounting database server password
# is fixed (see https://github.com/aws/aws-parallelcluster/issues/5151 )
updated_config_file = pcluster_config_reader(
config_file="pcluster.config.update.yaml",
public_subnet_id=public_subnet_id,
private_subnet_id=private_subnet_id,
**config_params,
)
cluster.update(str(updated_config_file), force_update="true")
_test_slurm_accounting_password(remote_command_executor)


@pytest.mark.usefixtures("os", "instance", "scheduler")
def test_slurm_accounting_disabled_to_enabled_update(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Image:
Os: {{ os }}
HeadNode:
InstanceType: {{ instance }}
Networking:
SubnetId: {{ public_subnet_id }}
AdditionalSecurityGroups:
- {{ database_client_security_group }}
Iam:
AdditionalIamPolicies:
- Policy: arn:aws:iam::aws:policy/AmazonSSMFullAccess
Ssh:
KeyName: {{ key_name }}
Imds:
Secured: {{ imds_secured }}
Scheduling:
Scheduler: {{ scheduler }}
SlurmSettings:
Database:
Uri: {{ database_host }}
UserName: {{ database_admin_user }}
PasswordSecretArn: {{ database_secret_arn }}
SlurmQueues:
- Name: compute
ComputeResources:
- Name: cit
Instances:
- InstanceType: {{ instance }}
MinCount: 0
MaxCount: 12
Networking:
SubnetIds:
- {{ private_subnet_id }}
Iam:
AdditionalIamPolicies:
- Policy: arn:aws:iam::aws:policy/AmazonSSMFullAccess
Monitoring:
Logs:
CloudWatch:
Enabled: true
RetentionInDays: 14

0 comments on commit 4f18614

Please sign in to comment.