21121: CWL supports username/pw auth
[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   prometheus_host: string
15   prometheus_apikey: string?
16   prometheus_user: string?
17   prometheus_password: string?
18
19 requirements:
20   DockerRequirement:
21     dockerPull: 'arvados/cluster-activity:2.8.0.dev20240702194009'
22
23   InitialWorkDirRequirement:
24     listing:
25       - entryname: prometheus.env
26         entry: |
27           PROMETHEUS_HOST=$(inputs.prometheus_host)
28           PROMETHEUS_APIKEY=$(inputs.prometheus_apikey)
29           PROMETHEUS_USER=$(inputs.prometheus_user)
30           PROMETHEUS_PASSWORD=$(inputs.prometheus_password)
31
32   arv:APIRequirement: {}
33
34 hints:
35   cwltool:Secrets:
36     secrets: [prometheus_apikey, prometheus_password]
37
38 arguments:
39   - arv-cluster-activity
40   - {prefix: '--prometheus-auth', valueFrom: prometheus.env}
41   - {prefix: '--days', valueFrom: $(inputs.reporting_days)}
42   - {prefix: '--html-report-file', valueFrom: report.html}
43
44 outputs:
45   report:
46     type: File
47     outputBinding:
48       glob: report.html