nss_slurm

nss_slurm is an optional NSS plugin that can permit passwd and group resolution for a job on the compute node to be serviced through the local slurmstepd process, rather than through some alternate network-based service such as LDAP, SSSD, or NSLCD.
nss_slurmはオプションのNSSプラグインで、LDAP、SSSD、NSLCDなどの代替ネットワークベースのサービスではなく、ローカルのslurmstepdプロセスを介して、計算ノード上のジョブのpasswdとグループの解決を許可できます。

When enabled on the cluster, for each job, the job's user will have their full struct passwd info — username, uid, primary gid, gecos info, home directory, and shell — securely sent as part of each step launch, and cached within the slurmstepd process. This info will then be provided to any process launched by that step through the getpwuid()/getpwnam()/getpwent() system calls.
クラスターで有効にすると、ジョブごとに、ジョブのユーザーは完全な構造体のpasswd情報(ユーザー名、uid、プライマリgid、gecos情報、ホームディレクトリ、シェル)を持ち、各ステップの起動の一部として安全に送信され、 slurmstepdプロセス。この情報は、getpwuid()/ getpwnam()/ getpwent()システムコールを介して、そのステップによって起動されたプロセスに提供されます。

For group information — from the getgrgid()/getgrnam()/getgrent() system calls —, an abbreviated view of struct group will be provided. Within a given process, the response will include only those groups that the user belongs to, but with only the user themselves listed as a member. The full list of group members is not provided.
グループ情報(getgrgid()/ getgrnam()/ getgrent()システムコールから)については、構造体グループの省略ビューが提供されます。特定のプロセス内では、応答にはユーザーが属するグループのみが含まれますが、メンバーとしてリストされているのはユーザー自身のみです。グループメンバーの完全なリストは提供されません。

Installation

Source:

In your Slurm build directory, navigate to contribs/nss_slurm/ and run:
Slurmビルドディレクトリで、contribs / nss_slurm /に移動して実行します。

make && make install
This will install libnss_slurm.so.2 alongside your other Slurm library files in your install path.
これにより、インストールパスにある他のSlurmライブラリファイルと一緒にlibnss_slurm.so.2がインストールされます。

Depending on your Linux distribution, you will likely need to symlink this to the directory which includes your other NSS plugins to enable it. On Debian/Ubuntu, /lib/x86_64-linux-gnu is recommended, and for RHEL-based distributions /usr/lib64 is recommended. If in doubt, a command such as find /lib /usr/ -name 'libnss*' should help.
Linuxディストリビューションによっては、これを有効にするために、他のNSSプラグインを含むディレクトリにシンボリックリンクする必要がある可能性があります。Debian / Ubuntuでは、/ lib / x86_64-linux-gnuが推奨され、RHELベースのディストリビューションでは/ usr / lib64が推奨されます。疑わしい場合は、find / lib / usr / -name 'libnss *'などのコマンドが役立つはずです。

Setup

The slurmctld must be configured to lookup and send the appropriate passwd and group details as part of the launch credential. This is handled by setting LaunchParameters=enable_nss_slurm in slurm.conf and restarting slurmctld.
起動資格情報の一部として、適切なpasswdおよびグループの詳細を検索して送信するように、slurmctldを構成する必要があります。これは、slurm.confでLaunchParameters = enable_nss_slurmを設定し、slurmctldを再起動することで処理されます。

Once enabled, the scontrol getent command can be used on a compute node to print all passwd and group info associated with job steps on that node. As an example:
有効にすると、scontrol getentコマンドを計算ノードで使用して、そのノードのジョブステップに関連するすべてのpasswdおよびgroup情報を出力できます。例として:

tim@node0001:~$ scontrol getent node0001
JobId=1268.Extern:
User:
tim:x:1000:1000:Tim Wickberg:/home/tim:/bin/bash
Groups:
tim:x:1000:tim
projecta:x:1001:tim

JobId=1268.0:
User:
tim:x:1000:1000:Tim Wickberg:/home/tim:/bin/bash
Groups:
tim:x:1000:tim
projecta:x:1001:tim

NSS Slurm Configuration

