diff --git a/Handlers/argParseHandler.py b/Handlers/argParseHandler.py index e4b1e6f..14266b4 100644 --- a/Handlers/argParseHandler.py +++ b/Handlers/argParseHandler.py @@ -1,3 +1,6 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + import argparse import logging diff --git a/Handlers/dataHandler.py b/Handlers/dataHandler.py index cfe9833..2e2294d 100644 --- a/Handlers/dataHandler.py +++ b/Handlers/dataHandler.py @@ -1,3 +1,6 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + import requests from utils.generate_url_with_optional_node_id import build_url from utils.filter_files import filter_data diff --git a/Handlers/templateHandler.py b/Handlers/templateHandler.py index 204cc53..da2fb6e 100644 --- a/Handlers/templateHandler.py +++ b/Handlers/templateHandler.py @@ -1,3 +1,6 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + from jinja2 import Environment, FileSystemLoader, TemplateNotFound, Template import yaml, requests import logging diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1960941 --- /dev/null +++ b/LICENSE @@ -0,0 +1,31 @@ +Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + +Redistribution and use in source and binary forms, with or without +modification, are permitted (subject to the limitations in the +disclaimer below) provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Qualcomm Technologies, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE +GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT +HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0402e6a --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# Job Render + +This Python script is designed to generate job definitions for LAVA (Linaro Automated Validation Architecture) jobs. +It leverages the Jinja Templating engine to dynamically inject data into templates, creating customized job definitions. + +# Branches + +**main:** Primary development branch. Contributors should develop submissions based on this branch, and submit pull requests to this branch. + +# Requirements + +Install python3 in your system + - use command `python --version` to ensure the proper installation of python in your system. + +# Installation Instructions + +Clone the Repository: +``` +git clone https://github.com/qualcomm-linux/job_render.git +cd job_render +``` +# Usage + +- Set environment variables (BOOT_METHOD, TARGET, TARGET_DTB) in your shell before running the script using the export command. +Example: +``` +export BOOT_METHOD="fastboot" +export TARGET="qcs6490" +export TARGET_DTB="qcs6490-rb3gen2" +``` +- To run the script use command. `python3 lava_Job_definition_generator.py --localjson "path_to_json_file"` + +# License + +job_render is licensed under the [*BSD-3-clause-clear License*](https://spdx.org/licenses/BSD-3-Clause-Clear.html). See [*LICENSE*](https://github.com/qualcomm-linux/job_render/blob/main/LICENSE) for the full license text. + diff --git a/data_validation/validate_data.py b/data_validation/validate_data.py index f169e15..1c183b1 100644 --- a/data_validation/validate_data.py +++ b/data_validation/validate_data.py @@ -1,3 +1,6 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + import sys # Allowed boot methods diff --git a/lava_Job_definition_generator.py b/lava_Job_definition_generator.py index c257b56..2183180 100644 --- a/lava_Job_definition_generator.py +++ b/lava_Job_definition_generator.py @@ -1,3 +1,6 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + #this is the file to generate job definition from data_validation.validate_data import Validator from Handlers.templateHandler import TemplateHandler diff --git a/templates/boot/fastboot.jinja2 b/templates/boot/fastboot.jinja2 index 8ec7f57..0d8b469 100644 --- a/templates/boot/fastboot.jinja2 +++ b/templates/boot/fastboot.jinja2 @@ -5,7 +5,7 @@ dtb: url: '{{ node.artifacts.dtb }}' ramdisk: - url: 'http://storage.kernelci.org/images/rootfs/buildroot/buildroot-baseline/20230703.0/{{ brarch }}/rootfs.cpio.gz' + url: '{{ node.artifacts.ramdisk }}' compression: gz format: cpio.newc overlays: diff --git a/templates/overlays/baseline.jinja2 b/templates/overlays/baseline.jinja2 index d82ac13..7d8e937 100644 --- a/templates/overlays/baseline.jinja2 +++ b/templates/overlays/baseline.jinja2 @@ -11,4 +11,9 @@ kselftest: format: tar path: /kselftest url: {{ node.artifacts.kselftest_tar_gz }} +firmware: + compression: gz + format: tar + path: / + url: {{ node.artifacts.firmware }} {%- endblock -%} \ No newline at end of file diff --git a/utils/filter_files.py b/utils/filter_files.py index facdb85..2d1be40 100644 --- a/utils/filter_files.py +++ b/utils/filter_files.py @@ -1,3 +1,6 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + def filter_data(data, data_type=None, folder_name=None): results = [] diff --git a/utils/generate_url_with_optional_node_id.py b/utils/generate_url_with_optional_node_id.py index ab76cb1..3ee1f0a 100644 --- a/utils/generate_url_with_optional_node_id.py +++ b/utils/generate_url_with_optional_node_id.py @@ -1,3 +1,6 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + from urllib.parse import urlunparse, urlparse base_url = "https://kernelci-api.westus3.cloudapp.azure.com/latest/" diff --git a/utils/path_url_identifier.py b/utils/path_url_identifier.py index aa90e77..b5af81f 100644 --- a/utils/path_url_identifier.py +++ b/utils/path_url_identifier.py @@ -1,3 +1,6 @@ +# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. +# SPDX-License-Identifier: BSD-3-Clause-Clear + import os from urllib.parse import urlparse