Cloud Scheduling Guide

Overview

Slurm has the ability to support a cluster that grows and shrinks on demand, typically relying upon a service such as Amazon Elastic Computing Cloud (Amazon EC2) and Google Cloud Platform for resources. These resources can be combined with an existing cluster to process excess workload (cloud bursting) or it can operate as an independent self-contained cluster. Good responsiveness and throughput can be achieved while you only pay for the resources needed.
Slurmは、オンデマンドで拡張および縮小するクラスターをサポートする機能を備えています。通常、リソースはAmazon Elastic Computing Cloud(Amazon EC2)やGoogle Cloud Platformなどのサービスに依存しています。これらのリソースを既存のクラスターと組み合わせて、過剰なワークロード(クラウドバースト)を処理するか、独立した自己完結型クラスターとして動作させることができます。必要なリソースに対してのみ支払うことで、優れた応答性とスループットを実現できます。

The rest of this document describes details about Slurm's infrastructure that can be used to support cloud scheduling.
このドキュメントの残りの部分では、クラウドスケジューリングのサポートに使用できるSlurmのインフラストラクチャの詳細について説明します。

Slurm's cloud scheduling logic relies heavily upon the existing power save logic. Review of Slurm's Power Saving Guide is strongly recommended. This logic initiates programs when nodes are required for use and another program when those nodes are no longer required. For cloud scheduling, these programs will need to provision the resources from the cloud and notify Slurm of the node's name and network address and later relinquish the nodes back to the cloud. Most of the Slurm changes to support cloud scheduling were changes to support node addressing that can change.
Slurmのクラウドスケジューリングロジックは、既存の省電力ロジックに大きく依存しています。Slurmの省電力ガイドのレビューを強くお勧めします。このロジックは、ノードの使用が必要なときにプログラムを開始し、ノードが不要になったときに別のプログラムを開始します。クラウドスケジューリングの場合、これらのプログラムは、クラウドからリソースをプロビジョニングし、Slurmにノードの名前とネットワークアドレスを通知し、後でノードをクラウドに解放する必要があります。クラウドスケジューリングをサポートするためのSlurmの変更のほとんどは、変更可能なノードアドレス指定をサポートするための変更でした。

Slurm Configuration

There are many ways to configure Slurm's use of resources. See the slurm.conf man page for more details about these options. Some general Slurm configuration parameters that are of interest include:
Slurmによるリソースの使用を構成するには、多くの方法があります。これらのオプションの詳細については、slurm.confのmanページを参照してください。関心のあるいくつかの一般的なSlurm構成パラメーターは次のとおりです。

