17417: Add arm64 packages for our Golang components.
[arvados.git] / doc / install / crunch2-slurm / install-test.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Test Slurm dispatch
5 ...
6 {% comment %}
7 Copyright (C) The Arvados Authors. All rights reserved.
8
9 SPDX-License-Identifier: CC-BY-SA-3.0
10 {% endcomment %}
11
12 {% include 'notebox_begin_warning' %}
13 crunch-dispatch-slurm is only relevant for on premises clusters that will spool jobs to Slurm. Skip this section if you are installing a cloud cluster.
14 {% include 'notebox_end' %}
15
16 h2. Test compute node setup
17
18 You should now be able to submit Slurm jobs that run in Docker containers.  On the node where you're running the dispatcher, you can test this by running:
19
20 <notextile>
21 <pre><code>~$ <span class="userinput">sudo -u <b>crunch</b> srun -N1 docker run busybox echo OK
22 </code></pre>
23 </notextile>
24
25 If it works, this command should print @OK@ (it may also show some status messages from Slurm and/or Docker).  If it does not print @OK@, double-check your compute node setup, and that the @crunch@ user can submit Slurm jobs.
26
27 h2. Test the dispatcher
28
29 On the dispatch node, start monitoring the crunch-dispatch-slurm logs:
30
31 <notextile>
32 <pre><code>~$ <span class="userinput">sudo journalctl -o cat -fu crunch-dispatch-slurm.service</span>
33 </code></pre>
34 </notextile>
35
36 Submit a simple container request:
37
38 <notextile>
39 <pre><code>shell:~$ <span class="userinput">arv container_request create --container-request '{
40   "name":            "test",
41   "state":           "Committed",
42   "priority":        1,
43   "container_image": "arvados/jobs:latest",
44   "command":         ["echo", "Hello, Crunch!"],
45   "output_path":     "/out",
46   "mounts": {
47     "/out": {
48       "kind":        "tmp",
49       "capacity":    1000
50     }
51   },
52   "runtime_constraints": {
53     "vcpus": 1,
54     "ram": 8388608
55   }
56 }'</span>
57 </code></pre>
58 </notextile>
59
60 This command should return a record with a @container_uuid@ field.  Once @crunch-dispatch-slurm@ polls the API server for new containers to run, you should see it dispatch that same container.  It will log messages like:
61
62 <notextile>
63 <pre><code>2016/08/05 13:52:54 Monitoring container zzzzz-dz642-hdp2vpu9nq14tx0 started
64 2016/08/05 13:53:04 About to submit queued container zzzzz-dz642-hdp2vpu9nq14tx0
65 2016/08/05 13:53:04 sbatch succeeded: Submitted batch job 8102
66 </code></pre>
67 </notextile>
68
69 Before the container finishes, Slurm's @squeue@ command will show the new job in the list of queued and running jobs.  For example, you might see:
70
71 <notextile>
72 <pre><code>~$ <span class="userinput">squeue --long</span>
73 Fri Aug  5 13:57:50 2016
74   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)
75    8103   compute zzzzz-dz   crunch  RUNNING       1:56 UNLIMITED      1 compute0
76 </code></pre>
77 </notextile>
78
79 The job's name corresponds to the container's UUID.  You can get more information about it by running, e.g., <notextile><code>scontrol show job Name=<b>UUID</b></code></notextile>.
80
81 When the container finishes, the dispatcher will log that, with the final result:
82
83 <notextile>
84 <pre><code>2016/08/05 13:53:14 Container zzzzz-dz642-hdp2vpu9nq14tx0 now in state "Complete" with locked_by_uuid ""
85 2016/08/05 13:53:14 Monitoring container zzzzz-dz642-hdp2vpu9nq14tx0 finished
86 </code></pre>
87 </notextile>
88
89 After the container finishes, you can get the container record by UUID *from a shell server* to see its results:
90
91 <notextile>
92 <pre><code>shell:~$ <span class="userinput">arv get <b>zzzzz-dz642-hdp2vpu9nq14tx0</b></span>
93 {
94  ...
95  "exit_code":0,
96  "log":"a01df2f7e5bc1c2ad59c60a837e90dc6+166",
97  "output":"d41d8cd98f00b204e9800998ecf8427e+0",
98  "state":"Complete",
99  ...
100 }
101 </code></pre>
102 </notextile>
103
104 You can use standard Keep tools to view the container's output and logs from their corresponding fields.  For example, to see the logs from the collection referenced in the @log@ field:
105
106 <notextile>
107 <pre><code>~$ <span class="userinput">arv keep ls <b>a01df2f7e5bc1c2ad59c60a837e90dc6+166</b></span>
108 ./crunch-run.txt
109 ./stderr.txt
110 ./stdout.txt
111 ~$ <span class="userinput">arv-get <b>a01df2f7e5bc1c2ad59c60a837e90dc6+166</b>/stdout.txt</span>
112 2016-08-05T13:53:06.201011Z Hello, Crunch!
113 </code></pre>
114 </notextile>
115
116 If the container does not dispatch successfully, refer to the @crunch-dispatch-slurm@ logs for information about why it failed.