Hi all,
We are using LAVA to run jobs from KernelCI which is a test automation system used to test latest versions of the kernel (upstream, next, stable, ...). Our main goal is to put in our lab a maximum of boards which are not yet in KernelCI to provide boot reports for these boards. However, for some of these, we own a single copy while we definitely need to work on them to add new features or improve them.
What we could do (and what we are currently doing), is to manually put a board in maintenance mode, take it physically outside of the lab, work on it and put it back in the lab when we have finished working on it. This is not really efficient and during the time the board is physically outside of the lab, not a single job (from KernelCI or ours) can run.
We would like to create a tool to be able to remotely control our boards while they still are physically in the lab. We need to be able to do everything we could do if the board would be on our desk. This means getting the serial connection, powering on or off the board and sending files (kernel, DTB, initramfs, ...) to it. For the latter, we just have to copy the files in the directory used by the TFTP server of LAVA master node. I would like to know if it is possible to add an endpoint in the API to power on or off a given board? Is it possible to get the serial connection over the API?
To put a board virtually outside of the lab, we need to put it into maintenance mode in LAVA. As of yet, this is only possible from the browser, right? It would be great if we could add two endpoints to the API: one for putting a board offline and one for putting a board online, so we can remotely manage from our program whether a board is in the lab. We may have few people working on the same board. Therefore, we need a way to ensure only one person is able to use this board at a certain time. I've seen the "created_by" attribute in the DeviceStateTransition[1] which could help us to find who last put the board virtually outside of the lab and thus denying access to other users. However, we do not have a way to get this information today via the API. Is it possible to add an endpoint to get the status of a given device (like in 'all_devices'[2] but for one device) and the associated user responsible of the last device state transition?
I can help with patches if you agree to add these endpoints to the API.
Thanks,
Quentin
[1] https://github.com/Linaro/lava-server/blob/release/lava_scheduler_app/models... [2] https://github.com/Linaro/lava-server/blob/release/lava_scheduler_app/api.py...
Hi Quentin,
maybe you could switch the owner group of the device and use specific (non kernel-ci) groups for other activities. Might still require a new API entrypoint though.
BR, Marc.
On 15/04/2016 10:57, Quentin Schulz wrote:
Hi all,
We are using LAVA to run jobs from KernelCI which is a test automation system used to test latest versions of the kernel (upstream, next, stable, ...). Our main goal is to put in our lab a maximum of boards which are not yet in KernelCI to provide boot reports for these boards. However, for some of these, we own a single copy while we definitely need to work on them to add new features or improve them.
What we could do (and what we are currently doing), is to manually put a board in maintenance mode, take it physically outside of the lab, work on it and put it back in the lab when we have finished working on it. This is not really efficient and during the time the board is physically outside of the lab, not a single job (from KernelCI or ours) can run.
We would like to create a tool to be able to remotely control our boards while they still are physically in the lab. We need to be able to do everything we could do if the board would be on our desk. This means getting the serial connection, powering on or off the board and sending files (kernel, DTB, initramfs, ...) to it. For the latter, we just have to copy the files in the directory used by the TFTP server of LAVA master node. I would like to know if it is possible to add an endpoint in the API to power on or off a given board? Is it possible to get the serial connection over the API?
To put a board virtually outside of the lab, we need to put it into maintenance mode in LAVA. As of yet, this is only possible from the browser, right? It would be great if we could add two endpoints to the API: one for putting a board offline and one for putting a board online, so we can remotely manage from our program whether a board is in the lab. We may have few people working on the same board. Therefore, we need a way to ensure only one person is able to use this board at a certain time. I've seen the "created_by" attribute in the DeviceStateTransition[1] which could help us to find who last put the board virtually outside of the lab and thus denying access to other users. However, we do not have a way to get this information today via the API. Is it possible to add an endpoint to get the status of a given device (like in 'all_devices'[2] but for one device) and the associated user responsible of the last device state transition?
I can help with patches if you agree to add these endpoints to the API.
Thanks,
Quentin
[1] https://github.com/Linaro/lava-server/blob/release/lava_scheduler_app/models... [2] https://github.com/Linaro/lava-server/blob/release/lava_scheduler_app/api.py... _______________________________________________ Lava-users mailing list Lava-users@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lava-users
On 15 April 2016 at 09:57, Quentin Schulz quentin.schulz@free-electrons.com wrote:
Hi all,
What we could do (and what we are currently doing), is to manually put a board in maintenance mode, take it physically outside of the lab, work on it and put it back in the lab when we have finished working on it. This is not really efficient and during the time the board is physically outside of the lab, not a single job (from KernelCI or ours) can run.
We would like to create a tool to be able to remotely control our boards while they still are physically in the lab. We need to be able to do everything we could do if the board would be on our desk. This means getting the serial connection, powering on or off the board and sending files (kernel, DTB, initramfs, ...) to it. For the latter, we just have to copy the files in the directory used by the TFTP server of LAVA master node. I would like to know if it is possible to add an endpoint in the API to power on or off a given board? Is it possible to get the serial connection over the API?
There is a disconnect here. The XMLRPC API operates on the server. The device is attached to the worker - those are not necessarily the same machine or even on the same subnet. So to connect to the device, you have to have a login on the worker *after* changing the database state on the server. There is no way for XMLRPC to actually affect the device, only the database state.
Once logged in on the worker, the same commands can be used as are in the device configuration. Note: with LAVA V2, those commands will *not* exist on the worker, only in the database. The user will have to look up the connection command and power commands from the device dictionary but then the rest of the tasks on the worker are all manual anyway and the device dictionary already has XMLRPC export handlers, so this is not a barrier.
To put a board virtually outside of the lab, we need to put it into maintenance mode in LAVA. As of yet, this is only possible from the browser, right?
If exposed through XMLRPC, the authentication would have to assert that the user making the request is a django superuser or the owner of the device. Don't make the device state transition directly - use the put_into_maintenance_mode and put_into_online_mode functions.
It would be great if we could add two endpoints to the API: one for putting a board offline and one for putting a board online, so we can remotely manage from our program whether a board is in the lab. We may have few people working on the same board. Therefore, we need a way to ensure only one person is able to use this board at a certain time. I've seen the "created_by" attribute in the DeviceStateTransition[1] which could help us to find who last put the board virtually outside of the lab and thus denying access to other users. However, we do not have a way to get this information today via the API. Is it possible to add an endpoint to get the status of a given device (like in 'all_devices'[2] but for one device) and the associated user responsible of the last device state transition?
Better would be to only supply that information if the device is offline. Once online and jobs start, "last transition" is not really relevant.