Slurm Credential Plugin Programmer Guide
Overview
This document describe. Slurm credential plugins and the API that
defines them.
It is intended as a resource to programmers wishing to write their own
Slurm credential plugins.
このドキュメントで説明します。Slurm資格情報プラグインとそれらを定義するAPI。独自のSlurmクレデンシャルプラグインを作成したいプログラマへのリソースとして意図されています。
Slurm credential plugins are Slurm plugins that implement
a digital signature mechanism.
The slurmctld daemon generates a job step credential, signs it,
and transmits it to an srun program.
The srun program then transmits it to the slurmd daemons directly.
The slurmctld daemon does not communicate directly with the slurmd
daemons at this time for performance reasons, but the job step
credential must be validated by the slurmd daemon as being
generated by the slurmctld daemon.
Digital signatures provide this validation mechanism.
The plugins must conform to the Slurm Plugin API with the following
specifications:
Slurm資格情報プラグインは、デジタル署名メカニズムを実装するSlurmプラグインです。slurmctldデーモンは、ジョブステップの資格情報を生成して署名し、srunプログラムに送信します。srunプログラムは、それをslurmdデーモンに直接送信します。slurmctldデーモンは、パフォーマンス上の理由から、現時点ではslurmdデーモンと直接通信しませんが、ジョブステップの資格情報は、slurmctldデーモンによって生成されたものとしてslurmdデーモンによって検証される必要があります。デジタル署名は、この検証メカニズムを提供します。プラグインは、次の仕様のSlurm Plugin APIに準拠している必要があります。
const char plugin_type[]
The major type must be "cred."
The minor type can be any recognizable abbreviation for the type of
credential mechanism.
We recommend, for example:
主なタイプは「信用できる」ものでなければなりません。マイナータイプは、資格メカニズムのタイプの認識可能な省略形です。たとえば、次のことをお勧めします。
- munge — LLNL's Munge system.
const char plugin_name[]
Some descriptive name for the plugin.
There is no requirement with respect to its format.
プラグインの説明的な名前。その形式に関して要件はありません。
const uint32_t plugin_version
If specified, identifies the version of Slurm used to build this plugin and
any attempt to load the plugin from a different version of Slurm will result
in an error.
If not specified, then the plugin may be loaded by Slurm commands and
daemons from any version, however this may result in difficult to diagnose
failures due to changes in the arguments to plugin functions or changes
in other Slurm functions used by the plugin.
指定した場合、このプラグインのビルドに使用されたSlurmのバージョンを識別し、異なるバージョンのSlurmからプラグインをロードしようとすると、エラーが発生します。指定されていない場合、プラグインはSlurmコマンドとデーモンによって任意のバージョンから読み込まれる可能性がありますが、プラグイン関数の引数の変更やプラグインで使用される他のSlurm関数の変更が原因で、障害の診断が困難になる可能性があります。
Data Objects
The implementation must maintain (though not necessarily directly export) an
enumerated errno to allow Slurm to discover
as practically as possible the reason for any failed API call.
Plugin-specific enumerated integer values may be used when appropriate.
実装は、列挙されたerrnoを維持する必要があります(必ずしも直接エクスポートする必要はありません)。これにより、Slurmは、API呼び出しの失敗の理由を可能な限り実際に発見できるようになります。プラグイン固有の列挙整数値は、適切な場合に使用できます。
These values must not be used as return values in integer-valued
functions in the API.
The proper error return value from integer-valued functions is SLURM_ERROR.
The implementation should endeavor to provide useful and pertinent
information by whatever means is practical.
Successful API calls are not required to reset any errno to a known value.
However, the initial value of any errno, prior to any error condition
arising, should be SLURM_SUCCESS.
これらの値は、APIの整数値関数の戻り値として使用しないでください。整数値関数からの適切なエラー戻り値はSLURM_ERRORです。実装は、実用的であるどんな手段によっても有用で適切な情報を提供するよう努めるべきです。errnoを既知の値にリセットするために、成功したAPI呼び出しは必要ありません。ただし、エラー状態が発生する前のerrnoの初期値はSLURM_SUCCESSである必要があります。
API Functions
The following functions must appear.
Functions which are not implemented should be stubbed.
次の関数が表示されます。実装されていない関数はスタブする必要があります。
int init (void)
Description:
Called when the plugin is loaded, before any other functions are
called. Put global initialization here.
プラグインがロードされたとき、他の関数が呼び出される前に呼び出されます。ここにグローバル初期化を配置します。
Returns:
SLURM_SUCCESS on success, or
SLURM_ERROR on failure.
void fini (void)
Description:
Called when the plugin is removed. Clear any allocated storage here.
プラグインが削除されたときに呼び出されます。ここで割り当て済みのストレージをすべてクリアします。
Returns: None.
Note: These init and fini functions are not the same as those
described in the dlopen (3) system library.
The C run-time system co-opts those symbols for its own initialization.
The system _init() is called before the Slurm
init(), and the Slurm
fini() is called before the system's
_fini().
注:これらのinitおよびfini関数は、dlopen(3)システムライブラリで説明されているものと同じではありません。Cランタイムシステムは、これらのシンボルを独自の初期化用にco-optします。システムの_init()はSlurm init()の前に呼び出され、Slurm fini()はシステムの_fini()の前に呼び出されます。
void *cred_read_private_key(const char *path);
Description: Generate a private key
based upon the contents of the supplied file.
説明:提供されたファイルの内容に基づいて秘密鍵を生成します。
Argument:path
(input) fully-qualified pathname to the private key
as specified by the JobCredentialPrivateKey configuration parameter.
Argument:path(入力)JobCredentialPrivateKey構成パラメーターで指定された秘密鍵への完全修飾パス名。
Returns: The pointer to a key on
success or NULL on failure.
Call cred_p_destroy_key() to release memory associated with this key.
戻り値:成功した場合はキーへのポインタ、失敗した場合はNULL。cred_p_destroy_key()を呼び出して、このキーに関連付けられているメモリを解放します。
void *cred_p_read_public_key(const char *path);
Description: Generate a public key
based upon the contents of the supplied file.
説明:提供されたファイルの内容に基づいて公開鍵を生成します。
Argument:path
(input) fully-qualified pathname to the public key
as specified by the JobCredentialPublicCertificate configuration
parameter.
Argument:path(入力)JobCredentialPublicCertificate構成パラメーターで指定された公開鍵への完全修飾パス名。
Returns: The pointer to a key on
success or NULL on failure.
Call cred_p_destroy_key() to release memory associated with this key.
戻り値:成功した場合はキーへのポインタ、失敗した場合はNULL。cred_p_destroy_key()を呼び出して、このキーに関連付けられているメモリを解放します。
void cred_p_destroy_key(void *key);
Description: Release storage for
a public or private key.
説明:公開鍵または秘密鍵のストレージを解放します。
Argument: key
(input/output) pointer to the key previously allocated
by cred_p_read_private_key() or cred_p_read_public_key().
引数:cred_p_read_private_key()またはcred_p_read_public_key()によって以前に割り当てられたキーへのキー(入力/出力)ポインター。
char *cred_p_str_error(void);
Description: Return a string
describing the last error generated by the credential software.
説明:資格情報ソフトウェアによって生成された最後のエラーを説明する文字列を返します。
Returns: A pointer to a string.
戻り値:文字列へのポインタ。
int cred_p_sign(void *key, char *buffer, int buf_size, char **sig_pp, unsigned int *sig_size_p);
Description: Generate a signature for
the supplied buffer.
説明:提供されたバッファーの署名を生成します。
Arguments:
key
(input) pointer to the key previously generated by
cred_p_read_private_key() or cred_p_read_public_key().
key(入力)cred_p_read_private_key()またはcred_p_read_public_key()によって以前に生成されたキーへのポインタ。
buffer (input) data to
be signed.
署名するバッファ(入力)データ。
buf_size (input)
size of buffer, in bytes.
buf_size(入力)バッファのサイズ(バイト単位)。
sig_pp (input/output)
Location in which to store the signature. NOTE: The storage for
sig_pp should be allocated using xmalloc() and will be freed by
the caller using xfree().
sig_pp(入力/出力)署名を格納する場所。注:sig_ppのストレージは、xmalloc()を使用して割り当てる必要があり、xfree()を使用して呼び出し元によって解放されます。
sig_size_p (input/output)
Location in which to store the size of the signature (sig_pp).
sig_size_p(入力/出力)署名(sig_pp)のサイズを格納する場所。
Returns: SLURM_SUCCESS if successful.
On failure, the plugin should return SLURM_ERROR and set the errno to an
appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
int cred_p_verify_sign(void *key, char *buffer, int buf_size, char *signature, unsigned int sig_size);
Description: Generate a signature for
the supplied buffer.
説明:提供されたバッファーの署名を生成します。
Arguments:
key
(input) pointer to the key previously generated by
cred_p_read_private_key() or cred_p_read_public_key().
key(入力)cred_p_read_private_key()またはcred_p_read_public_key()によって以前に生成されたキーへのポインタ。
buffer (input) data
previously signed by cred_p_sign().
cred_p_sign()によって以前に署名されたバッファ(入力)データ。
buf_size (input)
size of buffer, in bytes.
buf_size(入力)バッファのサイズ(バイト単位)。
signature (input)
Signature as returned in sig_pp by the cred_p_sign() function and
to be confirmed.
署名(入力)cred_p_sign()関数によってsig_ppに返され、確認される署名。
sig_size (input)
Size of the signature as returned in sig_size_p by cred_p_sign().
sig_size(入力)cred_p_sign()によってsig_size_pに返される署名のサイズ。
Returns: SLURM_SUCCESS if successful.
On failure, the plugin should return SLURM_ERROR and set the errno to an
appropriate value to indicate the reason for failure.
戻り値:成功した場合はSLURM_SUCCESS。失敗すると、プラグインはSLURM_ERRORを返し、errnoを適切な値に設定して、失敗の理由を示す必要があります。
Last modified 7 January 2019