An observer that fetches the job history with the "sacct" command of the Slurm workload manager and saves it in a SQLite3 database. Can be useful to integrate it in microservices which launch jobs in HPC clusters where Slurm is used as a job scheduler. The reason why it saves the records in a light database, because usually the content of the "sacct" command gets deleted periodically.
Download the corresponding binary to your system from the assets below and put it into your PATH to make it a globally available executable.
NOTE: Ensure that your system has a globally installed and available SSH and SQLITE3 client.
EXAMPLE:
mkdir -p ~/.local/bin
cp ./path/to/sacct-observer-binary ~/.local/bin/sacct-observer
chmod u+x ~/.local/bin/sacct-observer
MAKE SURE THAT "~/.local/bin" is in your PATH!
# Check your PATH variable.
echo $PATH | grep $HOME/.local/bin
# If no result printed as output, then:
echo "export PATH=\$PATH:$HOME/.local/bin" >> $HOME/.bashrc
source $HOME/.bashrc
NOTE: If you want autocomplete for your bash shell, then run the following pipe:
rm -r /tmp/sacct-observer \
&& git clone https://github.com/heloint/sacct-observer /tmp/sacct-observer \
&& cd /tmp/sacct-observer \
&& make get-autocomplete \
&& cd -
NOTE: Ensure that your system has a globally installed and available SSH and SQLITE3 client.
git clone https://github.com/heloint/sacct-observer
make build
OR use Docker to build the binary
docker build -t sacct-observer:latest . \
&& mkdir -p ./bin \
&& id=$(docker create sacct-observer:latest) \
&& docker cp $id:/app/bin/sacct-observer - > ./bin/sacct-observer \
&& docker rm -v $id
make install
make get-autocomplete
sacct-observer --username "my_remote_username" \
--remote-address "my_cluster.org" \
--output-sqlite-db "/path/to/create/my_sqlite.db" \
--update-frequency 30