nss_slurm has an optional configuration file — /etc/nss_slurm.conf. This configuration file is only needed if:
nss_slurmには、オプションの構成ファイル(/etc/nss_slurm.conf)があります。この構成ファイルは、次の場合にのみ必要です。

  • The node's hostname does not match the NodeName, in which case you must explicitly set the NodeName option.
    ノードのホスト名がNodeNameと一致しません。この場合、NodeNameオプションを明示的に設定する必要があります。
  • The SlurmdSpoolDir does not match Slurm's default location of /var/spool/slurmd, in which case it must be provided as well.
    SlurmdSpoolDirは、Slurmのデフォルトの場所である/ var / spool / slurmdと一致しません。その場合、それも提供する必要があります。

NodeName and SlurmdSpoolDir are the only configuration options supported at this time.
現在サポートされている構成オプションは、NodeNameとSlurmdSpoolDirのみです。

Initial Testing

Before enabling NSS Slurm directly on the node, you should use the -s slurm option to getent within a newly launched job step to verify that the rest of the setup has been completed successfully. The -s option to getent allows it to query a specific database — even if it has not been enabled by default through the system's nsswitch.conf. Note that nss_slurm only responds to requests from processes within the job step itself — you must launch the getent command within a job step to see any data returned.
ノードでNSS Slurmを直接有効にする前に、-s slurmオプションを使用して、新しく起動されたジョブステップ内に移動し、残りのセットアップが正常に完了したことを確認する必要があります。getentの-sオプションを使用すると、システムのnsswitch.confによってデフォルトで有効にされていない場合でも、特定のデータベースを照会できます。nss_slurmはジョブステップ内のプロセスからのリクエストにのみ応答することに注意してください。ジョブステップ内でgetentコマンドを起動して、返されたデータを確認する必要があります。

As an example of a successful query:
成功したクエリの例として:

tim@blackhole:~$ srun getent -s slurm passwd
tim:x:1000:1000:Tim Wickberg:/home/tim:/bin/bash
tim@blackhole:~$ srun getent -s slurm group
tim:x:1000:tim
projecta:x:1001:tim

NSS Configuration

Enabling nss_slurm is as simple as adding slurm to the passwd and group database in /etc/nsswitch.conf. It is recommended that slurm is listed first, as the order (from left to right) determines the sequence in which the NSS databases will be queried, and this ensures Slurm handles the request if able before submitting the query to other sources.
nss_slurmを有効にするには、/ etc / nsswitch.confのpasswdおよびgroupデータベースにslurmを追加するだけです。NSSデータベースが照会される順序を(左から右へ)順序が決定するため、slurmを最初にリストすることをお勧めします。これにより、他のソースに照会を送信する前に、可能であればSlurmが要求を処理することが保証されます。

Once enabled, test it by launching getent queries such as:
有効にしたら、次のようなgetentクエリを起動してテストします。

tim@blackhole:~$ srun getent passwd tim
tim:x:1000:1000:Tim Wickberg:/home/tim:/bin/bash
tim@blackhole:~$ srun getent group projecta
projecta:x:1001:tim

Limitations

nss_slurm will only return results for processes within a given job step. It will not return any results for processes outside of these steps, such as system monitoring, node health checks, prolog or epilog scripts, and related node system processes.
nss_slurmは、特定のジョブステップ内のプロセスの結果のみを返します。システム監視、ノードヘルスチェック、プロローグまたはエピローグスクリプト、および関連するノードシステムプロセスなど、これらの手順以外のプロセスの結果は返されません。

nss_slurm is not meant as a full replacement for network directory services such as LDAP, but as a way to remove load from those systems to improve the performance of large-scale job launches. It accomplishes this by removing the "thundering-herd" issue should all tasks of a large job make simultaneous lookup requests — generally for info related to the user themselves, which is the only information nss_slurm will be able to provide — and overwhelm the underlying directory services.
nss_slurmは、LDAPなどのネットワークディレクトリサービスを完全に置き換えるものではなく、それらのシステムから負荷を取り除いて大規模なジョブ起動のパフォーマンスを向上させる方法です。これは、大規模なジョブのすべてのタスクが同時にルックアップリクエストを行った場合に「thundering-herd」問題を削除することでこれを実現します。サービス。

Last modified 2 July 2019