forked from dell/omnia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue dell#174: Prometheus slurm exporter and test framework
Signed-off-by: K <[email protected]>
- Loading branch information
Showing
18 changed files
with
474 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
roles/slurm_exporter/files/prometheus-slurm-exporter.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description = Start prometheus slurm exporter | ||
|
||
[Service] | ||
ExecStart = /usr/bin/prometheus-slurm-exporter | ||
Restart = always | ||
RestartSec = 15 | ||
|
||
[Install] | ||
WantedBy = multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: prometheus-slurmexporter-metrics-2 | ||
namespace: default | ||
annotations: | ||
prometheus.io/scrape: 'true' | ||
labels: | ||
app: prometheus | ||
app.kubernetes.io/managed-by: Helm | ||
chart: prometheus-11.12.1 | ||
component: server | ||
spec: | ||
ports: | ||
- name: metrics | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
selector: | ||
app: prometheus | ||
component: server | ||
additionalScrapeConfigs: | ||
name: prometheus-config | ||
key: prometheus-config.yaml | ||
job_name: 'prometheus-slurm-exporter' | ||
scrape_interval: 15s | ||
static_configs: | ||
- targets: | ||
- http:"{{ inventory_hostname }}":8080/metrics | ||
serviceMonitorSelector: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
|
||
- name: Apply slurm exporter configuration to prometheus | ||
command: kubectl apply -f "{{ role_path }}/files/{{ slurm_config_file }}" --validate=false | ||
changed_when: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
--- | ||
|
||
- name: Download and untar prometheus stable version | ||
unarchive: | ||
src: "{{ prometheus_git_repo }}" | ||
dest: "{{ installation_dir }}" | ||
remote_src: yes | ||
|
||
- name: Copy prometheus executable to /usr/local/bin | ||
copy: | ||
src: "{{ prometheus_exec_path }}" | ||
dest: "{{ system_local_path }}" | ||
remote_src: yes | ||
mode: "{{ file_permission }}" | ||
|
||
- name: Configure prometheus for slurm exporter | ||
blockinfile: | ||
path: "{{ prometheus_config_file }}" | ||
insertafter: EOF | ||
mode: "{{ file_permission }}" | ||
block: | | ||
# SLURM resource manager: | ||
- job_name: 'my_slurm_exporter' | ||
scrape_interval: 30s | ||
scrape_timeout: 30s | ||
static_configs: | ||
- targets: ['localhost:8080'] |
Oops, something went wrong.