Hello,
I am kind of new to docker and and to self-hosted runners in bitbucket as well.
I am trying to access a local USB device via a self hosted pipeline runner on a local host PC.
It tried to add
-t -i --device=/dev/ttyUSB0:/dev/ttyUSB0
to the command to start the local runner on the host PC.
And I also tried to added the devices in the .yml file in bitbucket like:
image: ubuntu
devices:
- "/dev/ttyUSB0:/dev/ttyUSB0"
pipelines:
default:
- step:
name: Run unittests on local host
runs-on:
- 'self.hosted'
script:
- echo "This step will run on a self hosted runner.";
- ls /dev/
Unfortunately, I am not able to see the USB devices either way.
Is it possible to access or connect to the local USB devices?
If it is possible, how should I do it?
+1 for that!
I would really like to see this feature too!
Simply allowing the 'privileged mode' for the Docker image would resolve any issues.
This feature was already requested here: https://jira.atlassian.com/browse/BCLOUD-13420
Back then, the privileged mode was not supported, because of security reasons.
However, now that local self-hosted runners are available, it should be one's own decision to run the pipeline in privileged mode!
A common use case that requires access to local USB devices:
Development and testing of an embedded device.
Using a programmer to flash i.e. a microcontroller is almost always done through USB!
Thanks for the kind answer,
I realized in the meantime, that both ways are not working because when I start the local runner by
-t -i --device=/dev/ttyUSB0:/dev/ttyUSB0
it only starts the runner with that the usb devices however not the container which is started by the runner.
And the other way does not work because bitbucket pipeline does support that option.
I solved that issue by using ssh to access the local host pc via the pipeline container and from there I have access to the USB devices. Feels like a detour, but at least I can use the pipeline now to test the embedded device.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
+1 from me. I could really use this feature for testing embedded system
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There seems to still be no way to do this, and I would really like it to be able to use USB devices to test my embedded units.
+1 for any solution to this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Device access or even full host access (file system + device) would open an important amount of possibility for automation of test on real devices.
@Thomas Augustin how did you achieve that using SSH? You ssh from the docker to the runner host ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.