Discussion:
[Linaro-validation] device add issue -- lava install
Alex Shi
2017-11-02 02:46:31 UTC
Permalink
Hi All,

I am trying to add a qemu01, but can not find a correct way to add it into database. and the old command from Chase Qi is also failed.
https://validation.linaro.org/static/docs/v2/pipeline-admin.html#updating-device-dictionary
https://validation.linaro.org/static/docs/v2/first-devices.html

~# lava-server manage device-dictionary --hostname lava --import qemu01.jinja2
Unknown command: 'device-dictionary'
Type 'lava-server help' for usage.

Anyone like to tell me the correct way to go down lava setup?


Thanks
Alex
Senthil Kumaran S
2017-11-02 03:19:37 UTC
Permalink
Post by Alex Shi
I am trying to add a qemu01, but can not find a correct way to add it into database. and the old command from Chase Qi is also failed.
https://validation.linaro.org/static/docs/v2/pipeline-admin.html#updating-device-dictionary
https://validation.linaro.org/static/docs/v2/first-devices.html
~# lava-server manage device-dictionary --hostname lava --import qemu01.jinja2
Unknown command: 'device-dictionary'
Type 'lava-server help' for usage.
Yes lava-server manage device-dictionary is unavailable and the
documentation needs an update (I will do that shortly).
Post by Alex Shi
Anyone like to tell me the correct way to go down lava setup?
To add a new device use the following command:

$ sudo lava-server manage devices add --device-type lxc --description
"third lxc device" --worker "harshu.stylesen.org" lxc03

To update the device dictionary there are three ways to do the same,
which is explained in
https://staging.validation.linaro.org/static/docs/v2/pipeline-admin.html#updating-a-device-dictionary

1) Use lava-tool device-dictionary command as follows (need to add the
respective api token to use the following command):

<snip>
$ sudo lava-tool device-dictionary --update /tmp/lxc.jinja2
http://***@localhost/RPC2 lxc03
Updating device dictionary for lxc03 on http://***@localhost/RPC2

Device dictionary updated for lxc03
</snip>

Adding API token is as follows (if required):

<snip>
$ sudo lava-tool auth-add http://***@localhost/RPC2
Paste token for http://***@localhost/RPC2/:
Token added successfully for user stylesen.
</snip>

2) Copy the respective jinja2 file to
/etc/lava-server/dispatcher-config/devices/

<snip>
$ cat /etc/lava-server/dispatcher-config/devices/lxc03.jinja2
{% extends 'lxc.jinja2' %}
{% set exclusive = True %}
</snip>

3)
https://validation.linaro.org/static/docs/v2/pipeline-admin.html#using-xml-rpc

Thank You.
--
Senthil Kumaran S
http://www.stylesen.org/
http://www.sasenthilkumaran.com/
Alex Shi
2017-11-02 07:46:19 UTC
Permalink
Thanks Senthil!
Post by Senthil Kumaran S
Post by Alex Shi
I am trying to add a qemu01, but can not find a correct way to add it into database. and the old command from Chase Qi is also failed.
https://validation.linaro.org/static/docs/v2/pipeline-admin.html#updating-device-dictionary
https://validation.linaro.org/static/docs/v2/first-devices.html
~# lava-server manage device-dictionary --hostname lava --import qemu01.jinja2
Unknown command: 'device-dictionary'
Type 'lava-server help' for usage.
Yes lava-server manage device-dictionary is unavailable and the
documentation needs an update (I will do that shortly).
Post by Alex Shi
Anyone like to tell me the correct way to go down lava setup?
$ sudo lava-server manage devices add --device-type lxc --description
"third lxc device" --worker "harshu.stylesen.org" lxc03
Could the worker be same with master machine?
Post by Senthil Kumaran S
To update the device dictionary there are three ways to do the same,
which is explained in
https://staging.validation.linaro.org/static/docs/v2/pipeline-admin.html#updating-a-device-dictionary
1) Use lava-tool device-dictionary command as follows (need to add the
<snip>
$ sudo lava-tool device-dictionary --update /tmp/lxc.jinja2
Device dictionary updated for lxc03
</snip>
<snip>
Token added successfully for user stylesen.
</snip>
what the needed token for? and How I made it?

Sorry for much new info needed!
Post by Senthil Kumaran S
2) Copy the respective jinja2 file to
/etc/lava-server/dispatcher-config/devices/
<snip>
$ cat /etc/lava-server/dispatcher-config/devices/lxc03.jinja2
{% extends 'lxc.jinja2' %}
{% set exclusive = True %}
</snip>
I add a file named lxc03.jinja2 with the same contents, but how I could
know it's updated or not?

And if the devices added. How I do a smoking testing to see if lava
could work? especially to run lkft.

