summaryrefslogtreecommitdiffstats
path: root/.gitlab-ci/generate_lava.py
blob: b2c8c296bebf2f01d77d58d366123e6b2c2afaba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python3

from jinja2 import Environment, FileSystemLoader
import argparse

device_types = {
    "sun50i-h6-pine-h64": {
        "gpu_version": "panfrost-t720",
        "boot_method": "u-boot",
        "lava_device_type": "sun50i-h6-pine-h64",
        "kernel_image_type": "type: image",
	"tags": [],
    },
    "rk3288-veyron-jaq": {
        "gpu_version": "panfrost-t760",
        "boot_method": "depthcharge",
        "lava_device_type": "rk3288-veyron-jaq",
        "kernel_image_type": "",
	"tags": [],
    },
    "rk3399-gru-kevin": {
        "gpu_version": "panfrost-t860",
        "boot_method": "depthcharge",
        "lava_device_type": "rk3399-gru-kevin",
        "kernel_image_type": "",
	"tags": [],
    },
    "sun8i-h3-libretech-all-h3-cc": {
        "gpu_version": "lima",
        "boot_method": "u-boot",
        "lava_device_type": "sun8i-h3-libretech-all-h3-cc",
        "kernel_image_type": "type: zimage",
	"tags": [],
    },
    "meson-gxl-s905x-libretech-cc": {
        "gpu_version": "lima",
        "boot_method": "u-boot",
        "lava_device_type": "meson-gxl-s905x-libretech-cc",
        "kernel_image_type": "type: image",
	"tags": [],
    },
    "meson-gxm-khadas-vim2": {
        "gpu_version": "panfrost-t820",
        "boot_method": "u-boot",
        "lava_device_type": "meson-gxm-khadas-vim2",
        "kernel_image_type": "type: image",
	"tags": ["panfrost"],
    },
}

parser = argparse.ArgumentParser()
parser.add_argument("--template")
parser.add_argument("--base-artifacts-url")
parser.add_argument("--arch")
parser.add_argument("--device-types", nargs="+")
parser.add_argument("--kernel-image-name")
args = parser.parse_args()

env = Environment(loader = FileSystemLoader('.'), trim_blocks=True, lstrip_blocks=True)
template = env.get_template(args.template)

for device_type in args.device_types:
    values = {}
    values['base_artifacts_url'] = args.base_artifacts_url
    values['arch'] = args.arch
    values['device_type'] = device_type
    values['kernel_image_name'] = args.kernel_image_name
    values['lava_device_type'] = device_types[device_type]['lava_device_type']
    values['gpu_version'] = device_types[device_type]['gpu_version']
    values['boot_method'] = device_types[device_type]['boot_method']
    values['kernel_image_type'] = device_types[device_type]['kernel_image_type']
    values['tags'] = device_types[device_type]['tags']

    f = open('results/lava-deqp-%s.yml' % device_type, "w")
    f.write(template.render(values))
    f.close()