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.
クラスターで有効にすると、ジョブごとに、ジョブのユーザーは完全な構造体パスワード情報(ユーザー名、uid、プライマリgid、gecos情報、ホームディレクトリ、シェル)を各ステップの起動の一部として安全に送信し、 slurmstepdプロセス。
This info will then be provided to any process launched by that step through the getpwuid()/getpwnam()/getpwent() system calls.
この情報は、getpwuid()/ getpwnam()/ getpwent()システムコールを介してそのステップで起動されたすべてのプロセスに提供されます。

For group information — from the getgrgid()/getgrnam()/getgrent() system calls —, an abbreviated view of struct group will be provided.
グループ情報(getgrgid()/ getgrnam()/ getgrent()システムコールから)については、構造体グループの簡略ビューが提供されます。
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.
グループメンバーの完全なリストは提供されていません。

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.
Linuxディストリビューションによっては、これを有効にするために、他のNSSプラグインを含むディレクトリにシンボリックリンクする必要があります。
On Debian/Ubuntu, /lib/x86_64-linux-gnu is recommended, and for RHEL-based distributions /usr/lib64 is recommended.
Debian / Ubuntuでは、/ lib / x86_64-linux-gnuが推奨され、RHELベースのディストリビューションでは/ usr / lib64が推奨されます。
If in doubt, a command such as find /lib /usr/ -name 'libnss*' should help.
疑わしい場合は、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.
slurmctldは、起動資格情報の一部として適切なパスワードとグループの詳細を検索して送信するように構成する必要があります。
This is handled by setting LaunchParameters=enable_nss_slurm in slurm.conf and restarting 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.
有効にすると、scontrol getentコマンドを計算ノードで使用して、そのノードのジョブステップに関連付けられているすべてのpasswdおよびgroup情報を出力できます。
As an example:
例として:

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.
nss_slurmには、オプションの構成ファイル— / etc / nss_slurm.confがあります。
This configuration file is only needed if:
この構成ファイルは、次の場合にのみ必要です。

  • 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 / pool / slurmdと一致しません。この場合、SlurmdSpoolDirも指定する必要があります。

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.
ノードで直接NSSSlurmを有効にする前に、-s slurmオプションを使用して、新しく起動されたジョブステップ内に移動し、残りのセットアップが正常に完了したことを確認する必要があります。
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.
getentの-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は、ジョブステップ自体内のプロセスからの要求にのみ応答することに注意してください。返されるデータを確認するには、ジョブステップ内で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.
nss_slurmの有効化は、/ etc /nsswitch.confのpasswdおよびgroupデータベースにslurmを追加するのと同じくらい簡単です。
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を最初にリストすることをお勧めします。これにより、他のソースに照会を送信する前に、可能であれば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.
nss_slurmは、指定されたジョブステップ内のプロセスの結果のみを返します。
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 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.
nss_slurmは、LDAPなどのネットワークディレクトリサービスの完全な代替としてではなく、それらのシステムから負荷を取り除き、大規模なジョブ起動のパフォーマンスを向上させる方法として意図されています。
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.
これは、大規模なジョブのすべてのタスクが同時にルックアップ要求を行う場合に「thundering-herd」の問題を取り除くことでこれを実現します。通常、nss_slurmが提供できる唯一の情報であるユーザー自身に関連する情報に対して、基になるディレクトリを圧倒します。サービス。

Last modified 2 July 2019