Merge branch 'master' into 13804-no-shutdown-wanted-nodes
[arvados.git] / doc / install / install-nodemanager.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install Node Manager
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 Arvados Node Manager provides elastic computing for Arvados and SLURM by creating and destroying virtual machines on demand.  Node Manager currently supports Amazon Web Services (AWS), Google Cloud Platform (GCP) and Microsoft Azure.
13
14 Note: node manager is only required for elastic computing cloud environments.  Fixed size clusters (such as on-premise HPC) do not require node manager.
15
16 h2. Install
17
18 Node manager may run anywhere, however it must be able to communicate with the cloud provider's APIs, and use the command line tools @sinfo@, @squeue@ and @scontrol@ to communicate with the cluster's SLURM controller.
19
20 On Debian-based systems:
21
22 <notextile>
23 <pre><code>~$ <span class="userinput">sudo apt-get install arvados-node-manager</span>
24 </code></pre>
25 </notextile>
26
27 On Red Hat-based systems:
28
29 <notextile>
30 <pre><code>~$ <span class="userinput">sudo yum install arvados-node-manager</span>
31 </code></pre>
32 </notextile>
33
34 h2. Create compute image
35
36 Configure a virtual machine following the "instructions to set up a compute node.":{{site.baseurl}}/install/crunch2-slurm/install-compute-node.html and set it up to run a "ping script":{{site.baseurl}}/install/install-compute-ping.html at boot.
37
38 Create a virtual machine image using the commands provided by your cloud provider.  We recommend using a tool such as "Packer":https://www.packer.io/ to automate this process.
39
40 Configure node manager to use the image with the @image@ or @image_id@ parameter.
41
42 h2. Configure node manager
43
44 The configuration file at @/etc/arvados-node-manager/config.ini@ .  Some configuration details are specific to the cloud provider you are using:
45
46 * "Amazon Web Services":#aws
47 * "Google Cloud Platform":#gcp
48 * "Microsoft Azure":#azure
49
50 h3(#aws). Amazon Web Services
51
52 <pre>
53 # EC2 configuration for Arvados Node Manager.
54 # All times are in seconds unless specified otherwise.
55
56 [Manage]
57 # The management server responds to http://addr:port/status.json with
58 # a snapshot of internal state.
59
60 # Management server listening address (default 127.0.0.1)
61 #address = 0.0.0.0
62
63 # Management server port number (default -1, server is disabled)
64 #port = 8989
65
66 [Daemon]
67 # The dispatcher can customize the start and stop procedure for
68 # cloud nodes.  For example, the SLURM dispatcher drains nodes
69 # through SLURM before shutting them down.
70 dispatcher = slurm
71
72 # Node Manager will ensure that there are at least this many nodes running at
73 # all times.  If node manager needs to start new idle nodes for the purpose of
74 # satisfying min_nodes, it will use the cheapest node type.  However, depending
75 # on usage patterns, it may also satisfy min_nodes by keeping alive some
76 # more-expensive nodes
77 min_nodes = 0
78
79 # Node Manager will not start any compute nodes when at least this
80 # many are running.
81 max_nodes = 8
82
83 # Upper limit on rate of spending (in $/hr), will not boot additional nodes
84 # if total price of already running nodes meets or exceeds this threshold.
85 # default 0 means no limit.
86 max_total_price = 0
87
88 # Poll EC2 nodes and Arvados for new information every N seconds.
89 poll_time = 60
90
91 # Polls have exponential backoff when services fail to respond.
92 # This is the longest time to wait between polls.
93 max_poll_time = 300
94
95 # If Node Manager can't succesfully poll a service for this long,
96 # it will never start or stop compute nodes, on the assumption that its
97 # information is too outdated.
98 poll_stale_after = 600
99
100 # If Node Manager boots a cloud node, and it does not pair with an Arvados
101 # node before this long, assume that there was a cloud bootstrap failure and
102 # shut it down.  Note that normal shutdown windows apply (see the Cloud
103 # section), so this should be shorter than the first shutdown window value.
104 boot_fail_after = 1800
105
106 # "Node stale time" affects two related behaviors.
107 # 1. If a compute node has been running for at least this long, but it
108 # isn't paired with an Arvados node, do not shut it down, but leave it alone.
109 # This prevents the node manager from shutting down a node that might
110 # actually be doing work, but is having temporary trouble contacting the
111 # API server.
112 # 2. When the Node Manager starts a new compute node, it will try to reuse
113 # an Arvados node that hasn't been updated for this long.
114 node_stale_after = 14400
115
116 # Number of consecutive times a node must report as "idle" before it
117 # will be considered eligible for shutdown.  Node status is checked
118 # each poll period, and node can go idle at any point during a poll
119 # period (meaning a node could be reported as idle that has only been
120 # idle for 1 second).  With a 60 second poll period, three consecutive
121 # status updates of "idle" suggests the node has been idle at least
122 # 121 seconds.
123 consecutive_idle_count = 3
124
125 # Scaling factor to be applied to nodes' available RAM size. Usually there's a
126 # variable discrepancy between the advertised RAM value on cloud nodes and the
127 # actual amount available.
128 # If not set, this value will be set to 0.95
129 node_mem_scaling = 0.95
130
131 # File path for Certificate Authorities
132 certs_file = /etc/ssl/certs/ca-certificates.crt
133
134 [Logging]
135 # Log file path
136 file = /var/log/arvados/node-manager.log
137
138 # Log level for most Node Manager messages.
139 # Choose one of DEBUG, INFO, WARNING, ERROR, or CRITICAL.
140 # WARNING lets you know when polling a service fails.
141 # INFO additionally lets you know when a compute node is started or stopped.
142 level = INFO
143
144 # You can also set different log levels for specific libraries.
145 # Pykka is the Node Manager's actor library.
146 # Setting this to DEBUG will display tracebacks for uncaught
147 # exceptions in the actors, but it's also very chatty.
148 pykka = WARNING
149
150 # Setting apiclient to INFO will log the URL of every Arvados API request.
151 apiclient = WARNING
152
153 [Arvados]
154 host = zyxwv.arvadosapi.com
155 token = ARVADOS_TOKEN
156 timeout = 15
157
158 # Accept an untrusted SSL certificate from the API server?
159 insecure = no
160
161 [Cloud]
162 provider = ec2
163
164 # It's usually most cost-effective to shut down compute nodes during narrow
165 # windows of time.  For example, EC2 bills each node by the hour, so the best
166 # time to shut down a node is right before a new hour of uptime starts.
167 # Shutdown windows define these periods of time.  These are windows in
168 # full minutes, separated by commas.  Counting from the time the node is
169 # booted, the node WILL NOT shut down for N1 minutes; then it MAY shut down
170 # for N2 minutes; then it WILL NOT shut down for N3 minutes; and so on.
171 # For example, "54, 5, 1" means the node may shut down from the 54th to the
172 # 59th minute of each hour of uptime.
173 # Specify at least two windows.  You can add as many as you need beyond that.
174 shutdown_windows = 54, 5, 1
175
176 [Cloud Credentials]
177 key = KEY
178 secret = SECRET_KEY
179 region = us-east-1
180 timeout = 60
181
182 [Cloud List]
183 # This section defines filters that find compute nodes.
184 # Tags that you specify here will automatically be added to nodes you create.
185 # Replace colons in Amazon filters with underscores
186 # (e.g., write "tag:mytag" as "tag_mytag").
187 instance-state-name = running
188 tag_arvados-class = dynamic-compute
189 tag_cluster = zyxwv
190
191 [Cloud Create]
192 # New compute nodes will send pings to Arvados at this host.
193 # You may specify a port, and use brackets to disambiguate IPv6 addresses.
194 ping_host = hostname:port
195
196 # Give the name of an SSH key on AWS...
197 ex_keyname = string
198
199 # ... or a file path for an SSH key that can log in to the compute node.
200 # (One or the other, not both.)
201 # ssh_key = path
202
203 # The EC2 IDs of the image and subnet compute nodes should use.
204 image_id = idstring
205 subnet_id = idstring
206
207 # Comma-separated EC2 IDs for the security group(s) assigned to each
208 # compute node.
209 security_groups = idstring1, idstring2
210
211 # Apply an Instance Profile ARN to the newly created compute nodes
212 # For more info, see:
213 # https://aws.amazon.com/premiumsupport/knowledge-center/iam-policy-restrict-vpc/
214 # ex_iamprofile = arn:aws:iam::ACCOUNTNUMBER:instance-profile/ROLENAME
215
216
217 # You can define any number of Size sections to list EC2 sizes you're
218 # willing to use.  The Node Manager should boot the cheapest size(s) that
219 # can run jobs in the queue.
220 #
221 # Each size section MUST define the number of cores are available in this
222 # size class (since libcloud does not provide any consistent API for exposing
223 # this setting).
224 # You may also want to define the amount of scratch space (expressed
225 # in GB) for Crunch jobs.  You can also override Amazon's provided
226 # data fields (such as price per hour) by setting them here.
227
228 [Size m4.large]
229 cores = 2
230 price = 0.126
231 scratch = 100
232
233 [Size m4.xlarge]
234 cores = 4
235 price = 0.252
236 scratch = 100
237 </pre>
238
239 h3(#gcp). Google Cloud Platform
240
241 <pre>
242 # Google Compute Engine configuration for Arvados Node Manager.
243 # All times are in seconds unless specified otherwise.
244
245 [Manage]
246 # The management server responds to http://addr:port/status.json with
247 # a snapshot of internal state.
248
249 # Management server listening address (default 127.0.0.1)
250 #address = 0.0.0.0
251
252 # Management server port number (default -1, server is disabled)
253 #port = 8989
254
255 [Daemon]
256 # Node Manager will ensure that there are at least this many nodes running at
257 # all times.  If node manager needs to start new idle nodes for the purpose of
258 # satisfying min_nodes, it will use the cheapest node type.  However, depending
259 # on usage patterns, it may also satisfy min_nodes by keeping alive some
260 # more-expensive nodes
261 min_nodes = 0
262
263 # Node Manager will not start any compute nodes when at least this
264 # running at all times.  By default, these will be the cheapest node size.
265 max_nodes = 8
266
267 # Poll compute nodes and Arvados for new information every N seconds.
268 poll_time = 60
269
270 # Upper limit on rate of spending (in $/hr), will not boot additional nodes
271 # if total price of already running nodes meets or exceeds this threshold.
272 # default 0 means no limit.
273 max_total_price = 0
274
275 # Polls have exponential backoff when services fail to respond.
276 # This is the longest time to wait between polls.
277 max_poll_time = 300
278
279 # If Node Manager can't succesfully poll a service for this long,
280 # it will never start or stop compute nodes, on the assumption that its
281 # information is too outdated.
282 poll_stale_after = 600
283
284 # "Node stale time" affects two related behaviors.
285 # 1. If a compute node has been running for at least this long, but it
286 # isn't paired with an Arvados node, do not shut it down, but leave it alone.
287 # This prevents the node manager from shutting down a node that might
288 # actually be doing work, but is having temporary trouble contacting the
289 # API server.
290 # 2. When the Node Manager starts a new compute node, it will try to reuse
291 # an Arvados node that hasn't been updated for this long.
292 node_stale_after = 14400
293
294 # Number of consecutive times a node must report as "idle" before it
295 # will be considered eligible for shutdown.  Node status is checked
296 # each poll period, and node can go idle at any point during a poll
297 # period (meaning a node could be reported as idle that has only been
298 # idle for 1 second).  With a 60 second poll period, three consecutive
299 # status updates of "idle" suggests the node has been idle at least
300 # 121 seconds.
301 consecutive_idle_count = 3
302
303 # Scaling factor to be applied to nodes' available RAM size. Usually there's a
304 # variable discrepancy between the advertised RAM value on cloud nodes and the
305 # actual amount available.
306 # If not set, this value will be set to 0.95
307 node_mem_scaling = 0.95
308
309 # File path for Certificate Authorities
310 certs_file = /etc/ssl/certs/ca-certificates.crt
311
312 [Logging]
313 # Log file path
314 file = /var/log/arvados/node-manager.log
315
316 # Log level for most Node Manager messages.
317 # Choose one of DEBUG, INFO, WARNING, ERROR, or CRITICAL.
318 # WARNING lets you know when polling a service fails.
319 # INFO additionally lets you know when a compute node is started or stopped.
320 level = INFO
321
322 # You can also set different log levels for specific libraries.
323 # Pykka is the Node Manager's actor library.
324 # Setting this to DEBUG will display tracebacks for uncaught
325 # exceptions in the actors, but it's also very chatty.
326 pykka = WARNING
327
328 # Setting apiclient to INFO will log the URL of every Arvados API request.
329 apiclient = WARNING
330
331 [Arvados]
332 host = zyxwv.arvadosapi.com
333 token = ARVADOS_TOKEN
334 timeout = 15
335
336 # Accept an untrusted SSL certificate from the API server?
337 insecure = no
338
339 [Cloud]
340 provider = gce
341
342 # Shutdown windows define periods of time when a node may and may not
343 # be shut down.  These are windows in full minutes, separated by
344 # commas.  Counting from the time the node is booted, the node WILL
345 # NOT shut down for N1 minutes; then it MAY shut down for N2 minutes;
346 # then it WILL NOT shut down for N3 minutes; and so on.  For example,
347 # "54, 5, 1" means the node may shut down from the 54th to the 59th
348 # minute of each hour of uptime.
349 # GCE bills by the minute, and does not provide information about when
350 # a node booted.  Node Manager will store this information in metadata
351 # when it boots a node; if that information is not available, it will
352 # assume the node booted at the epoch.  These shutdown settings are
353 # very aggressive.  You may want to adjust this if you want more
354 # continuity of service from a single node.
355 shutdown_windows = 20, 999999
356
357 [Cloud Credentials]
358 user_id = client_email_address@developer.gserviceaccount.com
359 key = path_to_certificate.pem
360 project = project-id-from-google-cloud-dashboard
361 timeout = 60
362
363 # Valid location (zone) names: https://cloud.google.com/compute/docs/zones
364 datacenter = us-central1-a
365
366 # Optional settings. For full documentation see
367 # http://libcloud.readthedocs.org/en/latest/compute/drivers/gce.html#libcloud.compute.drivers.gce.GCENodeDriver
368 #
369 # auth_type = SA               # SA, IA or GCE
370 # scopes = https://www.googleapis.com/auth/compute
371 # credential_file =
372
373 [Cloud List]
374 # A comma-separated list of tags that must be applied to a node for it to
375 # be considered a compute node.
376 # The driver will automatically apply these tags to nodes it creates.
377 tags = zyxwv, compute
378
379 [Cloud Create]
380 # New compute nodes will send pings to Arvados at this host.
381 # You may specify a port, and use brackets to disambiguate IPv6 addresses.
382 ping_host = hostname:port
383
384 # A file path for an SSH key that can log in to the compute node.
385 # ssh_key = path
386
387 # The GCE image name and network zone name to use when creating new nodes.
388 image = debian-7
389 # network = your_network_name
390
391 # JSON string of service account authorizations for this cluster.
392 # See http://libcloud.readthedocs.org/en/latest/compute/drivers/gce.html#specifying-service-account-scopes
393 # service_accounts = [{'email':'account@example.com', 'scopes':['storage-ro']}]
394
395
396 # You can define any number of Size sections to list node sizes you're
397 # willing to use.  The Node Manager should boot the cheapest size(s) that
398 # can run jobs in the queue.
399 #
400 # The Size fields are interpreted the same way as with a libcloud NodeSize:
401 # http://libcloud.readthedocs.org/en/latest/compute/api.html#libcloud.compute.base.NodeSize
402 #
403 # See https://cloud.google.com/compute/docs/machine-types for a list
404 # of known machine types that may be used as a Size parameter.
405 #
406 # Each size section MUST define the number of cores are available in this
407 # size class (since libcloud does not provide any consistent API for exposing
408 # this setting).
409 # You may also want to define the amount of scratch space (expressed
410 # in GB) for Crunch jobs.
411 # You can also override Google's provided data fields (such as price per hour)
412 # by setting them here.
413
414 [Size n1-standard-2]
415 cores = 2
416 price = 0.076
417 scratch = 100
418
419 [Size n1-standard-4]
420 cores = 4
421 price = 0.152
422 scratch = 200
423 </pre>
424
425 h3(#azure). Microsoft Azure
426
427 <pre>
428 # Azure configuration for Arvados Node Manager.
429 # All times are in seconds unless specified otherwise.
430
431 [Manage]
432 # The management server responds to http://addr:port/status.json with
433 # a snapshot of internal state.
434
435 # Management server listening address (default 127.0.0.1)
436 #address = 0.0.0.0
437
438 # Management server port number (default -1, server is disabled)
439 #port = 8989
440
441 [Daemon]
442 # The dispatcher can customize the start and stop procedure for
443 # cloud nodes.  For example, the SLURM dispatcher drains nodes
444 # through SLURM before shutting them down.
445 dispatcher = slurm
446
447 # Node Manager will ensure that there are at least this many nodes running at
448 # all times.  If node manager needs to start new idle nodes for the purpose of
449 # satisfying min_nodes, it will use the cheapest node type.  However, depending
450 # on usage patterns, it may also satisfy min_nodes by keeping alive some
451 # more-expensive nodes
452 min_nodes = 0
453
454 # Node Manager will not start any compute nodes when at least this
455 # many are running.
456 max_nodes = 8
457
458 # Upper limit on rate of spending (in $/hr), will not boot additional nodes
459 # if total price of already running nodes meets or exceeds this threshold.
460 # default 0 means no limit.
461 max_total_price = 0
462
463 # Poll Azure nodes and Arvados for new information every N seconds.
464 poll_time = 60
465
466 # Polls have exponential backoff when services fail to respond.
467 # This is the longest time to wait between polls.
468 max_poll_time = 300
469
470 # If Node Manager can't succesfully poll a service for this long,
471 # it will never start or stop compute nodes, on the assumption that its
472 # information is too outdated.
473 poll_stale_after = 600
474
475 # If Node Manager boots a cloud node, and it does not pair with an Arvados
476 # node before this long, assume that there was a cloud bootstrap failure and
477 # shut it down.  Note that normal shutdown windows apply (see the Cloud
478 # section), so this should be shorter than the first shutdown window value.
479 boot_fail_after = 1800
480
481 # "Node stale time" affects two related behaviors.
482 # 1. If a compute node has been running for at least this long, but it
483 # isn't paired with an Arvados node, do not shut it down, but leave it alone.
484 # This prevents the node manager from shutting down a node that might
485 # actually be doing work, but is having temporary trouble contacting the
486 # API server.
487 # 2. When the Node Manager starts a new compute node, it will try to reuse
488 # an Arvados node that hasn't been updated for this long.
489 node_stale_after = 14400
490
491 # Number of consecutive times a node must report as "idle" before it
492 # will be considered eligible for shutdown.  Node status is checked
493 # each poll period, and node can go idle at any point during a poll
494 # period (meaning a node could be reported as idle that has only been
495 # idle for 1 second).  With a 60 second poll period, three consecutive
496 # status updates of "idle" suggests the node has been idle at least
497 # 121 seconds.
498 consecutive_idle_count = 3
499
500 # Scaling factor to be applied to nodes' available RAM size. Usually there's a
501 # variable discrepancy between the advertised RAM value on cloud nodes and the
502 # actual amount available.
503 # If not set, this value will be set to 0.95
504 node_mem_scaling = 0.95
505
506 # File path for Certificate Authorities
507 certs_file = /etc/ssl/certs/ca-certificates.crt
508
509 [Logging]
510 # Log file path
511 file = /var/log/arvados/node-manager.log
512
513 # Log level for most Node Manager messages.
514 # Choose one of DEBUG, INFO, WARNING, ERROR, or CRITICAL.
515 # WARNING lets you know when polling a service fails.
516 # INFO additionally lets you know when a compute node is started or stopped.
517 level = INFO
518
519 # You can also set different log levels for specific libraries.
520 # Pykka is the Node Manager's actor library.
521 # Setting this to DEBUG will display tracebacks for uncaught
522 # exceptions in the actors, but it's also very chatty.
523 pykka = WARNING
524
525 # Setting apiclient to INFO will log the URL of every Arvados API request.
526 apiclient = WARNING
527
528 [Arvados]
529 host = zyxwv.arvadosapi.com
530 token = ARVADOS_TOKEN
531 timeout = 15
532
533 # Accept an untrusted SSL certificate from the API server?
534 insecure = no
535
536 [Cloud]
537 provider = azure
538
539 # Shutdown windows define periods of time when a node may and may not be shut
540 # down.  These are windows in full minutes, separated by commas.  Counting from
541 # the time the node is booted, the node WILL NOT shut down for N1 minutes; then
542 # it MAY shut down for N2 minutes; then it WILL NOT shut down for N3 minutes;
543 # and so on.  For example, "20, 999999" means the node may shut down between
544 # the 20th and 999999th minutes of uptime.
545 # Azure bills by the minute, so it makes sense to agressively shut down idle
546 # nodes.  Specify at least two windows.  You can add as many as you need beyond
547 # that.
548 shutdown_windows = 20, 999999
549
550 [Cloud Credentials]
551 # Use "azure account list" with the azure CLI to get these values.
552 tenant_id = 00000000-0000-0000-0000-000000000000
553 subscription_id = 00000000-0000-0000-0000-000000000000
554
555 # The following directions are based on
556 # https://azure.microsoft.com/en-us/documentation/articles/resource-group-authenticate-service-principal/
557 # and updated for v2 of the Azure cli tool.
558 #
559 # az ad app create --display-name "Node Manager" --homepage "https://arvados.org" --identifier-uris "https://<Your_Application_Uri>" --password <Your_Password>
560 # az ad sp create "<Application_Id>"
561 # az role assignment create --assignee "<Application_Id>" --role Owner --resource-group "<Your_Azure_Arvados_Resource_Group>"
562 #
563 # Use <Application_Id> for "key" and the <Your_Password> for "secret"
564 #
565 key = 00000000-0000-0000-0000-000000000000
566 secret = PASSWORD
567 timeout = 60
568 region = East US
569
570 [Cloud List]
571 # The resource group in which the compute node virtual machines will be created
572 # and listed.
573 ex_resource_group = ArvadosResourceGroup
574
575 [Cloud Create]
576 # The compute node image, as a link to a VHD in Azure blob store.
577 image = https://example.blob.core.windows.net/system/Microsoft.Compute/Images/images/zyxwv-compute-osDisk.vhd
578
579 # Path to a local ssh key file that will be used to provision new nodes.
580 ssh_key = /home/arvadosuser/.ssh/id_rsa.pub
581
582 # The account name for the admin user that will be provisioned on new nodes.
583 ex_user_name = arvadosuser
584
585 # The Azure storage account that will be used to store the node OS disk images.
586 ex_storage_account = arvadosstorage
587
588 # The virtual network the VMs will be associated with.
589 ex_network = ArvadosNetwork
590
591 # Optional subnet of the virtual network.
592 #ex_subnet = default
593
594 # Node tags
595 tag_arvados-class = dynamic-compute
596 tag_cluster = zyxwv
597
598 # the API server to ping
599 ping_host = hostname:port
600
601 # You can define any number of Size sections to list Azure sizes you're willing
602 # to use.  The Node Manager should boot the cheapest size(s) that can run jobs
603 # in the queue.  You must also provide price per hour as the Azure driver
604 # compute currently does not report prices.
605 #
606 # See https://azure.microsoft.com/en-us/pricing/details/virtual-machines/
607 # for a list of known machine types that may be used as a Size parameter.
608 #
609 # Each size section MUST define the number of cores are available in this
610 # size class (since libcloud does not provide any consistent API for exposing
611 # this setting).
612 # You may also want to define the amount of scratch space (expressed
613 # in GB) for Crunch jobs.  You can also override Microsoft's provided
614 # data fields by setting them here.
615
616 [Size Standard_D3]
617 cores = 4
618 price = 0.56
619
620 [Size Standard_D4]
621 cores = 8
622 price = 1.12
623 </pre>
624
625 h2. Running
626
627 <pre>
628 $ arvados-node-manager --config /etc/arvados-node-manager/config.ini
629 </pre>