|
| 1 | +# Slurm integration for ColdFront |
| 2 | + |
| 3 | +ColdFront django plugin providing Slurm REST API integration for ColdFront. |
| 4 | + |
| 5 | +A command line tool is also provided with this app that allows an administrator |
| 6 | +to check the consistency between ColdFront and Slurm and optionally remove any |
| 7 | +associations that should not be in Slurm according to ColdFront. |
| 8 | + |
| 9 | +## Design |
| 10 | + |
| 11 | +Resources in ColdFront map to Clusters (or partitions within a cluster) in |
| 12 | +Slurm. The name of the Slurm cluster is taken from a resource attribute in |
| 13 | +ColdFront named "slurm\_cluster". You can optionally provide Slurm |
| 14 | +specifications for a cluster using a resource attribute named "slurm\_specs". |
| 15 | +The value of this attribute must conform to the Slurm specification format and |
| 16 | +are colon separated. |
| 17 | + |
| 18 | +Allocations in ColdFront map to Accounts in Slurm. The name of the Slurm |
| 19 | +account is taken from a allocation attribute in ColdFront named |
| 20 | +"slurm\_account\_name" . You can optionally provide Slurm specifications for |
| 21 | +the account using a allocation attribute named "slurm\_specs". The value of |
| 22 | +this attribute must conform to the Slurm specification format and are colon |
| 23 | +separated. |
| 24 | + |
| 25 | +Allocation users in ColdFront map to Users in Slurm. You can optionally |
| 26 | +provide Slurm specifications for each user in a allocation using a |
| 27 | +allocation attribute named "slurm\_user\_specs". The value of this attribute |
| 28 | +must conform to the Slurm specification format and are colon separated. Setting |
| 29 | +specifications on an individual user basis is not currently supported. |
| 30 | + |
| 31 | +## Usage |
| 32 | + |
| 33 | +To enable this plugin set the following environment variables: |
| 34 | + |
| 35 | +``` |
| 36 | +PLUGIN_SLURMREST=True |
| 37 | +SLURMREST_CLUSTERS=production # add the names of the resources that correspond to the Slurm Clusters to use, separated by commas |
| 38 | +# For each cluster listed in slurm_clusters: |
| 39 | +# Set SLURM_{clustername}_ENDPOINT to the IP or URL, e.g.: |
| 40 | +SLURM_PRODUCTION_ENDPOINT=http://production_cluster_url.com |
| 41 | +# Set SLURM_{clustername}_TOKEN to the JWT token used for authentication |
| 42 | +SLURM_PRODUCTION_TOKEN=$SLURMTEST_TOKEN |
| 43 | +``` |
| 44 | + |
| 45 | + |
| 46 | +## Special cases |
| 47 | + |
| 48 | +Resources in ColdFront can optionally be organized into parent/child |
| 49 | +relationships. This is useful in the context of Slurm for example if you have a |
| 50 | +single Slurm controller with multiple partitions. Each partition represents a |
| 51 | +separate resource in ColdFront that users can subscribe to. In this case you |
| 52 | +would create a parent resource that represents your Slurm cluster (or |
| 53 | +controller) with a resource type of "Cluster". Each Slurm partition would be a |
| 54 | +separate resource in ColdFront with a resource type of "Partition" and have |
| 55 | +their parent resource set to the Slurm cluster. Users wouldn't subscribe to the |
| 56 | +parent Slurm cluster resource but only subscribe to the partition resources. Here |
| 57 | +you would only set the "slurm\_cluster" resource attribute on the Slurm cluster |
| 58 | +resource and not on the partitions. Also, "slurm\_specs" resource attribute on |
| 59 | +partitions are merged with the allocation "slurm\_specs" and set on the Slurm |
| 60 | +account association instead of the cluster. |
| 61 | + |
| 62 | +## CLI Usage |
| 63 | + |
| 64 | +To check the consistency between ColdFront and Slurm run the following command: |
| 65 | + |
| 66 | +``` |
| 67 | + $ sacctmgr dump file=/output_dir/tux.cfg |
| 68 | + $ coldfront slurm_check -i /output_dir/tux.cfg |
| 69 | +``` |
| 70 | + |
| 71 | +This will compare active allocations in ColdFront to Slurm accounts and |
| 72 | +associations. Any differences in the Slurm association and ColdFront user lists |
| 73 | +will be reported. You can optionally provide the '--slurm-sync' flag to |
| 74 | +automatically add and remove Slurm associations to match the allocationuser lists |
| 75 | +in ColdFront, or the '--coldfront-sync' flag to automatically match the |
| 76 | +allocationuser lists to Slurm's associations. |
0 commit comments