Merge branch '17677-authenticate-endpoint' refs #17677
[arvados.git] / doc / user / cwl / costanalyzer.html.textile.liquid
1 ---
2 layout: default
3 navsection: userguide
4 title: Analyzing workflow cost (cloud only)
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' %}
13
14 This is only applicable when Arvados runs in a cloud environment and @arvados-dispatch-cloud@ is used to dispatch @crunch@ jobs. The per node-hour price for each defined InstanceType most be supplied in "config.yml":{{site.baseurl}}/admin/config.html.
15
16 {% include 'notebox_end' %}
17
18 The @arvados-client@ program can be used to analyze the cost of a workflow. It can be installed from packages (@apt install arvados-client@ or @yum install arvados-client@). The @arvados-client costanalyzer@ command analyzes the cost accounting information associated with Arvados container requests.
19
20 h2(#syntax). Syntax
21
22 The @arvados-client costanalyzer@ tool has a number of command line arguments:
23
24 <notextile>
25 <pre><code>~$ <span class="userinput">arvados-client costanalyzer -h</span>
26 Usage:
27   arvados-client costanalyzer [options ...] uuid [uuid ...]
28
29   This program analyzes the cost of Arvados container requests. For each uuid
30   supplied, it creates a CSV report that lists all the containers used to
31   fulfill the container request, together with the machine type and cost of
32   each container. At least one uuid must be specified.
33
34   When supplied with the uuid of a container request, it will calculate the
35   cost of that container request and all its children.
36
37   When supplied with the uuid of a collection, it will see if there is a
38   container_request uuid in the properties of the collection, and if so, it
39   will calculate the cost of that container request and all its children.
40
41   When supplied with a project uuid or when supplied with multiple container
42   request or collection uuids, it will create a CSV report for each supplied
43   uuid, as well as a CSV file with aggregate cost accounting for all supplied
44   uuids. The aggregate cost report takes container reuse into account: if a
45   container was reused between several container requests, its cost will only
46   be counted once.
47
48   Caveats:
49
50   - This program uses the cost data from config.yml at the time of the
51   execution of the container, stored in the 'node.json' file in its log
52   collection. If the cost data was not correctly configured at the time the
53   container was executed, the output from this program will be incorrect.
54
55   - If a container was run on a preemptible ("spot") instance, the cost data
56   reported by this program may be wildly inaccurate, because it does not have
57   access to the spot pricing in effect for the node then the container ran. The
58   UUID report file that is generated when the '-output' option is specified has
59   a column that indicates the preemptible state of the instance that ran the
60   container.
61
62   - This program does not take into account overhead costs like the time spent
63   starting and stopping compute nodes that run containers, the cost of the
64   permanent cloud nodes that provide the Arvados services, the cost of data
65   stored in Arvados, etc.
66
67   - When provided with a project uuid, subprojects will not be considered.
68
69   In order to get the data for the uuids supplied, the ARVADOS_API_HOST and
70   ARVADOS_API_TOKEN environment variables must be set.
71
72   This program prints the total dollar amount from the aggregate cost
73   accounting across all provided uuids on stdout.
74
75   When the '-output' option is specified, a set of CSV files with cost details
76   will be written to the provided directory.
77
78 Options:
79   -cache
80       create and use a local disk cache of Arvados objects (default true)
81   -log-level level
82       logging level (debug, info, ...) (default "info")
83   -output directory
84       output directory for the CSV reports
85 </code></pre>
86 </notextile>