Mechanical Drill is a tool to enable a hardware aware Nomad cluster by discovering hardware equipment connected to a machine. This equipment information is exposed as node metadata which can be used for a more dynamic scheduling using placement constraints.
wget https://github.com/cloudputation/mechanical-drill/releases/download/${RELEASE}/mechanical-drill -O ./drill
chmod +x ./drill
mv ./drill /usr/bin/By default, Mechanical Drill looks for a configuration file at path: /etc/mechanical-drill/config.hcl
Here is an example drill config file
// Those configuration options are reserved for a future version
log_dir = "log"
data_dir = "drill-data"
listen = "5177"
nomad_host = "127.0.0.1"
//
drill {
system {
enabled = true
frequency = 60
}
network {
enabled = true
frequency = 60
}
cpu {
enabled = true
frequency = 60
}
battery {
enabled = true
frequency = 30
}
}you can find fully configured config.hcl here
System
Battery
Bridge
Memory
Processor
Address
Storage
Disk
Tape
Bus
Network
Display
Input
Printer
Multimedia
Communication
Power
Volume
Generic
Just run the executable as is:
drillDevices are added to a list as they are collected. The first occurrence is 0 meaning it will be labeled as device0. For example: if you want to schedule a job based on the percentage of the first battery of your system then md.battery.device0.percentage will be the correct constraint to use in your Nomad job.
Fly to recharge pad:
constraint {
attribute = "${meta.md.battery.device0.percentage}"
operator = "<"
value = "30"
}Return to work:
constraint {
attribute = "${meta.md.battery.device0.state}"
value = "fully-charged"
}For now Mechanical Drill is only compatible with Linux systems
Although the classes battery and power are similar, they are different in their purpose:
battery returns the battery status and charge percentage. Possible statuses are "charging", "discharging" or "fully-charged".
power returns hardware specific information such as the manufacturer
Feel free to create an issue or propose a pull request. Follow the Code of Conduct.
