15572: Make notes on cloud/slurm dispatcher install to set up VM / compute nodes.
[arvados.git] / doc / install / crunch2-slurm / install-dispatch.html.textile.liquid
index 28817dd2955bd57212cebbc3942435f85af8d583..faf1e7318b7cd5231487adfb601d99509fca5510 100644 (file)
@@ -10,72 +10,69 @@ Copyright (C) The Arvados Authors. All rights reserved.
 SPDX-License-Identifier: CC-BY-SA-3.0
 {% endcomment %}
 
-The SLURM dispatcher can run on any node that can submit requests to both the Arvados API server and the SLURM controller.  It is not resource-intensive, so you can run it on the API server node.
+# "Introduction":#introduction
+# "Update config.yml":#update-config
+# "Install crunch-dispatch-slurm":#install-packages
+# "Start the service":#start-service
+# "Restart the API server and controller":#restart-api
 
-h2. Install the dispatcher
+h2(#introduction). Introduction
 
-First, "add the appropriate package repository for your distribution":{{ site.baseurl }}/install/install-manual-prerequisites.html#repos.
+This assumes you already have a SLURM cluster, and have "set up all of your compute nodes":install-compute-node.html .  For information on installing SLURM, see https://slurm.schedmd.com/quickstart_admin.html
 
-On Red Hat-based systems:
+The Arvados SLURM dispatcher can run on any node that can submit requests to both the Arvados API server and the SLURM controller (via @sbatch@).  It is not resource-intensive, so you can run it on the API server node.
 
-<notextile>
-<pre><code>~$ <span class="userinput">sudo yum install crunch-dispatch-slurm</span>
-~$ <span class="userinput">sudo systemctl enable crunch-dispatch-slurm</span>
-</code></pre>
-</notextile>
+h2(#update-config). Update config.yml (optional)
+
+Crunch-dispatch-slurm reads the common configuration file at @/etc/arvados/config.yml@.
 
-On Debian-based systems:
+The following configuration parameters are optional.
+
+h3(#PollPeriod). Containers.PollInterval
+
+crunch-dispatch-slurm polls the API server periodically for new containers to run.  The @PollInterval@ option controls how often this poll happens.  Set this to a string of numbers suffixed with one of the time units @ns@, @us@, @ms@, @s@, @m@, or @h@.  For example:
 
 <notextile>
-<pre><code>~$ <span class="userinput">sudo apt-get install crunch-dispatch-slurm</span>
+<pre>    Containers:
+      <code class="userinput">PollInterval: <b>3m30s</b>
 </code></pre>
 </notextile>
 
+h3(#ReserveExtraRAM). Containers.ReserveExtraRAM: Extra RAM for jobs
 
-h2. Configure the dispatcher
+Extra RAM to reserve (in bytes) on each SLURM job submitted by Arvados, which is added to the amount specified in the container's @runtime_constraints@.  If not provided, the default value is zero.  Helpful when using @-cgroup-parent-subsystem@, where @crunch-run@ and @arv-mount@ share the control group memory limit with the user process.  In this situation, at least 256MiB is recommended to accomodate each container's @crunch-run@ and @arv-mount@ processes.
 
-Edit @/etc/arvados/config.yml@.
+Supports suffixes @KB@, @KiB@, @MB@, @MiB@, @GB@, @GiB@, @TB@, @TiB@, @PB@, @PiB@, @EB@, @EiB@ (where @KB@ is 10[^3^], @KiB@ is 2[^10^], @MB@ is 10[^6^], @MiB@ is 2[^20^] and so forth).
 
 <notextile>
-<pre><code class="userinput">Client:
-  APIHost: <b>zzzzz.arvadosapi.com</b>
-  AuthToken: <b>zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz</b>
-</code></pre>
+<pre>    Containers:
+      <code class="userinput">ReserveExtraRAM: <b>256MiB</b></code>
+</pre>
 </notextile>
 
-This is the only configuration required by crunch-dispatch-slurm.  The subsections below describe optional configuration flags you can set inside the main configuration object.
-
-h3(#KeepServiceURIs). Containers.SLURM.KeepServices
+h3(#MinRetryPeriod). Containers.MinRetryPeriod: Rate-limit repeated attempts to start containers
 
-Override Keep service discovery with a predefined list of Keep URIs. This can be useful if the compute nodes run a local keepstore that should handle all Keep traffic. Example:
+If SLURM is unable to run a container, the dispatcher will submit it again after the next PollPeriod. If PollPeriod is very short, this can be excessive. If MinRetryPeriod is set, the dispatcher will avoid submitting the same container to SLURM more than once in the given time span.
 
 <notextile>
-<pre>
-Clusters:
-  zzzzz:
-    Containers:
-      SLURM:
-        KeepServices:
-          00000-bi6l4-000000000000000:
-           InternalURLs:
-              "http://127.0.0.1:25107": {}
-</code></pre>
+<pre>    Containers:
+      <code class="userinput">MinRetryPeriod: <b>30s</b></code>
+</pre>
 </notextile>
 
-h3(#PollPeriod). Containers.PollInterval
+h3(#KeepServiceURIs). Containers.SLURM.SbatchEnvironmentVariables
 
-crunch-dispatch-slurm polls the API server periodically for new containers to run.  The @PollInterval@ option controls how often this poll happens.  Set this to a string of numbers suffixed with one of the time units @ns@, @us@, @ms@, @s@, @m@, or @h@.  For example:
+Some Arvados installations run a local keepstore on each compute node to handle all Keep traffic.  To override Keep service discovery and access the local keep server instead of the global servers, set ARVADOS_KEEP_SERVICES in SbatchEnvironmentVariables:
 
 <notextile>
-<pre>
-Clusters:
-  zzzzz:
-    Containers:
-      <code class="userinput">PollInterval: <b>3m30s</b>
+<pre>    Containers:
+      SLURM:
+        <span class="userinput">SbatchEnvironmentVariables:
+          ARVADOS_KEEP_SERVICES: "http://127.0.0.1:25107"</span>
 </code></pre>
 </notextile>
 
-h3(#PrioritySpread). PrioritySpread
+h3(#PrioritySpread). Containers.SLURM.PrioritySpread
 
 crunch-dispatch-slurm adjusts the "nice" values of its SLURM jobs to ensure containers are prioritized correctly relative to one another. This option tunes the adjustment mechanism.
 * If non-Arvados jobs run on your SLURM cluster, and your Arvados containers are waiting too long in the SLURM queue because their "nice" values are too high for them to compete with other SLURM jobs, you should use a smaller PrioritySpread value.
@@ -85,10 +82,7 @@ crunch-dispatch-slurm adjusts the "nice" values of its SLURM jobs to ensure cont
 The smallest usable value is @1@. The default value of @10@ is used if this option is zero or negative. Example:
 
 <notextile>
-<pre>
-Clusters:
-  zzzzz:
-    Containers:
+<pre>    Containers:
       SLURM:
         <code class="userinput">PrioritySpread: <b>1000</b></code></pre>
 </notextile>
@@ -98,13 +92,10 @@ h3(#SbatchArguments). Containers.SLURM.SbatchArgumentsList
 When crunch-dispatch-slurm invokes @sbatch@, you can add arguments to the command by specifying @SbatchArguments@.  You can use this to send the jobs to specific cluster partitions or add resource requests.  Set @SbatchArguments@ to an array of strings.  For example:
 
 <notextile>
-<pre>
-Clusters:
-  zzzzz:
-    Containers:
+<pre>    Containers:
       SLURM:
-        SbatchArgumentsList:
-          - <b>"--partition=PartitionName"</b>
+        <code class="userinput">SbatchArgumentsList:
+          - <b>"--partition=PartitionName"</b></code>
 </pre>
 </notextile>
 
@@ -115,12 +106,9 @@ h3(#CrunchRunCommand-cgroups). Containers.CrunchRunArgumentList: Dispatch to SLU
 If your SLURM cluster uses the @task/cgroup@ TaskPlugin, you can configure Crunch's Docker containers to be dispatched inside SLURM's cgroups.  This provides consistent enforcement of resource constraints.  To do this, use a crunch-dispatch-slurm configuration like the following:
 
 <notextile>
-<pre>
-Clusters:
-  zzzzz:
-    Containers:
-    <code class="userinput">CrunchRunArgumentsList:
-      - <b>"-cgroup-parent-subsystem=memory"</b></code>
+<pre>    Containers:
+      <code class="userinput">CrunchRunArgumentsList:
+        - <b>"-cgroup-parent-subsystem=memory"</b></code>
 </pre>
 </notextile>
 
@@ -139,53 +127,17 @@ h3(#CrunchRunCommand-network). Containers.CrunchRunArgumentList: Using host netw
 Older Linux kernels (prior to 3.18) have bugs in network namespace handling which can lead to compute node lockups.  This by is indicated by blocked kernel tasks in "Workqueue: netns cleanup_net".   If you are experiencing this problem, as a workaround you can disable use of network namespaces by Docker across the cluster.  Be aware this reduces container isolation, which may be a security risk.
 
 <notextile>
-<pre>
-Clusters:
-  zzzzz:
-    Containers:
-    <code class="userinput">CrunchRunArgumentsList:
-      - <b>"-container-enable-networking=always"</b>
-      - <b>"-container-network-mode=host"</b></code>
+<pre>    Containers:
+      <code class="userinput">CrunchRunArgumentsList:
+        - <b>"-container-enable-networking=always"</b>
+        - <b>"-container-network-mode=host"</b></code>
 </pre>
 </notextile>
 
-h3(#MinRetryPeriod). Containers.MinRetryPeriod: Rate-limit repeated attempts to start containers
+{% assign arvados_component = 'crunch-dispatch-slurm' %}
 
-If SLURM is unable to run a container, the dispatcher will submit it again after the next PollPeriod. If PollPeriod is very short, this can be excessive. If MinRetryPeriod is set, the dispatcher will avoid submitting the same container to SLURM more than once in the given time span.
+{% include 'install_packages' %}
 
-<notextile>
-<pre>
-Clusters:
-  zzzzz:
-    Containers:
-      <code class="userinput">MinRetryPeriod: <b>30s</b></code>
-</pre>
-</notextile>
+{% include 'start_service' %}
 
-h3(#ReserveExtraRAM). Containers.ReserveExtraRAM: Extra RAM for jobs
-
-Extra RAM to reserve (in bytes) on each SLURM job submitted by Arvados, which is added to the amount specified in the container's @runtime_constraints@.  If not provided, the default value is zero.  Helpful when using @-cgroup-parent-subsystem@, where @crunch-run@ and @arv-mount@ share the control group memory limit with the user process.  In this situation, at least 256MiB is recommended to accomodate each container's @crunch-run@ and @arv-mount@ processes.
-
-<notextile>
-<pre>
-Clusters:
-  zzzzz:
-    Containers:
-      <code class="userinput">ReserveExtraRAM: <b>256MiB</b></code>
-</pre>
-</notextile>
-
-h2. Restart the dispatcher
-
-{% include 'notebox_begin' %}
-
-The crunch-dispatch-slurm package includes configuration files for systemd.  If you're using a different init system, you'll need to configure a service to start and stop a @crunch-dispatch-slurm@ process as desired.  The process should run from a directory where the @crunch@ user has write permission on all compute nodes, such as its home directory or @/tmp@.  You do not need to specify any additional switches or environment variables.
-
-{% include 'notebox_end' %}
-
-Restart the dispatcher to run with your new configuration:
-
-<notextile>
-<pre><code>~$ <span class="userinput">sudo systemctl restart crunch-dispatch-slurm</span>
-</code></pre>
-</notextile>
+{% include 'restart_api' %}