From: cel@kernel.org
To: Luis Chamberlain <mcgrof@kernel.org>,
Daniel Gomez <da.gomez@kernel.org>,
Scott Mayhew <smayhew@redhat.com>
Cc: <kdevops@lists.linux.dev>, Chuck Lever <chuck.lever@oracle.com>
Subject: [RFC PATCH 1/3] Add a guest/instance for building the test kernel
Date: Tue, 22 Apr 2025 11:49:04 -0400 [thread overview]
Message-ID: <20250422154906.526319-2-cel@kernel.org> (raw)
In-Reply-To: <20250422154906.526319-1-cel@kernel.org>
From: Chuck Lever <chuck.lever@oracle.com>
Provision a separate guest/instance for the purpose of building
the Linux kernel under test. It's not used yet.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
playbooks/roles/gen_hosts/defaults/main.yml | 2 ++
playbooks/roles/gen_hosts/tasks/main.yml | 12 ++++++++++
.../roles/gen_hosts/templates/builder.j2 | 13 +++++++++++
playbooks/roles/gen_nodes/defaults/main.yml | 2 ++
playbooks/roles/gen_nodes/tasks/main.yml | 22 +++++++++++++++++++
workflows/linux/Kconfig | 10 +++++++++
workflows/linux/Makefile | 4 ++++
7 files changed, 65 insertions(+)
create mode 100644 playbooks/roles/gen_hosts/templates/builder.j2
diff --git a/playbooks/roles/gen_hosts/defaults/main.yml b/playbooks/roles/gen_hosts/defaults/main.yml
index f6ab9bcce166..85afb35040e3 100644
--- a/playbooks/roles/gen_hosts/defaults/main.yml
+++ b/playbooks/roles/gen_hosts/defaults/main.yml
@@ -29,6 +29,8 @@ kdevops_workflow_enable_ltp: False
kdevops_workflow_enable_nfstest: false
kdevops_workflow_enable_sysbench: false
+bootlinux_builder: false
+
is_fstests: False
fstests_fstyp: "bogus"
fs_config_role_path: "/dev/null"
diff --git a/playbooks/roles/gen_hosts/tasks/main.yml b/playbooks/roles/gen_hosts/tasks/main.yml
index a50355f72160..9182ac46f8c1 100644
--- a/playbooks/roles/gen_hosts/tasks/main.yml
+++ b/playbooks/roles/gen_hosts/tasks/main.yml
@@ -56,6 +56,18 @@
when:
- is_fstests
+- name: Generate the Ansible hosts file for a Linux kernel build
+ tags: [ 'hosts' ]
+ template:
+ src: "{{ kdevops_hosts_template }}"
+ dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ force: yes
+ trim_blocks: True
+ lstrip_blocks: True
+ when:
+ - bootlinux_builder
+ - ansible_hosts_template.stat.exists
+
- name: Generate the Ansible hosts file
tags: [ 'hosts' ]
template:
diff --git a/playbooks/roles/gen_hosts/templates/builder.j2 b/playbooks/roles/gen_hosts/templates/builder.j2
new file mode 100644
index 000000000000..0c9ba1e8e01a
--- /dev/null
+++ b/playbooks/roles/gen_hosts/templates/builder.j2
@@ -0,0 +1,13 @@
+[all]
+{{ kdevops_hosts_prefix }}-builder
+[all:vars]
+ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+
+[baseline]
+{{ kdevops_hosts_prefix }}-builder
+[baseline:vars]
+ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+
+[dev]
+[dev:vars]
+ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
diff --git a/playbooks/roles/gen_nodes/defaults/main.yml b/playbooks/roles/gen_nodes/defaults/main.yml
index 8ff9b87993a7..d5fa444c995f 100644
--- a/playbooks/roles/gen_nodes/defaults/main.yml
+++ b/playbooks/roles/gen_nodes/defaults/main.yml
@@ -93,6 +93,8 @@ fstests_fstyp: "bogus"
fs_config_role_path: "/dev/null"
fs_config_data: "[section_1]"
+bootlinux_builder: false
+builder_nodes: []
bootlinux_9p: False
bootlinux_9p_host_path: "/dev/null"
bootlinux_9p_msize: 0
diff --git a/playbooks/roles/gen_nodes/tasks/main.yml b/playbooks/roles/gen_nodes/tasks/main.yml
index d541dcbf1f54..e3d0127d1f65 100644
--- a/playbooks/roles/gen_nodes/tasks/main.yml
+++ b/playbooks/roles/gen_nodes/tasks/main.yml
@@ -43,6 +43,14 @@
when:
- kdevops_baseline_and_dev
+- name: Set builder nodes array
+ tags: vars
+ set_fact:
+ builder_nodes:
+ - "{{ kdevops_host_prefix + '-builder' }}"
+ when:
+ - bootlinux_builder
+
- name: Set iscsi_nodes list
ansible.builtin.set_fact:
iscsi_nodes: "{{ [kdevops_host_prefix + '-iscsi'] }}"
@@ -138,6 +146,20 @@
- not kdevops_workflows_dedicated_workflow
- ansible_nodes_template.stat.exists
+- name: Generate the builder kdevops nodes file using {{ kdevops_nodes_template }} as jinja2 source template
+ tags: [ 'nodes' ]
+ vars:
+ node_template: "{{ kdevops_nodes_template | basename }}"
+ all_generic_nodes: "{{ builder_nodes }}"
+ nodes: "{{ all_generic_nodes }}"
+ template:
+ src: "{{ node_template }}"
+ dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
+ force: yes
+ when:
+ - bootlinux_builder
+ - ansible_nodes_template.stat.exists
+
- name: Generate the pynfs kdevops nodes file using {{ kdevops_nodes_template }} as jinja2 source template
tags: [ 'nodes' ]
vars:
diff --git a/workflows/linux/Kconfig b/workflows/linux/Kconfig
index 797469e60d20..8a26eb2e2897 100644
--- a/workflows/linux/Kconfig
+++ b/workflows/linux/Kconfig
@@ -36,6 +36,16 @@ config BOOTLINUX_PURE_IOMAP
endif # HAVE_SUPPORTS_PURE_IOMAP
+config BOOTLINUX_BUILDER
+ bool "Build once, test many"
+ output yaml
+ default n
+ help
+ Enabling this option creates a separate guest/instance
+ where the Linux kernel is built. kdevops passes the
+ artifacts of this build to the test runner nodes to be
+ installed before each workflow runs.
+
config BOOTLINUX_9P
bool "Use 9p to build Linux"
depends on LIBVIRT && !GUESTFS_LACKS_9P
diff --git a/workflows/linux/Makefile b/workflows/linux/Makefile
index ecce273a4f67..65bbb8ae9a90 100644
--- a/workflows/linux/Makefile
+++ b/workflows/linux/Makefile
@@ -13,6 +13,10 @@ ifeq (y,$(CONFIG_BOOTLINUX_PURE_IOMAP))
TREE_CONFIG:=config-$(TREE_REF)-pure-iomap
endif
+ifeq (y,$(CONFIG_BOOTLINUX_BUILDER))
+KDEVOPS_HOSTS_TEMPLATE=builder.j2
+endif
+
# Describes the Linux clone
BOOTLINUX_ARGS += target_linux_git=$(TREE_URL)
# ifeq (y,$(CONFIG_BOOTLINUX_TREE_CUSTOM_NAME))
--
2.49.0
next prev parent reply other threads:[~2025-04-22 15:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-22 15:49 [RFC PATCH 0/3] Build once, test everywhere cel
2025-04-22 15:49 ` cel [this message]
2025-04-22 15:49 ` [RFC PATCH 2/3] playbooks: Add a build_linux role cel
2025-04-22 15:49 ` [RFC PATCH 3/3] Experimental: Add a separate install_linux role cel
2025-04-23 5:27 ` [RFC PATCH 0/3] Build once, test everywhere Luis Chamberlain
2025-04-23 12:34 ` Daniel Gomez
2025-04-23 13:36 ` Chuck Lever
2025-04-23 17:28 ` Daniel Gomez
2025-04-24 13:51 ` Chuck Lever
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250422154906.526319-2-cel@kernel.org \
--to=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=da.gomez@kernel.org \
--cc=kdevops@lists.linux.dev \
--cc=mcgrof@kernel.org \
--cc=smayhew@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox