config.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. version: 2.1
  2. executors:
  3. hardware-array:
  4. machine:
  5. resource_class: exo/hardware
  6. jobs:
  7. check_chip:
  8. executor: hardware-array
  9. parameters:
  10. target_chip:
  11. type: string
  12. description: "The Apple chip to check for (e.g., M1, M2, M3)"
  13. steps:
  14. - checkout
  15. - run:
  16. name: Check for << parameters.target_chip >> Chip
  17. command: |
  18. # Retrieve the chip information
  19. CHIP=$(sysctl -n machdep.cpu.brand_string | grep -o "M[1-4]" || echo "Unknown")
  20. # Display machine details
  21. echo "=== Machine Details ==="
  22. echo "Hostname: $(hostname)"
  23. echo "IP Address: $(ifconfig | grep 'inet ' | grep -v 127.0.0.1 | awk '{print $2}')"
  24. echo "Chip: $CHIP"
  25. echo "========================"
  26. # Check if the machine has the target chip
  27. if [[ "$CHIP" == "<< parameters.target_chip >>" ]]; then
  28. echo "✅ Runner has the << parameters.target_chip >> chip."
  29. else
  30. # Exit silently without error
  31. exit 0
  32. fi
  33. workflows:
  34. benchmark:
  35. jobs:
  36. - check_chip:
  37. name: "Check Chip M1"
  38. target_chip: "M1"
  39. - check_chip:
  40. name: "Check Chip M2"
  41. target_chip: "M2"
  42. - check_chip:
  43. name: "Check Chip M4"
  44. target_chip: "M4"