21700: Install Bundler system-wide in Rails postinst
[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 'tutorial_expectations' %}
13
14 {% include 'notebox_begin' %}
15
16 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.
17
18 {% include 'notebox_end' %}
19
20 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.
21
22 h2(#syntax). Syntax
23
24 The @arvados-client costanalyzer@ tool has a number of command line arguments:
25
26 <notextile>
27 <pre><code>~$ <span class="userinput">arvados-client costanalyzer -h</span>
28 Usage:
29   ./arvados-client costanalyzer [options ...] [UUID ...]
30
31   This program analyzes the cost of Arvados container requests and calculates
32   the total cost across all requests. At least one UUID or a timestamp range
33   must be specified.
34
35   When the '-output' option is specified, a set of CSV files with cost details
36   will be written to the provided directory. Each file is a CSV report that lists
37   all the containers used to fulfill the container request, together with the
38   machine type and cost of each container.
39
40   When supplied with the UUID of a container request, it will calculate the
41   cost of that container request and all its children.
42
43   When supplied with the UUID of a collection, it will see if there is a
44   container_request UUID in the properties of the collection, and if so, it
45   will calculate the cost of that container request and all its children.
46
47   When supplied with a project UUID or when supplied with multiple container
48   request or collection UUIDs, it will calculate the total cost for all
49   supplied UUIDs.
50
51   When supplied with a 'begin' and 'end' timestamp (format:
52   2006-01-02T15:04:05), it will calculate the cost for all top-level container
53   requests whose containers finished during the specified interval.
54
55   The total cost calculation takes container reuse into account: if a container
56   was reused between several container requests, its cost will only be counted
57   once.
58
59   Caveats:
60
61   - This program uses the cost data from config.yml at the time of the
62   execution of the container, stored in the 'node.json' file in its log
63   collection. If the cost data was not correctly configured at the time the
64   container was executed, the output from this program will be incorrect.
65
66   - If a container was run on a preemptible ("spot") instance, the cost data
67   reported by this program may be wildly inaccurate, because it does not have
68   access to the spot pricing in effect for the node then the container ran. The
69   UUID report file that is generated when the '-output' option is specified has
70   a column that indicates the preemptible state of the instance that ran the
71   container.
72
73   - This program does not take into account overhead costs like the time spent
74   starting and stopping compute nodes that run containers, the cost of the
75   permanent cloud nodes that provide the Arvados services, the cost of data
76   stored in Arvados, etc.
77
78   - When provided with a project UUID, subprojects will not be considered.
79
80   In order to get the data for the UUIDs supplied, the ARVADOS_API_HOST and
81   ARVADOS_API_TOKEN environment variables must be set.
82
83   This program prints the total dollar amount from the aggregate cost
84   accounting across all provided UUIDs on stdout.
85
86 Options:
87   -begin begin
88       timestamp begin for date range operation (format: 2006-01-02T15:04:05)
89   -cache
90       create and use a local disk cache of Arvados objects (default true)
91   -end end
92       timestamp end for date range operation (format: 2006-01-02T15:04:05)
93   -log-level level
94       logging level (debug, info, ...) (default "info")
95   -output directory
96       output directory for the CSV reports
97 </code></pre>
98 </notextile>