-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding env variables that can be used by systemd config * Adding rpmbuild in travis
- Loading branch information
1 parent
1d04870
commit 789eed2
Showing
6 changed files
with
107 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
language: python | ||
sudo: false | ||
sudo: required | ||
cache: pip | ||
python: | ||
- '3.6' | ||
fail_fast: true | ||
env: | ||
global: | ||
- DOCKER_IMAGE=alectolytic/rpmbuilder | ||
- OS_ARCH=x86_64 | ||
matrix: | ||
- OS_TYPE=centos OS_DIST=epel OS_VERSION=7 | ||
services: | ||
- docker | ||
install: true | ||
before_install: | ||
- pip install flake8 | ||
install: "pip install -r requirements.txt" | ||
- pip install flake8 | ||
script: | ||
- flake8 infiniband-exporter.py | ||
- flake8 infiniband-exporter.py | ||
- docker run -v ${PWD}:/sources -v ${PWD}:/output:Z ${DOCKER_IMAGE}:${OS_TYPE}-${OS_VERSION} | ||
deploy: | ||
provider: releases | ||
api_key: | ||
secure: nMgeXt/NZ1Rj2DUx2hcr48TGr+d8rFCVBhb1j8RQRYqArV3MRGRhNYHjel5ncJqLPBjXx4wZmd6++zw4dzmIm9BjcGugM/7bntCs2hrwTRMkX9xZt1EXzuM/pPnSd8808buyDBAeR4jfTJmZBTJ+Ht7zc8tWAqT6AFWlT4J/l/OPHlVxVkt7uF3aUCDiNvMuBRx83vrDeogbOBwZl+A7SwZq8i5caTYEjyahoQk/QuGnqjoiSUqVSWQntATkWxzKosCQm9UDIEFak+OYkrBA7OqtRyz+ssE3cyE4bL6uoXEOI7iZ1l4YPoVFi+/w+MJE8GDL8VH6uz5MgRiuOYYHE5DaAYru0vlwB0HFklj9TnUbifwUgBi1wbBTvL4vEjLAiCTPyhdqf6iw7sUQOxDCk1SiNUkGX/NvMqoTvK4EQASzdekV8bQ11jAb3GTuC9vP0fm4g1L9nwpLatLTss5Cf//Z+1FoYInj1SzOR1TTjVDHRG+kFqFb7C2IIF6r6m6Hp6S5DvMzefXaR12ZovcY7JI/bJ4hTQoPZMwfY+M+8ufAfWnEw4duWbKeRmps6ENCuofGySK8srfXDlQy7lNcMZt75OuyNdn9kmPPlmMCCNx78UvCqxrO+IzNc8moRqSzvhLjRVS9Lffjk3+NI2NH3+m0+DX0jnZcXGughRyX+vc= | ||
file: "*.rpm" | ||
draft: true | ||
file_glob: true | ||
skip_cleanup: true | ||
on: | ||
tags: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Name: infiniband-exporter | ||
Version: 0.0.1 | ||
%global gittag 0.0.1 | ||
Release: 1%{?dist} | ||
Summary: Prometheus exporter for a Infiniband Fabric | ||
|
||
License: Apache License 2.0 | ||
URL: https://github.com/guilbaults/infiniband-exporter | ||
Source0: https://github.com/guilbaults/%{name}/archive/v%{gittag}/%{name}-%{version}.tar.gz | ||
|
||
BuildArch: noarch | ||
BuildRequires: systemd | ||
Requires: python2-prometheus_client | ||
Requires: infiniband-diags | ||
|
||
%description | ||
Prometheus exporter for a Infiniband fabric. This exporter only need to be installed on one server connected to the fabric, it will collect all the ports statistics on all the switches. | ||
|
||
Metrics are identified by type, port number, switch GUID and name. The remote connection of each port is also collected. Thus each metric represents a cable between 2 switches, or between a switch and a card in a server. | ||
|
||
When a node name map file is provided, it will be used by ibquerryerror to put a more human friendly name on switches. | ||
|
||
This exporter takes 3 seconds to collect the information of 60+ IB switches, and 900+ compute nodes. The information takes about 7.5MB in ASCII format for that fabric. | ||
|
||
%prep | ||
%autosetup -n %{name}-%{gittag} | ||
%setup -q | ||
|
||
%build | ||
|
||
%install | ||
mkdir -p %{buildroot}/%{_bindir} | ||
mkdir -p %{buildroot}/%{_unitdir} | ||
|
||
sed -i -e '1i#!/usr/bin/python' infiniband-exporter.py | ||
install -m 0755 %{name}.py %{buildroot}/%{_bindir}/%{name} | ||
install -m 0644 infiniband-exporter.service %{buildroot}/%{_unitdir}/infiniband-exporter.service | ||
|
||
%clean | ||
rm -rf $RPM_BUILD_ROOT | ||
|
||
%files | ||
%{_bindir}/%{name} | ||
%{_unitdir}/infiniband-exporter.service | ||
|
||
%changelog | ||
* Fri Mar 20 2020 Simon Guilbault <[email protected]> 0.0.1-1 | ||
- Initial release |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Infiniband-exporter | ||
After=network.target | ||
|
||
[Service] | ||
Type=simple | ||
EnvironmentFile=-/etc/sysconfig/infiniband-exporter.conf | ||
ExecStart=/usr/bin/infiniband-exporter | ||
PIDFile=/var/run/infiniband-exporter.pid | ||
KillMode=process | ||
|
||
[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,3 @@ | ||
#!/bin/bash | ||
spectool -g -R infiniband-exporter-el7.spec | ||
rpmbuild --define "dist .el7" -ba infiniband-exporter-el7.spec |