aboutsummaryrefslogtreecommitdiffstats
path: root/templates/base
diff options
context:
space:
mode:
authorKevin Hilman <khilman@baylibre.com>2017-08-22 16:07:47 -0700
committerKevin Hilman <khilman@baylibre.com>2017-09-01 15:52:07 -0700
commit05146fa425d94a77ba35b43ac3b0a5c633163d4e (patch)
tree1d68bd51a1dfe8cc6c5e19fe517dbb19f3b67725 /templates/base
parent263fa00cd42334c69897ebad72fcd9d6acd89aeb (diff)
initial snapshot: LAVA job creation based on templates
Change-Id: I5d545d3531f4c4190453724738076bd4eddfc4d6 Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Loys Ollivier <lollivier@baylibre.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Diffstat (limited to 'templates/base')
-rw-r--r--templates/base/agl-base-defaults.jinja240
-rw-r--r--templates/base/agl-base.jinja236
-rw-r--r--templates/base/agl-simple.jinja27
3 files changed, 83 insertions, 0 deletions
diff --git a/templates/base/agl-base-defaults.jinja2 b/templates/base/agl-base-defaults.jinja2
new file mode 100644
index 0000000..ff70116
--- /dev/null
+++ b/templates/base/agl-base-defaults.jinja2
@@ -0,0 +1,40 @@
+{%- macro baseurl(object) -%}
+{{ urlbase }}/{{ dl_dir }}/{{ object }}
+{%- endmacro %}
+{%- set dl_dir = dl_dir|default(yocto_machine) %}
+{%- set boot_timeout = boot_timeout|default(10) %}
+{%- set job_timeout = job_timeout|default(30) %}
+{%- set action_timeout = action_timeout|default(15) %}
+{%- set connection_timeout = connection_timeout|default(5) %}
+{%- set deploy_timeout = deploy_timeout|default(15) %}
+{%- set device_type = device_type|default(yocto_machine+"-uboot") %}
+{%- set kernel_image = kernel_image|default('uImage') %}
+{%- set kernel_url = kernel_url|default(baseurl(kernel_image)) %}
+{%- if dtb %}
+{%- set dtb_url = dtb_url|default(baseurl(dtb)) %}
+{%- endif %}
+{%- if modules %}
+{%- set modules_url = modules_url|default(baseurl(modules)) %}
+{%- set modules_compression = modules_compression|default(modules|get_extension) %}
+{%- endif %}
+{%- if rootfs_type == 'nbd' %}
+{%- set deploy_to = "nbd" %}
+{%- set boot_commands = "nbd" %}
+{%- set nbdroot = nbdroot|default("core-image-minimal-" + yocto_machine + ".ext4.xz") %}
+{%- set nbdroot_url = nbdroot_url|default(baseurl(nbdroot)) %}
+{%- set nbdroot_compression = nbdroot_compression|default(nbdroot|get_extension) %}
+{%- set nbdinitrd = nbdinitrd|default("initramfs-netboot-image-" + yocto_machine +".ext4.gz") %}
+{%- set nbdinitrd_url = nbdinitrd_url|default(baseurl(nbdinitrd)) %}
+{%- elif rootfs_type == 'nfs' %}
+{%- set nfsrootfs = nfsrootfs|default("nfsrootfs-" + yocto_machine + ".tar.gz") %}
+{%- set nfsrootfs_url = nfsrootfs_url|default(baseurl(nfsrootfs)) %}
+{%- set nfsroot_compression = nfsroot_compression|default(nfsrootfs|get_extension) %}
+{%- elif rootfs_type == 'ramdisk' %}
+{%- set initrd = initrd|default("initramfs-boot-image-" + yocto_machine +".gz") %}
+{%- set initrd_compression = initrd_compression|default(initrd|get_extension) %}
+{%- endif %}
+{%- if initrd %}
+{%- set initrd_url = initrd_url|default(baseurl(initrd)) %}
+{%- endif %}
+{%- block job %}
+{%- endblock %}
diff --git a/templates/base/agl-base.jinja2 b/templates/base/agl-base.jinja2
new file mode 100644
index 0000000..1119aaa
--- /dev/null
+++ b/templates/base/agl-base.jinja2
@@ -0,0 +1,36 @@
+{%- extends 'base/agl-base-defaults.jinja2' %}
+{%- block job %}
+{%- block metadata %}
+metadata:
+ image.type: 'AGL'
+{% endblock %}
+{%- block main %}
+device_type: {{ device_type }}
+job_name: {{ name }}
+
+timeouts:
+ job:
+ minutes: {{ job_timeout }}
+ action:
+ minutes: {{ action_timeout }}
+ connection:
+ minutes: {{ connection_timeout }}
+priority: {{ priority }}
+visibility: public
+{% endblock %}
+{%- block actions %}
+actions:
+{%- block deploy %}
+- deploy:
+ timeout:
+ minutes: {{ deploy_timeout }}
+{%- endblock %}
+{%- block boot %}
+{% endblock %}
+{%- block tests %}
+{%-for test_template in test_templates %}
+{% include test_template %}
+{%- endfor %}
+{% endblock %}
+{% endblock %}
+{% endblock %}
diff --git a/templates/base/agl-simple.jinja2 b/templates/base/agl-simple.jinja2
new file mode 100644
index 0000000..b2802a3
--- /dev/null
+++ b/templates/base/agl-simple.jinja2
@@ -0,0 +1,7 @@
+{%- extends 'base/agl-base.jinja2' %}
+{%- block deploy -%}
+{{ super() }}
+ to: {{ deploy_to|default("tftp") }}
+ os: {{ deploy_os|default("oe") }}
+ failure_retry: 2
+{%- endblock %}