I would like to understand how people are managing (physical) resource locking mechanism ? Use case; we have multiple DUT’s/resources and we want to pick suitable free one(s) for tests. Each DUT/resources has different set of capabilities/properties that is used when selecting device. If device is not available right now we want to wait for some awhile before giving up to avoid test job failures. Also “no free devices” is accepted job failure reason - it’s signal that there is not enough resources in pool.
Do we have some integrated mechanism like Jenkins lockable-resources or plugins for this? Note that we are using distributed CI, so e.g. in-memory state is not enough. for example multiple robot instances are running parallel and utilise resources from same pool.
I’ve planning to implement own local/remote-keyword plugin that manage this generally, but would like to hear first another options.
Depends really on the use-case. If you have one DUT per slave, that would be really the easiest way. But if you have a farm of DUT’s and farm of build slaves, you probably need to implement something by yourself to some point in your pipeline.
In galaxy far far away, we had a setup where DUT’s had messagequeue and they knew their own state and could advertise that state via message queue (it was with rabbitmq). Then during the test setup, the testcode send “Gimme a free device” and and then there was a hanshake between (still over rabbitmq) that hey, im testslave, i’ll use you for a while and test setup passed down the ip of the testdevice to actual testsuites and after the testrun was done, one more message was sent to DUT that im now done[1]
Similar approach could be quite easily implemented without message queues thought … Just have centralized backend where all you can query for free DUT’s, once you get a free one, mark it as locked and pass the required identifier to tests as variable and then ensure that your test pipeline will free the device after the testrun …
[1] https://github.com/mer-tools/testrunner-lite - was the tool used to do that, however, when testrunner-lite was opensourced, rabbit-mq side was not included in the drop - mainly because it was using in-house implementation. However, the integration point is there and afaik, its compatible with amqp)
I’ve used similar (or even same) tools during Nokia times years ago, and after that. Unfortunately mostly those have been developed as company internal projects. In current project I try to avoid developing internal tools and create solution using open source parts, which scale easily.
We’ve multiple of devices connected to same machine. Robot is running in separate machines and we are using GitHub self-hosted runner as high level executors. This design makes easy to scale even more. I’ve long term plans how to solve issue but I would like to find out simplest solution to go forward now. Is it really true that there is nothing similar with ”Jenkins Lockable resources” but for Robot? Maybe I should do it by myself and publish it