Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add slurm prometheus exporter to snapcraft.yaml recipe #9

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ extend-exclude = ["__pycache__", "*.egg_info"]
per-file-ignores = {"tests/*" = ["D100","D101","D102","D103","D104"]}

[tool.ruff.mccabe]
max-complexity = 10
max-complexity = 15

62 changes: 20 additions & 42 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ environment:
# the necessary dependencies packaged in `site-packages`.
# yamllint disable-line rule:line-length
PATH: $SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$SNAP/usr/local/bin:$SNAP/usr/local/sbin:$PATH
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf

apps:
logrotate:
Expand Down Expand Up @@ -75,91 +76,56 @@ apps:
daemon: simple
install-mode: disable
after: [munged]
slurm-prometheus-exporter:
command: bin/prometheus-slurm-exporter
daemon: simple
install-mode: disable
after: [munged]
restart-condition: always
restart-delay: 15s

sacct:
command: bin/sacct
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sacctmgr:
command: bin/sacctmgr
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
salloc:
command: bin/salloc
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sattach:
command: bin/sattach
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sbatch:
command: bin/sbatch
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sbcast:
command: bin/sbcast
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
scancel:
command: bin/scancel
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
scontrol:
command: bin/scontrol
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
scrontab:
command: bin/scrontab
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
scrun:
command: bin/scrun
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sdiag:
command: bin/sdiag
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sh5util:
command: bin/sh5util
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sinfo:
command: bin/sinfo
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sprio:
command: bin/sprio
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
squeue:
command: bin/squeue
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sreport:
command: bin/sreport
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
srun:
command: bin/srun
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sshare:
command: bin/sshare
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sstat:
command: bin/sstat
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
strigger:
command: bin/strigger
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf
sview:
command: bin/sview
environment:
SLURM_CONF: $SNAP_COMMON/etc/slurm/slurm.conf

parts:
overlay:
Expand Down Expand Up @@ -296,3 +262,15 @@ parts:
- --with-freeipmi
- --with-ofed
- --with-pmix

slurm-prometheus-exporter:
after: [slurm]
source: "https://github.com/rivosinc/prometheus-slurm-exporter.git"
source-tag: "v1.4.1"
plugin: go
build-environment:
- CPATH: ${CRAFT_STAGE}/include
build-packages:
- swig
build-snaps:
- go/1.22/stable