19070: Still trying to fix test_with_arvbox
[arvados.git] / doc / api / execution.html.textile.liquid
1 ---
2 layout: default
3 navsection: architecture
4 title: Computing with Crunch
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 Crunch is the name for the Arvados system for managing computation.  It provides an abstract API to various clouds and HPC resource allocation and scheduling systems, and integrates closely with Keep storage and the Arvados permission system.
13
14 h2. Container API
15
16 # To submit work, create a "container request":{{site.baseurl}}/api/methods/container_requests.html in the @Committed@ state.
17 # The system will fufill the container request by creating or reusing a "Container object":{{site.baseurl}}/api/methods/containers.html and assigning it to the @container_uuid@ field.  If the same request has been submitted in the past, it may reuse an existing container.  The reuse behavior can be suppressed with @use_existing: false@ in the container request.
18 # The dispatcher process will notice a new container in @Queued@ state and submit a container executor to the underlying work queuing system (such as Slurm).
19 # The container executes.  Upon termination the container goes into the  @Complete@ state.  If the container execution was interrupted or lost due to system failure, it will go into the @Cancelled@ state.
20 # When the container associated with the container request is completed, the container request will go into the @Final@ state.
21 # The @output_uuid@ field of the container request contains the uuid of output collection produced by container request.
22
23 !(full-width){{site.baseurl}}/images/Crunch_dispatch.svg!
24
25 h2(#RAM). Understanding RAM requests for containers
26
27 The @runtime_constraints@ section of a container specifies working RAM (@ram@) and Keep cache (@keep_cache_ram@).  If not specified, containers get a default Keep cache (@container_default_keep_cache_ram@, default 256 MiB).  The total RAM requested for a container is the sum of working RAM, Keep cache, and an additional RAM reservation configured by the admin (@ReserveExtraRAM@ in the dispatcher configuration, default zero).
28
29 The total RAM request is used to schedule containers onto compute nodes.  RAM allocation limits are enforced using kernel controls such as cgroups.  A container which requests 1 GiB RAM will only be permitted to allocate up to 1 GiB of RAM, even if scheduled on a 4 GiB node.  On HPC systems, a multi-core node may run multiple containers at a time.
30
31 When running on the cloud, the memory request (along with CPU and disk) is used to select (and possibly boot) an instance type with adequate resources to run the container.  Instance type RAM is derated 5% from the published specification to accomodate virtual machine, kernel and system services overhead.
32
33 h3. Calculate minimum instance type RAM for a container
34
35     (RAM request + Keep cache + ReserveExtraRAM) * (100/95)
36
37 For example, for a 3 GiB request, default Keep cache, and no extra RAM reserved:
38
39     (3072 + 256) * 1.0526 = 3494 MiB
40
41 To run this container, the instance type must have a published RAM size of at least 3494 MiB.
42
43 h3. Calculate the maximum requestable RAM for an instance type
44
45     (Instance type RAM * (95/100)) - Keep cache - ReserveExtraRAM
46
47 For example, for a 3.75 GiB node, default Keep cache, and no extra RAM reserved:
48
49     (3840 * 0.95) - 256 = 3392 MiB
50
51 To run on this instance type, the container can request at most 3392 MiB of working RAM.