Skip to content

Commit

Permalink
Add some better docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
amanning9 committed Sep 11, 2024
1 parent 3149395 commit a18945f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 9 additions & 5 deletions config.example.toml
Original file line number Diff line number Diff line change
@@ -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]
"" = [""]

0 comments on commit a18945f

Please sign in to comment.