NixOS configuration for HPC cluster
https://docs.hpc.informatik.hs-fulda.de/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
571 B
26 lines
571 B
#!/usr/bin/env bash
|
|
|
|
# Get all nodes with deployment data
|
|
NODES="$(colmena eval -E '
|
|
{nodes, lib, ...}:
|
|
with lib;
|
|
|
|
mapAttrs
|
|
(_: node: with node.config.deployment; "${targetUser}@${targetHost}")
|
|
nodes
|
|
')"
|
|
|
|
# Filter to single node if parameter is set
|
|
if [[ "$1" != "" ]]; then
|
|
NODES="$(jq "{ \"$1\" }" <<< "$NODES")"
|
|
fi
|
|
|
|
# Convert nodes to array of <user>@<host>
|
|
mapfile -t NODES < <(jq -r '.[]' <<< "$NODES")
|
|
|
|
for NODE in "${NODES[@]}"; do
|
|
echo "-- ${NODE} --"
|
|
ssh "${NODE}" "/run/gather" \
|
|
| tar xv --dereference --directory "." \
|
|
|| true
|
|
done
|