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