Thanks!
Post by Senthil Kumaran S
3)
https://validation.linaro.org/static/docs/v2/pipeline-admin.html#using-xml-rpc
Thank You.
Senthil Kumaran S
2017-11-02 08:22:42 UTC
Permalink
Post by Alex Shi
Post by Senthil Kumaran S
$ sudo lava-server manage devices add --device-type lxc --description
"third lxc device" --worker "harshu.stylesen.org" lxc03
Could the worker be same with master machine?
Yes that is what I ve did in the above example, my worker
(harshu.stylesen.org) is same as my master - this is a single node
instance. To know what are the workers available visit
http://localhost/scheduler/allworkers or use the following command:

<snip>
$ sudo lava-server manage workers list
Workers:
* harshu.stylesen.org (8 devices) (master)
</snip>
Post by Alex Shi
what the needed token for? and How I made it?
The token is the API token required in order to communicate (via
lava-tool or XMLRPC) with APIs that require authentication. The tokens
are available in http://localhost/api/tokens/ or alternatively can be
obtained via the following command:

$ sudo lava-server manage tokens list --user stylesen
Post by Alex Shi
I add a file named lxc03.jinja2 with the same contents, but how I could
know it's updated or not?
Visit this page http://localhost/scheduler/device/lxc03/devicedict to
see if it displays some values specially for hostname or alternatively
use the following command:

<snip>
$ sudo lava-server manage devices details lxc03
hostname : lxc03
device_type: lxc
status : Idle
health : Pass
health job : True
description: third lxc device
public : True
device-dict: True
worker : harshu.stylesen.org
current_job: None
$
</snip>

If the device dictionary is not updated then you would get something
like the following:

<snip>
$ sudo lava-server manage devices details lxc04
CommandError: Unable to find device 'lxc04'
$
</snip>
Post by Alex Shi
And if the devices added. How I do a smoking testing to see if lava
could work? especially to run lkft.
You can submit a job using the web UI in this URL
http://localhost/scheduler/jobsubmit or use lava-tool to submit a job as
follows:

$ lava-tool submit-job
usage: lava-tool submit-job [-h] [--publish-artifacts]
[--artifacts-url ARTIFACTS_URL]
[--artifacts-path ARTIFACTS_PATH] [--block]
SERVER JSON_FILE

Thank You.
--
Senthil Kumaran S
http://www.stylesen.org/
http://www.sasenthilkumaran.com/
Alex Shi
2017-11-02 08:52:40 UTC
Permalink
Thanks a lot Senthil,

The lxc03 and qemu01 devices were added into my lava locally. Then how I
kick a lfkt job for 2 devices? looks like I didn't create qemu instance
or lxc instance yet, do I need to made them actually?

Thanks!
Post by Senthil Kumaran S
Post by Alex Shi
And if the devices added. How I do a smoking testing to see if lava
could work? especially to run lkft.
You can submit a job using the web UI in this URL
http://localhost/scheduler/jobsubmit or use lava-tool to submit a job as
$ lava-tool submit-job
usage: lava-tool submit-job [-h] [--publish-artifacts]
[--artifacts-url ARTIFACTS_URL]
[--artifacts-path ARTIFACTS_PATH] [--block]
SERVER JSON_FILE
Senthil Kumaran S
2017-11-02 09:17:10 UTC
Permalink
Hi Alex,
Post by Alex Shi
The lxc03 and qemu01 devices were added into my lava locally. Then how I
kick a lfkt job for 2 devices? looks like I didn't create qemu instance
or lxc instance yet, do I need to made them actually?
Once the devices are in place, you can go ahead with a shell script to
call lava-tool submit-job twice once for qemu and for lxc.

Or,

Come up with a simple python script to submit multiple jobs based on the
sample given in https://staging.validation.linaro.org/api/help/

Thank You.
--
Senthil Kumaran S
http://www.stylesen.org/
http://www.sasenthilkumaran.com/
Senthil Kumaran S
2017-11-02 09:22:05 UTC
Permalink
Post by Senthil Kumaran S
Come up with a simple python script to submit multiple jobs based on the
sample given in https://staging.validation.linaro.org/api/help/
An example would be like this -
https://gist.github.com/stylesen/6bef23bf6b090249fadfb9700ba5919c

Thank You.
--
Senthil Kumaran S
http://www.stylesen.org/
http://www.sasenthilkumaran.com/
Alex Shi
2017-11-02 13:51:08 UTC
Permalink
Hi Senthil,

Thanks a lot for your great help! Now I submitted a lava job and start
run it. Thank you very much!

Regards
Alex
Post by Senthil Kumaran S
Post by Senthil Kumaran S
Come up with a simple python script to submit multiple jobs based on the
sample given in https://staging.validation.linaro.org/api/help/
An example would be like this -
https://gist.github.com/stylesen/6bef23bf6b090249fadfb9700ba5919c
Thank You.
Loading...