aboutsummaryrefslogtreecommitdiff
path: root/lava-v2-submit-jobs.py
AgeCommit message (Collapse)Author
2019-06-28Find LAVA devices by aliases, when availableDan Rue
In addition to looking up available device_types in each lava instance, also look for aliases. Create a new lookup function, get_device_type_by_name(), to simplify the lookup. Provide 6 unit tests for the new function. Example run: ./lava-v2-submit-jobs.py --username dan.rue --token='XXX' --lab lab-linaro-lkft --jobs foo Loading jobs from foo LAVA API: https://lkft.validation.linaro.org/RPC2/ Connecting to Server... Connection Successful! connect-to-server : pass Fetching all devices from LAVA Fetching all device-types from LAVA Fetching all device-type aliases from LAVA Submitting Jobs to Server... Submitting job kernelci-staging.kernelci.org-v5.2-rc5-178-gdac6ebf0e111-arm-multi_v7_defconfig-gcc-8-no-dtb-qemu-boot to device-type qemu Submitting job arm-soc-for-next-v5.2-rc5-110-ge57f4f2c4506-arm-multi_v7_defconfig-gcc-8-am57xx-beagle-x15.dtb-am57xx-beagle-x15-simple to device-type am57xx-beagle-x15 Submitting job lkft-ltp-quickhit-master-1894 to device-type x15 Signed-off-by: Dan Rue <dan.rue@linaro.org>
2018-02-19lava-v2-submit-jobs.py: return error if no jobs to submitGuillaume Tucker
Having no job to submit should be treated as an error and reported to the caller which can then decide how to handle the situation. The expectation is that this script will be called when some jobs are supposed to be run. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
2018-02-13Add LKFT lab, remove boot-be planMatt Hart
- Support tree#branch boot whitelisting for LKFT lab
2018-01-16lava-v2-submit-jobs.py: remove default value for --submittedGuillaume Tucker
In the general case when jobs are submitted and do not need to be tracked with a JSON file, the --submitted option is not used. So remove the default value as otherwise it is always defined. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
2018-01-16lava-v2-submit-jobs.py: fix error handlingGuillaume Tucker
Fix propagation of errors and set the exit code accordingly. If any job failed to be submitted then an error is reported (return code 1). If no jobs were found to be submitted, no error is reported. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
2018-01-16lava-v2-submit-jobs.py: remove --server option and use labs.iniGuillaume Tucker
Remove the --server option and add the LAVA API URLs to labs.ini instead. The --lab option is already telling the script which lab to use, it now looks up the API URL from the file. Note: This is especially useful for bisection jobs as the URL is not available of the boot data, only the lab name is. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
2018-01-16lava-v2-submit-jobs.py: add --submitted and --lab to save submitted jobsGuillaume Tucker
This is to let another script know about the LAVA v2 jobs in progress. * add --submitted option to provide a path where to save a JSON file with the LAVA job numbers and KernelCI job names * keep LAVA job number (job_id) in SUBMITTED to then save them in the output JSON file * add --lab option to provide the name of the LAVA lab where the jobs were submitted and store it as well in the output JSON file, along with the start time Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
2017-06-27lava-v2-submit-jobs.py: use yaml.safe_load instead of yaml.loadGuillaume Tucker
Use yaml.safe_load to avoid potential security issues, as documented: http://pyyaml.org/wiki/PyYAMLDocumentation#LoadingYAML Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
2017-06-27Add LGPL v2.1+ headers in Python scripts and full license in COPYINGGuillaume Tucker
Update all the Python scripts with a header listing the shared copyrights, authors and a notice to distribute the code under LGPL v2.1 or later. Also add the full license text in COPYING. Note: Some scripts were already in GPLv2 so they remain untouched. Also, log2html.py is a temporary local copy - see lava-report.py. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
2017-06-22KernelCI staging 20170621 (#91)Guillaume Tucker
* lava-v2-jobs-from-api.py: enable 'api' and 'storage' in the config file * allow the "api" and "storage" configs to be read from the config file, the command line options still have the priority * remove the defaults for "api" and "storage" as it's better to have them defined explicitly by the caller * fix help message for the --config and --section options Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> * Add jenkins scripts for lava boots * Use STORAGE and API from environment for lava-boot-v1 * Add --callback and --lab options to v2 job creator to add the notify block In lava-v2-jobs-from-api.py: * add --callback option to enable a callback in the LAVA job * add --lab option to provide the lab name * use the lab name as a default value for --jobs when not provided * check that required options are provided In lava-v2-submit.py: * remove --timeout when submitting jobs * make --jobs a required option In lava-boot-v2.sh: * add --lab options in lava-boot-v2.sh when calling lava-v2-jobs-from-api.py * lib: import device_map directly into lib This is to make importing the device map less confusing. Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> * lava-v2-submit-jobs: minor code clean-up * add --section option, used when reading the LAVA config file * rename job_map as JOBS to make it clear it's a module-wide object * wrap long lines and clean up command line help messages Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com> * lava-v2-jobs-from-api.py: improve print message with number of builds Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
2017-03-27Only connect to LAVA if there are jobs to submitMatt Hart
2017-01-05Fix the v2 submit script from submitting pipeline jobs to labsMatt Hart
that had matching device-types but no pipeline devices
2017-01-05Fixup some template inheritance and add yet more uboot devices (#67)Matt Hart
2016-11-14LAVA V2 Initial Job SupportMatt Hart
Job creation and submission is now working. There will need to be *lots* of templates added in future but this gets us started. Results are not being recorded yet but there is an example config/script to show how this can be done. lava-v2-jobs-from-api.py: generates LAVA v2 jobs by making requests to the KCI API. lava-v2-submit-jobs.py: Submits LAVA v2 jobs to a lab if a pipeline device exists that matches the requested device_type. reactobus-kernel-ci-config.yaml: Configuration for reactobus (https://github.com/ivoire/ReactOBus) which will be the daemon waiting for ZMQ notifications that the job has completed reactobus-job-parser.py: Basic beginnings of a script which is executed by reactobus, to parse the ZMQ response and eventually update the KCI API with the result. Add some initial templates for qemu/apq8016-sbc devices.