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

  1. #!/usr/bin/env bash
  2. # Get all nodes with deployment data
  3. NODES="$(colmena eval -E '
  4. {nodes, lib, ...}:
  5. with lib;
  6. mapAttrs
  7. (_: node: with node.config.deployment; "${targetUser}@${targetHost}")
  8. nodes
  9. ')"
  10. # Filter to single node if parameter is set
  11. if [[ "$1" != "" ]]; then
  12. NODES="$(jq "{ \"$1\" }" <<< "$NODES")"
  13. fi
  14. # Convert nodes to array of <user>@<host>
  15. mapfile -t NODES < <(jq -r '.[]' <<< "$NODES")
  16. for NODE in "${NODES[@]}"; do
  17. echo "-- ${NODE} --"
  18. ssh "${NODE}" "/run/gather" \
  19. | tar xv --dereference --directory "." \
  20. || true
  21. done