CommunicationParameters=NoAddrCache
By default, Slurm will cache a node's network address after successfully establishing the node's network address. This option disables the cache and Slurm will look up the node's network address each time a connection is made. This is useful, for example, in a cloud environment where the node addresses come and go out of DNS.
デフォルトでは、Slurmはノードのネットワークアドレスを正常に確立した後、ノードのネットワークアドレスをキャッシュします。このオプションはキャッシュを無効にし、Slurmは接続が行われるたびにノードのネットワークアドレスを検索します。これは、たとえば、ノードアドレスがDNSから出入りするクラウド環境で役立ちます。
ResumeFailProgram
The program that will be executed when nodes fail to resume by ResumeTimeout. The argument to the program will be the names of the failed nodes (using Slurm's hostlist expression format).
ノードがResumeTimeoutによって再開に失敗したときに実行されるプログラム。プログラムへの引数は、失敗したノードの名前になります(Slurmのホストリスト式形式を使用)。
ResumeProgram
The program executed when a node has been allocated and should be made available for use.If the slurmd daemon fails to respond within the configured SlurmdTimeout value with an updated BootTime, the node will be placed in a DOWN state and the job requesting the node will be requeued. If the node isn't actually rebooted (i.e. when multiple-slurmd is configured) starting slurmd with "-b" option might be useful.
ノードが割り当てられ、使用できるようにする必要があるときに実行されるプログラム。slurmdデーモンが、更新されたBootTimeで構成されたSlurmdTimeout値内で応答しない場合、ノードはDOWN状態になり、ノードを要求するジョブはキューに再登録されます。ノードが実際に再起動されない場合(つまり、複数のslurmdが構成されている場合)、「-b」オプションを指定してslurmdを開始すると役立つ場合があります。
SlurmctldParameters=cloud_dns
By default, Slurm expects that the network addresses for cloud nodes won't be known until creation of the node and that Slurm will be notified of the node's address (e.g. scontrol update nodename=<name> nodeaddr=<addr>). Since Slurm communications rely on the node configuration found in the slurm.conf, Slurm will tell the client command, after waiting for all nodes to boot, each node's ip address. However, in environments where the nodes are in DNS, this step can be avoided by configuring this option.
デフォルトでは、Slurmは、ノードが作成されるまでクラウドノードのネットワークアドレスが認識されず、Slurmにノードのアドレスが通知されることを期待します(例:scontrol update nodename = nodeaddr =)。Slurm通信はslurm.confにあるノード構成に依存しているため、Slurmはすべてのノードが起動するのを待った後、各ノードのIPアドレスをクライアントコマンドに通知します。ただし、ノードがDNS内にある環境では、このオプションを構成することでこの手順を回避できます。
SlurmctldParameters=idle_on_node_suspend
Mark nodes as idle, regardless of current state, when suspending nodes with SuspendProgram so that nodes will be eligible to be resumed at a later time.
SuspendProgramを使用してノードを一時停止するときは、現在の状態に関係なく、ノードをアイドルとしてマークして、後でノードを再開できるようにします。
SuspendExcNodes
Nodes not subject to suspend/resume logic. This may be used to avoid suspending and resuming nodes which are not in the cloud. Alternately the suspend/resume programs can treat local nodes differently from nodes being provisioned from cloud.
ノードは中断/再開ロジックの対象ではありません。これは、クラウドにないノードの一時停止と再開を回避するために使用できます。または、サスペンド/レジュームプログラムは、クラウドからプロビジョニングされるノードとは異なる方法でローカルノードを処理できます。
SuspendProgram
The program executed when a node is no longer required and can be relinquished to the cloud.
ノードが不要になったときに実行されるプログラムで、クラウドに解放できます。
SuspendTime
The time interval that a node will be left idle or down before a request is made to relinquish it. Units are in seconds.
ノードを放棄するように要求される前に、ノードがアイドル状態またはダウン状態のままになる時間間隔。単位は秒です。
TCPTimeout
Time permitted for TCP connections to be established. This value may need to be increased from the default (2 seconds) to account for latency between your local site and machines in the cloud.
TCP接続の確立に許可される時間。ローカルサイトとクラウド内のマシンの間のレイテンシを考慮するために、この値をデフォルト(2秒)から増やす必要がある場合があります。
TreeWidth
Since the slurmd daemons are not aware of the network addresses of other nodes in the cloud, the slurmd daemons on each node should be sent messages directly and not forward those messages between each other. To do so, configure TreeWidth to a number at least as large as the maximum node count. The value may not exceed 65533.
slurmdデーモンはクラウド内の他のノードのネットワークアドレスを認識しないため、各ノードのslurmdデーモンに直接メッセージを送信し、それらのメッセージを相互に転送しないでください。これを行うには、TreeWidthを少なくともノードの最大数と同じ数に設定します。値は65533を超えることはできません。

Some node parameters that are of interest include:
重要ないくつかのノードパラメータは次のとおりです。

Feature
A node feature can be associated with resources acquired from the cloud and user jobs can specify their preference for resource use with the "--constraint" option.
ノード機能はクラウドから取得したリソースに関連付けることができ、ユーザージョブは「--constraint」オプションを使用してリソース使用の優先順位を指定できます。
NodeName
This is the name by which Slurm refers to the node. A name containing a numeric suffix is recommended for convenience. The NodeAddr and NodeHostname should not be set, but will be configured later using scripts.
これは、Slurmがノードを参照するときに使用する名前です。便宜上、数値の接尾辞を含む名前をお勧めします。NodeAddrとNodeHostnameは設定しないでください。後でスクリプトを使用して設定します。
State
Nodes which are to be be added on demand should have a state of "CLOUD". These nodes will not actually appear in Slurm commands until after they are configured for use.
オンデマンドで追加されるノードは、「CLOUD」の状態である必要があります。これらのノードは、使用するように構成するまで、実際にはSlurmコマンドに表示されません。
Weight
Each node can be configured with a weight indicating the desirability of using that resource. Nodes with lower weights are used before those with higher weights.
各ノードには、そのリソースを使用する必要性を示す重みを設定できます。重みの小さいノードが、重みの大きいノードの前に使用されます。

Nodes to be acquired on demand can be placed into their own Slurm partition. This mode of operation can be used to use these nodes only if so requested by the user. Note that jobs can be submitted to multiple partitions and will use resources from whichever partition permits faster initiation. A sample configuration in which nodes are added from the cloud when the workload exceeds available resources. Users can explicitly request local resources or resources from the cloud by using the "--constraint" option.
オンデマンドで取得されるノードは、独自のSlurmパーティションに配置できます。この操作モードは、ユーザーが要求した場合にのみ、これらのノードを使用するために使用できます。ジョブは複数のパーティションにサブミットでき、より高速な開始が可能なパーティションからリソースを使用することに注意してください。ワークロードが使用可能なリソースを超えたときにノードがクラウドから追加されるサンプル構成。ユーザーは、「-constraint」オプションを使用して、ローカルリソースまたはクラウドのリソースを明示的にリクエストできます。

# Excerpt of slurm.conf
SelectType=select/cons_res
SelectTypeParameters=CR_CORE_Memory

SuspendProgram=/usr/sbin/slurm_suspend
ResumeProgram=/usr/sbin/slurm_suspend
SuspendTime=600
SuspendExcNodes=tux[0-127]
TreeWidth=128

NodeName=DEFAULT    Sockets=1 CoresPerSocket=4 ThreadsPerCore=2
NodeName=tux[0-127] Weight=1 Feature=local State=UNKNOWN
NodeName=ec[0-127]  Weight=8 Feature=cloud State=CLOUD
PartitionName=debug MaxTime=1:00:00 Nodes=tux[0-32] Default=yes
PartitionName=batch MaxTime=8:00:00 Nodes=tux[0-127],ec[0-127] Default=no

Operational Details

When the slurmctld daemon starts, all nodes with a state of CLOUD will be included in its internal tables, but these node records will not be seen with user commands or used by applications until allocated to some job. After allocated, the ResumeProgram is executed and should do the following:
slurmctldデーモンが開始すると、状態がCLOUDのすべてのノードが内部テーブルに含まれますが、これらのノードレコードは、ジョブに割り当てられるまで、ユーザーコマンドでは表示されず、アプリケーションでも使用されません。割り当てられた後、ResumeProgramが実行され、以下を実行する必要があります。

  1. Boot the node
    ノードを起動します
  2. Configure and start Munge (depends upon configuration)
    Mungeを構成して開始します(構成によって異なります)
  3. Install the Slurm configuration file, slurm.conf, on the node. Note that configuration file will generally be identical on all nodes and not include NodeAddr or NodeHostname configuration parameters for any nodes in the cloud. Slurm commands executed on this node only need to communicate with the slurmctld daemon on the SlurmctldHost.
    Slurm構成ファイルslurm.confをノードにインストールします。通常、構成ファイルはすべてのノードで同一であり、クラウド内のノードのNodeAddrまたはNodeHostname構成パラメーターは含まれません。このノードで実行されるSlurmコマンドは、SlurmctldHostのslurmctldデーモンと通信するだけで済みます。
  4. Notify the slurmctld daemon of the node's hostname and network address:
    ノードのホスト名とネットワークアドレスをslurmctldデーモンに通知します。

    scontrol update nodename=ec0 nodeaddr=123.45.67.89 nodehostname=whatever
    Note that the node address and hostname information set by the scontrol command are are preserved when the slurmctld daemon is restarted unless the "-c" (cold-start) option is used.
    scontrolコマンドで設定されたノードアドレスとホスト名の情報は、 "-c"(コールドスタート)オプションを使用しない限り、slurmctldデーモンが再起動されても保持されます。
  5. Start the slurmd daemon on the node
    ノードでslurmdデーモンを起動します

The SuspendProgram only needs to relinquish the node back to the cloud.
SuspendProgramはノードをクラウドに戻すだけです。

An environment variable SLURM_NODE_ALIASES contains sets of node name, communication address and hostname. The variable is set by salloc, sbatch, and srun. It is then used by srun to determine the destination for job launch communication messages. This environment variable is only set for nodes allocated from the cloud. If a job is allocated some resources from the local cluster and others from the cloud, only those nodes from the cloud will appear in SLURM_NODE_ALIASES. Each set of names and addresses is comma separated and the elements within the set are separated by colons. For example:
環境変数SLURM_NODE_ALIASESには、ノード名、通信アドレス、およびホスト名のセットが含まれています。変数は、salloc、sbatch、およびsrunによって設定されます。次に、srunがジョブ起動通信メッセージの宛先を決定するために使用します。この環境変数は、クラウドから割り当てられたノードに対してのみ設定されます。ジョブにローカルクラスターのリソースとクラウドのリソースが割り当てられている場合、クラウドのノードのみがSLURM_NODE_ALIASESに表示されます。名前とアドレスの各セットはカンマで区切られ、セット内の要素はコロンで区切られます。例えば:

SLURM_NODE_ALIASES=ec0:123.45.67.8:foo,ec2,123.45.67.9:bar

Remaining Work

  • We need scripts to provision resources from EC2.
    EC2からリソースをプロビジョニングするためのスクリプトが必要です。
  • The SLURM_NODE_ALIASES environment variable needs to change if a job expands (adds resources).
    ジョブが拡張(リソースを追加)する場合、SLURM_NODE_ALIASES環境変数を変更する必要があります。
  • Some MPI implementations will not work due to the node naming.
    一部のMPI実装は、ノードの命名により機能しません。
  • Some tests in Slurm's test suite fail.
    Slurmのテストスイートの一部のテストが失敗します。

Last modified 19 March 2020