aws-parallelcluster-monitoring icon indicating copy to clipboard operation
aws-parallelcluster-monitoring copied to clipboard

Build not working if missing a git config

Open afalzonelab opened this issue 1 year ago • 3 comments

Hi, building prometheus-slurm-exporter binary I found this error at head node post-install:

 cd /home/ec2-user/aws-parallelcluster-monitoring/prometheus-slurm-exporter; git status --porcelain
fatal: detected dubious ownership in repository at '/home/ec2-user/aws-parallelcluster-monitoring/prometheus-slurm-exporter'
To add an exception for this directory, call:

        git config --global --add safe.directory /home/ec2-user/aws-parallelcluster-monitoring/prometheus-slurm-exporter
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
make: *** [bin/prometheus-slurm-exporter] Error 1

Testing manually, I solved with the fix following:

--- install-monitoring.sh.orig  2024-03-28 11:51:28.513604048 +0000
+++ install-monitoring.sh       2024-03-28 11:39:43.415747930 +0000
@@ -89,6 +89,7 @@
                # More info here: https://github.com/vpenso/prometheus-slurm-exporter/blob/master/LICENSE
                cd ${monitoring_home}
                git clone https://github.com/vpenso/prometheus-slurm-exporter.git
+                git config --global --add safe.directory ${monitoring_home}/prometheus-slurm-exporter
                sed -i 's/NodeList,AllocMem,Memory,CPUsState,StateLong/NodeList: ,AllocMem: ,Memory: ,CPUsState: ,StateLong:/' prometheus-slurm-exporter/node.go
                cd prometheus-slurm-exporter
                GOPATH=/root/go-modules-cache HOME=/root go mod download

Please, could you fix the on repo?

Thanks, Alberto

afalzonelab avatar Mar 28 '24 11:03 afalzonelab

Hi @afalzonelab , can you please send a pull request? Thanks

nicolaven avatar Mar 29 '24 10:03 nicolaven