Making device available to use
Summary
Making a USB device available to use, does not expose the device inside the task.
System Info
(might not be system specific)
-
Nomad version:
1.3.5
-
OS:
ubuntu 21.04
-
Architecture: arm64
The intended device is connected and seen by the OS: /dev/ttyUSB0
Details
Simple Nomad cluster with one node acting as both server and client, and another RaspberryPi acting a client only. The USB is connected to the RaspberryPi and expected to be the one allocating the task at hand.
While trying to expose a USB device within a specific task, I cannot get the device exposed within the running [docker] container. Resulting in errors like:
"could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'"
Here is what I've tried:
Scenario 1
On the agent:
plugin "usb" {
config {
enabled = true
mount_dev_nodes = true
fingerprint_period = "5s"
}
}
On the task:
device "usb" {}
This makes the plugin load and allocation to happen only on the client with the USB connected to (the RaspberryPi)
Scenario 2
On the agent:
plugin "usb" {
config {
included_vendor_ids = [0xabcd] # real vendor Id here.
included_product_ids = [0x1234] # real product Id here.
fingerprint_period = "5s"
}
}
On the task:
device "abcd/usb/1234" {}
This does not allow the allocation at all because there is no matching client: Constraint "missing devices": 2 nodes excluded by filter
Is there anything else I could try to get this working?
Thanks for this great plugin!
Mati