22317: Get compute node settings from cluster configuration
[arvados.git] / tools / cluster-activity / cluster-activity.cwl
1 #!/usr/bin/env cwl-runner
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 cwlVersion: v1.2
7 class: CommandLineTool
8 $namespaces:
9   arv: "http://arvados.org/cwl#"
10   cwltool: "http://commonwl.org/cwltool#"
11
12 inputs:
13   reporting_days: int?
14   reporting_start: string?
15   reporting_end: string?
16   prometheus_host: string
17   prometheus_apikey: string?
18   prometheus_user: string?
19   prometheus_password: string?
20   exclude: string?
21   include_workflow_steps: boolean?
22
23 requirements:
24   DockerRequirement:
25     dockerPull: 'arvados/cluster-activity'
26
27   InitialWorkDirRequirement:
28     listing:
29       - entryname: prometheus.env
30         entry: |
31           PROMETHEUS_HOST=$(inputs.prometheus_host)
32           PROMETHEUS_APIKEY=$(inputs.prometheus_apikey)
33           PROMETHEUS_USER=$(inputs.prometheus_user)
34           PROMETHEUS_PASSWORD=$(inputs.prometheus_password)
35
36   arv:APIRequirement: {}
37
38   ResourceRequirement:
39     ramMin: 768
40
41   EnvVarRequirement:
42     envDef:
43       REQUESTS_CA_BUNDLE: /etc/arvados/ca-certificates.crt
44
45 hints:
46   cwltool:Secrets:
47     secrets: [prometheus_apikey, prometheus_password]
48
49 arguments:
50   - arv-cluster-activity
51   - {prefix: '--prometheus-auth', valueFrom: prometheus.env}
52   - {prefix: '--days', valueFrom: $(inputs.reporting_days)}
53   - {prefix: '--start', valueFrom: $(inputs.reporting_start)}
54   - {prefix: '--end', valueFrom: $(inputs.reporting_end)}
55   - {prefix: '--exclude', valueFrom: $(inputs.exclude)}
56   - {prefix: '--html-report-file', valueFrom: report.html}
57   - {prefix: '--cost-report-file', valueFrom: cost.csv}
58   - {prefix: '--include-workflow-steps', valueFrom: $(inputs.include_workflow_steps)}
59
60 outputs:
61   report:
62     type: File
63     outputBinding:
64       glob: report.html