diff --git a/README.md b/README.md index 2b4a4a5..77496a5 100644 --- a/README.md +++ b/README.md @@ -1 +1,8 @@ -This python package allows syncing of SLURM accounts with LDAP accounts. +# jasmin-slurm-sync +This python utility is used by [JASMIN](https://jasmin.ac.uk) to keep [SLURM Accounts](https://slurm.schedmd.com/sacctmgr.html#OPT_account) in sync with users' LDAP tags. + +It gets a list of ldap tags for each user from LDAP then converts that list to SLURM accounts using the mapping provided in config.toml. +It then gets a list of current SLURM accounts for the user using [sacctmgr](https://slurm.schedmd.com/sacctmgr.html) and compares the two sets. +Then it runs the correct [sacctmgr](https://slurm.schedmd.com/sacctmgr.html) commands to add or remove the user from accounts to make the sets equal. + +When running in daemon mode, it does this for every user then sleeps for an amount of time specified in config.toml, before running again. diff --git a/config.example.toml b/config.example.toml index 3cf3263..8d5c721 100644 --- a/config.example.toml +++ b/config.example.toml @@ -1,10 +1,14 @@ -ldap_server_addr = "" -ldap_search_base = "" -ldap_search_filter = "" +ldap_server_addr = "" # The address of your ldap server. +ldap_search_base = "" # The search base for ldap. +ldap_search_filter = "" # A filter to apply to the search. -required_slurm_accounts = [""] +required_slurm_accounts = [""] # SLURM accounts (as mapped by ldap_tag_mapping) which are required before user is synced. -daemon_sleep_time = 300 +daemon_sleep_time = 300 # Time between syncs when in daemon mode. +# A map of ldap tags to slurm accounts. +# An ldap tag can manage multiple slurm accounts +# But a slurm account can't be associated with multiple ldap tags, +# this will cause unxpected behaviour. [ldap_tag_mapping] "" = [""]