Merge branch '8784-dir-listings'
[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 h2. Test compute node setup
13
14 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:
15
16 <notextile>
17 <pre><code>~$ <span class="userinput">sudo -u <b>crunch</b> srun -N1 docker run busybox echo OK
18 </code></pre>
19 </notextile>
20
21 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.
22
23 h2. Test the dispatcher
24
25 On the dispatch node, start monitoring the crunch-dispatch-slurm logs:
26
27 <notextile>
28 <pre><code>~$ <span class="userinput">sudo journalctl -o cat -fu crunch-dispatch-slurm.service</span>
29 </code></pre>
30 </notextile>
31
32 *On your shell server*, submit a simple container request:
33
34 <notextile>
35 <pre><code>shell:~$ <span class="userinput">arv container_request create --container-request '{
36   "name":            "test",
37   "state":           "Committed",
38   "priority":        1,
39   "container_image": "arvados/jobs:latest",
40   "command":         ["echo", "Hello, Crunch!"],
41   "output_path":     "/out",
42   "mounts": {
43     "/out": {
44       "kind":        "tmp",
45       "capacity":    1000
46     }
47   },
48   "runtime_constraints": {
49     "vcpus": 1,
50     "ram": 8388608
51   }
52 }'</span>
53 </code></pre>
54 </notextile>
55
56 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:
57
58 <notextile>
59 <pre><code>2016/08/05 13:52:54 Monitoring container zzzzz-dz642-hdp2vpu9nq14tx0 started
60 2016/08/05 13:53:04 About to submit queued container zzzzz-dz642-hdp2vpu9nq14tx0
61 2016/08/05 13:53:04 sbatch succeeded: Submitted batch job 8102
62 </code></pre>
63 </notextile>
64
65 If you do not see crunch-dispatch-slurm try to dispatch the container, double-check that it is running and that the API hostname and token in @/etc/arvados/crunch-dispatch-slurm/crunch-dispatch-slurm.yml@ are correct.
66
67 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:
68
69 <notextile>
70 <pre><code>~$ <span class="userinput">squeue --long</span>
71 Fri Aug  5 13:57:50 2016
72   JOBID PARTITION     NAME     USER    STATE       TIME TIMELIMIT  NODES NODELIST(REASON)
73    8103   compute zzzzz-dz   crunch  RUNNING       1:56 UNLIMITED      1 compute0
74 </code></pre>
75 </notextile>
76
77 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>.
78
79 When the container finishes, the dispatcher will log that, with the final result:
80
81 <notextile>
82 <pre><code>2016/08/05 13:53:14 Container zzzzz-dz642-hdp2vpu9nq14tx0 now in state "Complete" with locked_by_uuid ""
83 2016/08/05 13:53:14 Monitoring container zzzzz-dz642-hdp2vpu9nq14tx0 finished
84 </code></pre>
85 </notextile>
86
87 After the container finishes, you can get the container record by UUID *from a shell server* to see its results:
88
89 <notextile>
90 <pre><code>shell:~$ <span class="userinput">arv get <b>zzzzz-dz642-hdp2vpu9nq14tx0</b></span>
91 {
92  ...
93  "exit_code":0,
94  "log":"a01df2f7e5bc1c2ad59c60a837e90dc6+166",
95  "output":"d41d8cd98f00b204e9800998ecf8427e+0",
96  "state":"Complete",
97  ...
98 }
99 </code></pre>
100 </notextile>
101
102 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:
103
104 <notextile>
105 <pre><code>~$ <span class="userinput">arv keep ls <b>a01df2f7e5bc1c2ad59c60a837e90dc6+166</b></span>
106 ./crunch-run.txt
107 ./stderr.txt
108 ./stdout.txt
109 ~$ <span class="userinput">arv keep get <b>a01df2f7e5bc1c2ad59c60a837e90dc6+166</b>/stdout.txt</span>
110 2016-08-05T13:53:06.201011Z Hello, Crunch!
111 </code></pre>
112 </notextile>
113
114 If the container does not dispatch successfully, refer to the crunch-dispatch-slurm logs for information about why it failed.