Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.47 KB

DEVELOPMENT.md

File metadata and controls

59 lines (43 loc) · 1.47 KB

Setup the development environment on a node with access to the Slurm user command-line interface, in particular with the sinfo, squeue, and sdiag commands.

Install Go from source

export VERSION=1.15 OS=linux ARCH=amd64
wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz
tar -xzvf go$VERSION.$OS-$ARCH.tar.gz
export PATH=$PWD/go/bin:$PATH

Alternatively install Go using the packaging system of your Linux distribution.

Use Git to clone the source code of the exporter, and download all Go dependency modules:

# clone the source code
git clone https://github.com/vpenso/prometheus-slurm-exporter.git
cd prometheus-slurm-exporter
# download dependencies
export GOPATH=$PWD/go/modules
go mod download

Build

Build the exporter:

go build -o bin/prometheus-slurm-exporter {main,accounts,cpus,nodes,partitions,queue,scheduler,users}.go

Run all tests included in _test.go files:

go test -v *.go

Start the exporter (foreground), and query all metrics:

bin/prometheus-slurm-exporter
...
# query all metrics (default port)
curl http://localhost:8080/metrics

Development

References: