Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Handlers/argParseHandler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause-Clear

import argparse
import logging

Expand Down
3 changes: 3 additions & 0 deletions Handlers/dataHandler.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions Handlers/templateHandler.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
31 changes: 31 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

3 changes: 3 additions & 0 deletions data_validation/validate_data.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions lava_Job_definition_generator.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/boot/fastboot.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions templates/overlays/baseline.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
3 changes: 3 additions & 0 deletions utils/filter_files.py
Original file line number Diff line number Diff line change
@@ -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 = []

Expand Down
3 changes: 3 additions & 0 deletions utils/generate_url_with_optional_node_id.py
Original file line number Diff line number Diff line change
@@ -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/"
Expand Down
3 changes: 3 additions & 0 deletions utils/path_url_identifier.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down