* [PATCH RFC 0/5] Add a git regression test workflow
@ 2023-12-12 16:29 Chuck Lever
2023-12-12 16:29 ` [PATCH RFC 1/5] Add playbook for the git regression workflow Chuck Lever
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: Chuck Lever @ 2023-12-12 16:29 UTC (permalink / raw)
To: kdevops
This new workflow builds the git tool and runs its built-in
regression suite on the target file system. The git regression suite
acts as an extensive file system functional test. This workflow runs
the suite in multiple threads to add timing stress.
I've broken this into smaller bits for easier review. They can be
squashed into a single patch before the new workflow is merged.
And obviously some changes will be necessary to avoid conflicting
with Jeff's libguestfs work.
This workflow has been tested with Fedora 38/39, OpenSuSE Leap, and
Debian unstable. Currently it can be run against xfs, btrfs, or
ext4, but I'd like to be able to run it against nfs and tmpfs as
well.
I need some guidance about how to support nfs and tmpfs. Right now
the new workflow uses the shared workflow data partition, /data, as
its target. However, the create_partition playbook seems to require
an underlying device, which neither nfs nor tmpfs have.
Any advice?
---
Chuck Lever (5):
Add playbook for the git regression workflow
Add a workflow for the git regression suite
gitr: Adjust the gen_hosts and gen_nodes playbooks
Add the git regression workflow to the kdevops Makefile infrastructure
Add skeleton documentation for the git regression workflow
.gitignore | 2 +
README.md | 12 ++-
docs/gitr.md | 17 ++++
kconfigs/workflows/Kconfig | 25 +++++
playbooks/gitr.yml | 4 +
playbooks/roles/gen_hosts/defaults/main.yml | 1 +
playbooks/roles/gen_hosts/tasks/main.yml | 13 +++
playbooks/roles/gen_hosts/templates/gitr.j2 | 17 ++++
playbooks/roles/gen_nodes/defaults/main.yml | 1 +
playbooks/roles/gen_nodes/tasks/main.yml | 15 +++
playbooks/roles/gitr/defaults/main.yml | 8 ++
.../gitr/tasks/install-deps/debian/main.yml | 28 ++++++
.../roles/gitr/tasks/install-deps/main.yml | 13 +++
.../gitr/tasks/install-deps/redhat/main.yml | 38 ++++++++
.../gitr/tasks/install-deps/suse/main.yml | 24 +++++
playbooks/roles/gitr/tasks/main.yml | 97 +++++++++++++++++++
scripts/workflows/gitr/run_kernel_ci.sh | 1 +
scripts/workflows/gitr/run_kernel_ci_kotd.sh | 1 +
scripts/workflows/gitr/run_loop.sh | 58 +++++++++++
workflows/Makefile | 5 +
workflows/gitr/Kconfig | 15 +++
workflows/gitr/Makefile | 68 +++++++++++++
22 files changed, 462 insertions(+), 1 deletion(-)
create mode 100644 docs/gitr.md
create mode 100644 playbooks/gitr.yml
create mode 100644 playbooks/roles/gen_hosts/templates/gitr.j2
create mode 100644 playbooks/roles/gitr/defaults/main.yml
create mode 100644 playbooks/roles/gitr/tasks/install-deps/debian/main.yml
create mode 100644 playbooks/roles/gitr/tasks/install-deps/main.yml
create mode 100644 playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
create mode 100644 playbooks/roles/gitr/tasks/install-deps/suse/main.yml
create mode 100644 playbooks/roles/gitr/tasks/main.yml
create mode 120000 scripts/workflows/gitr/run_kernel_ci.sh
create mode 120000 scripts/workflows/gitr/run_kernel_ci_kotd.sh
create mode 100755 scripts/workflows/gitr/run_loop.sh
create mode 100644 workflows/gitr/Kconfig
create mode 100644 workflows/gitr/Makefile
--
Chuck Lever
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH RFC 1/5] Add playbook for the git regression workflow
2023-12-12 16:29 [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever
@ 2023-12-12 16:29 ` Chuck Lever
2023-12-12 17:52 ` Jeff Layton
2023-12-12 16:30 ` [PATCH RFC 2/5] Add a workflow for the git regression suite Chuck Lever
` (5 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Chuck Lever @ 2023-12-12 16:29 UTC (permalink / raw)
To: kdevops
From: Chuck Lever <chuck.lever@oracle.com>
This workflow builds the git tool and runs its built-in regression
suite on the target file system. The git regression suite acts as an
extensive file system behavior test. This workflow runs the suite in
multiple threads to add timing stress to the file system under test.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
playbooks/gitr.yml | 4 +
playbooks/roles/gitr/defaults/main.yml | 8 ++
.../roles/gitr/tasks/install-deps/debian/main.yml | 28 ++++++
playbooks/roles/gitr/tasks/install-deps/main.yml | 13 +++
.../roles/gitr/tasks/install-deps/redhat/main.yml | 38 ++++++++
.../roles/gitr/tasks/install-deps/suse/main.yml | 24 +++++
playbooks/roles/gitr/tasks/main.yml | 97 ++++++++++++++++++++
7 files changed, 212 insertions(+)
create mode 100644 playbooks/gitr.yml
create mode 100644 playbooks/roles/gitr/defaults/main.yml
create mode 100644 playbooks/roles/gitr/tasks/install-deps/debian/main.yml
create mode 100644 playbooks/roles/gitr/tasks/install-deps/main.yml
create mode 100644 playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
create mode 100644 playbooks/roles/gitr/tasks/install-deps/suse/main.yml
create mode 100644 playbooks/roles/gitr/tasks/main.yml
diff --git a/playbooks/gitr.yml b/playbooks/gitr.yml
new file mode 100644
index 000000000000..4c3e3ba919d7
--- /dev/null
+++ b/playbooks/gitr.yml
@@ -0,0 +1,4 @@
+---
+- hosts: all
+ roles:
+ - role: gitr
diff --git a/playbooks/roles/gitr/defaults/main.yml b/playbooks/roles/gitr/defaults/main.yml
new file mode 100644
index 000000000000..faddb5679bc9
--- /dev/null
+++ b/playbooks/roles/gitr/defaults/main.yml
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier GPL-2.0+
+---
+# Our sensible defaults for the gitr role.
+#
+# We default to not run tests.
+kdevops_run_gitr: False
+
+gitr_data: "{{ data_path }}/gitr"
diff --git a/playbooks/roles/gitr/tasks/install-deps/debian/main.yml b/playbooks/roles/gitr/tasks/install-deps/debian/main.yml
new file mode 100644
index 000000000000..50d4ba1037f3
--- /dev/null
+++ b/playbooks/roles/gitr/tasks/install-deps/debian/main.yml
@@ -0,0 +1,28 @@
+---
+- name: Install build dependencies for git
+ become: yes
+ become_method: sudo
+ apt:
+ name:
+ - gcc
+ - git-core
+ - gettext
+ - libcurl4-openssl-dev
+ - libexpat1-dev
+ - libssl-dev
+ - libz-dev
+ state: present
+ update_cache: yes
+ tags: [ 'gitr', 'deps' ]
+
+- name: Install run-time dependencies for git regression tests
+ become: yes
+ become_method: sudo
+ apt:
+ name:
+ - cvs
+ - cvsps
+ - sqlite3
+ state: present
+ update_cache: yes
+ tags: [ 'gitr', 'deps' ]
diff --git a/playbooks/roles/gitr/tasks/install-deps/main.yml b/playbooks/roles/gitr/tasks/install-deps/main.yml
new file mode 100644
index 000000000000..005bb32650bf
--- /dev/null
+++ b/playbooks/roles/gitr/tasks/install-deps/main.yml
@@ -0,0 +1,13 @@
+---
+# tasks to install dependencies for gitr
+- name: Debian-specific setup
+ ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/debian/main.yml
+ when: ansible_os_family == 'Debian'
+
+- name: SuSE-specific setup
+ ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/suse/main.yml
+ when: ansible_os_family == 'Suse'
+
+- name: Red Hat-specific setup
+ ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/redhat/main.yml
+ when: ansible_os_family == 'RedHat'
diff --git a/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml b/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
new file mode 100644
index 000000000000..30fb0f9b16d5
--- /dev/null
+++ b/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
@@ -0,0 +1,38 @@
+---
+- name: Install build dependencies for git
+ become: yes
+ become_method: sudo
+ yum:
+ update_cache: yes
+ name: "{{ packages }}"
+ retries: 3
+ delay: 5
+ register: result
+ until: result.rc == 0
+ vars:
+ packages:
+ - expat-devel
+ - gcc
+ - gettext
+ - git-core
+ - libcurl-devel
+ - openssl-devel
+ - zlib-devel
+
+- name: Install run-time dependencies for git regression tests
+ become: yes
+ become_method: sudo
+ yum:
+ update_cache: yes
+ name: "{{ packages }}"
+ retries: 3
+ delay: 5
+ register: result
+ until: result.rc == 0
+ vars:
+ packages:
+ - cvs
+ - cvsps
+ - git-email
+ - subversion
+# - subversion-perl
diff --git a/playbooks/roles/gitr/tasks/install-deps/suse/main.yml b/playbooks/roles/gitr/tasks/install-deps/suse/main.yml
new file mode 100644
index 000000000000..0db06c5b66d0
--- /dev/null
+++ b/playbooks/roles/gitr/tasks/install-deps/suse/main.yml
@@ -0,0 +1,24 @@
+---
+- name: Install build dependencies for git
+ become: yes
+ become_method: sudo
+ zypper:
+ name:
+ - gcc
+ - gettext
+ - git-core
+ - libcurl-devel
+ - libexpat-devel
+ - libopenssl-1_1-devel
+ state: present
+
+- name: Install run-time dependencies for git regression tests
+ become: yes
+ become_method: sudo
+ zypper:
+ name:
+ - cvs
+ - cvsps
+ - subversion
+ - subversion-perl
+ state: present
diff --git a/playbooks/roles/gitr/tasks/main.yml b/playbooks/roles/gitr/tasks/main.yml
new file mode 100644
index 000000000000..199b3aa7f432
--- /dev/null
+++ b/playbooks/roles/gitr/tasks/main.yml
@@ -0,0 +1,97 @@
+---
+- name: Import optional extra_args file
+ include_vars: "{{ item }}"
+ ignore_errors: yes
+ with_first_found:
+ - files:
+ - "../extra_vars.yml"
+ - "../extra_vars.yaml"
+ - "../extra_vars.json"
+ skip: true
+ tags: vars
+
+- name: Set the path where we collect gitr test results
+ set_fact:
+ gitr_workflow_dir: "../workflows/gitr"
+ tags: [ 'vars' ]
+
+- name: Clean up localhost results directory and files
+ local_action: file path="{{ gitr_workflow_dir }}/results/" state=absent
+ run_once: true
+ tags: [ 'clean_local_results' ]
+
+- name: Create the results directory
+ local_action: file path="{{ gitr_workflow_dir }}/results/" state=directory
+ run_once: true
+ tags: [ 'first_run' ]
+
+- include_role:
+ name: create_data_partition
+ tags: [ 'data_partition' ]
+
+- include: tasks/install-deps/main.yml
+
+- name: Remove old git dir
+ tags: [ 'git', 'gitr' ]
+ become: yes
+ become_flags: 'su - -c'
+ become_method: sudo
+ file:
+ path: "{{ gitr_data }}"
+ state: absent
+
+- name: git clone git
+ tags: [ 'git', 'gitr' ]
+ git:
+ repo: "{{ gitr_git }}"
+ dest: "{{ gitr_data }}"
+ update: yes
+ version: "{{ gitr_git_tag }}"
+ retries: 3
+ delay: 5
+ register: result
+ until: not result.failed
+
+- name: Get nproc
+ tags: [ 'oscheck', 'gitr', 'build', 'vars' ]
+ command: "{{ num_jobs }}"
+ register: nproc
+
+- name: Build git
+ tags: [ 'oscheck', 'gitr', 'build' ]
+ community.general.make:
+ chdir: "{{ gitr_data }}"
+ jobs: "{{ nproc.stdout }}"
+
+- name: Run the git regression suite
+ tags: [ 'run_tests' ]
+ community.general.make:
+ chdir: "{{ gitr_data }}"
+ target: "test"
+ jobs: "{{ nproc.stdout }}"
+ register: gitr_out
+ ignore_errors: true
+
+- name: Save git regression test output
+ tags: [ 'copy_results' ]
+ copy:
+ content: "{{ gitr_out.stdout_lines|join('\n') }}"
+ dest: "{{ gitr_data }}/gitr.log"
+
+- name: Get used target kernel version
+ tags: [ 'copy_results' ]
+ command: "uname -r"
+ register: uname_cmd
+
+- name: Store kernel_rev variable
+ tags: [ 'copy_results' ]
+ set_fact:
+ kernel_rev: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}"
+ run_once: true
+
+- name: Copy test results over
+ tags: [ 'copy_results' ]
+ fetch:
+ src: "{{ gitr_data }}/gitr.log"
+ dest: "{{ gitr_workflow_dir }}/results/{{ kernel_rev }}.txt"
+ flat: yes
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH RFC 2/5] Add a workflow for the git regression suite
2023-12-12 16:29 [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever
2023-12-12 16:29 ` [PATCH RFC 1/5] Add playbook for the git regression workflow Chuck Lever
@ 2023-12-12 16:30 ` Chuck Lever
2023-12-12 16:30 ` [PATCH RFC 3/5] gitr: Adjust the gen_hosts and gen_nodes playbooks Chuck Lever
` (4 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2023-12-12 16:30 UTC (permalink / raw)
To: kdevops
From: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
.gitignore | 2 +
scripts/workflows/gitr/run_kernel_ci.sh | 1
scripts/workflows/gitr/run_kernel_ci_kotd.sh | 1
scripts/workflows/gitr/run_loop.sh | 58 ++++++++++++++++++++++
workflows/Makefile | 5 ++
workflows/gitr/Kconfig | 15 ++++++
workflows/gitr/Makefile | 68 ++++++++++++++++++++++++++
7 files changed, 150 insertions(+)
create mode 120000 scripts/workflows/gitr/run_kernel_ci.sh
create mode 120000 scripts/workflows/gitr/run_kernel_ci_kotd.sh
create mode 100755 scripts/workflows/gitr/run_loop.sh
create mode 100644 workflows/gitr/Kconfig
create mode 100644 workflows/gitr/Makefile
diff --git a/.gitignore b/.gitignore
index 8c649ccc09b8..9b338342b919 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,6 +64,8 @@ workflows/blktests/results/[0-9]*
workflows/demos/reboot-limit/results/
+workflows/gitr/results/
+
# For now we ignore all results as we have work to do:
# - copy only data for failed tests
# - envision a way so that regressions are clearly visible with a git diff
diff --git a/scripts/workflows/gitr/run_kernel_ci.sh b/scripts/workflows/gitr/run_kernel_ci.sh
new file mode 120000
index 000000000000..4fd5dc5e8e13
--- /dev/null
+++ b/scripts/workflows/gitr/run_kernel_ci.sh
@@ -0,0 +1 @@
+../generic/run_kernel_ci.sh
\ No newline at end of file
diff --git a/scripts/workflows/gitr/run_kernel_ci_kotd.sh b/scripts/workflows/gitr/run_kernel_ci_kotd.sh
new file mode 120000
index 000000000000..8f94d6ba4f52
--- /dev/null
+++ b/scripts/workflows/gitr/run_kernel_ci_kotd.sh
@@ -0,0 +1 @@
+../kotd/run_kernel_ci_kotd.sh
\ No newline at end of file
diff --git a/scripts/workflows/gitr/run_loop.sh b/scripts/workflows/gitr/run_loop.sh
new file mode 100755
index 000000000000..2ba961e2f4cb
--- /dev/null
+++ b/scripts/workflows/gitr/run_loop.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+# SPDX-License-Identifier: copyleft-next-0.3.1
+
+# Part of kdevops kernel-ci, this is the script which will run the test workflow
+# as many times as indicated up to CONFIG_KERNEL_CI_STEADY_STATE_GOAL
+
+source ${TOPDIR}/.config
+source ${TOPDIR}/scripts/lib.sh
+
+WORKFLOWDIR=${TOPDIR}/workflows/gitr
+
+COUNT=1
+
+run_loop()
+{
+ while true; do
+ echo "== kernel-ci gitr test loop $COUNT start: $(date)" > $KERNEL_CI_FAIL_LOG
+ echo "/usr/bin/time -f %E make gitr-baseline" >> $KERNEL_CI_FAIL_LOG
+ /usr/bin/time -p -o $KERNEL_CI_LOGTIME make gitr-baseline >> $KERNEL_CI_FAIL_LOG
+ ANSIBLE_CALL_RET=$?
+ echo "End $COUNT: $(date)" >> $KERNEL_CI_FAIL_LOG
+ cat $KERNEL_CI_LOGTIME >> $KERNEL_CI_FAIL_LOG
+ echo "git status:" >> $KERNEL_CI_FAIL_LOG
+ git status >> $KERNEL_CI_FAIL_LOG
+ echo "Results:" >> $KERNEL_CI_FAIL_LOG
+
+ rm -f $KERNEL_CI_DIFF_LOG
+
+ if [[ "$ANSIBLE_CALL_RET" -ne 0 ]]; then
+ echo "Test $COUNT: FAILED!" >> $KERNEL_CI_DIFF_LOG
+ echo "== Test loop count $COUNT" >> $KERNEL_CI_DIFF_LOG
+ echo "$(git describe)" >> $KERNEL_CI_DIFF_LOG
+ git diff >> $KERNEL_CI_DIFF_LOG
+ cat $KERNEL_CI_DIFF_LOG >> $KERNEL_CI_FAIL_LOG
+ cat $KERNEL_CI_FAIL_LOG >> $KERNEL_CI_FULL_LOG
+ echo $COUNT > $KERNEL_CI_FAIL_FILE
+ exit 1
+ else
+ echo "Test $COUNT: OK!" >> $KERNEL_CI_FAIL_LOG
+ echo "----------------------------------------------------------------" >> $KERNEL_CI_FAIL_LOG
+ cat $KERNEL_CI_FAIL_LOG >> $KERNEL_CI_FULL_LOG
+ fi
+
+ # This let's us keep track of which loop count was last successful
+ echo $COUNT > $KERNEL_CI_OK_FILE
+
+ let COUNT=$COUNT+1
+ if [[ "$CONFIG_KERNEL_CI_ENABLE_STEADY_STATE" == "y" &&
+ "$COUNT" -gt "$CONFIG_KERNEL_CI_STEADY_STATE_GOAL" ]]; then
+ exit 0
+ fi
+ sleep 1
+ done
+}
+
+rm -f $KERNEL_CI_FAIL_FILE $KERNEL_CI_OK_FILE
+echo "= kernel-ci full log" > $KERNEL_CI_FULL_LOG
+run_loop
diff --git a/workflows/Makefile b/workflows/Makefile
index 1c0e13a93f38..122eb98bb66b 100644
--- a/workflows/Makefile
+++ b/workflows/Makefile
@@ -43,6 +43,11 @@ ifeq (y,$(CONFIG_WORKFLOWS_REBOOT_LIMIT))
include workflows/demos/reboot-limit/Makefile
endif # CONFIG_WORKFLOWS_REBOOT_LIMIT == y
+ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_GITR))
+WORKFLOW_ARGS += kdevops_workflow_enable_gitr='True'
+include workflows/gitr/Makefile
+endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_GITR == y
+
ANSIBLE_EXTRA_ARGS += $(WORKFLOW_ARGS)
ANSIBLE_EXTRA_ARGS_SEPARATED += $(WORKFLOW_ARGS_SEPARATED)
ANSIBLE_EXTRA_ARGS_DIRECT += $(WORKFLOW_ARGS_DIRECT)
diff --git a/workflows/gitr/Kconfig b/workflows/gitr/Kconfig
new file mode 100644
index 000000000000..b9fc9822d910
--- /dev/null
+++ b/workflows/gitr/Kconfig
@@ -0,0 +1,15 @@
+if KDEVOPS_WORKFLOW_ENABLE_GITR
+
+config GITR_GIT
+ string "git tool repository to clone"
+ default "https://git.kernel.org/pub/scm/git/git.git"
+ help
+ The git tool repository to clone.
+
+config GITR_GIT_TAG
+ string "tag, branch or sha1sum"
+ default "master"
+ help
+ The tag, branch or sha1sum to check out.
+
+endif # KDEVOPS_WORKFLOW_ENABLE_GITR
diff --git a/workflows/gitr/Makefile b/workflows/gitr/Makefile
new file mode 100644
index 000000000000..063631de4ce2
--- /dev/null
+++ b/workflows/gitr/Makefile
@@ -0,0 +1,68 @@
+ifeq (y,$(CONFIG_WORKFLOWS_DEDICATED_WORKFLOW))
+export KDEVOPS_HOSTS_TEMPLATE := gitr.j2
+endif
+
+GITR_GIT:=$(subst ",,$(CONFIG_GITR_GIT))
+GITR_ARGS += gitr_git=$(GITR_GIT)
+
+GITR_GIT_TAG:=$(subst ",,$(CONFIG_GITR_GIT_TAG))
+GITR_ARGS += gitr_git_tag=$(GITR_GIT_TAG)
+
+WORKFLOW_ARGS += $(GITR_ARGS)
+
+# The default is our workflow does not have kernel-ci enabled
+GITR_KERNEL_CI_LOOP := false
+GITR_KERNEL_CI_LOOP_KOTD := false
+
+# If kdevops was configured to enable kernel-ci we define our scripts
+ifeq (y,$(CONFIG_KERNEL_CI))
+GITR_KERNEL_CI_LOOP := scripts/workflows/gitr/run_kernel_ci.sh
+GITR_KERNEL_CI_LOOP_KOTD := scripts/workflows/gitr/run_kernel_ci_kotd.sh
+endif # CONFIG_KERNEL_CI
+
+# Makefile for gitr targets
+gitr:
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) -l baseline,dev \
+ -f 30 -i hosts playbooks/gitr.yml --skip-tags run_tests,copy_results
+
+gitr-baseline:
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ -f 30 -i hosts -l baseline playbooks/gitr.yml \
+ --tags vars,run_tests,copy_results \
+ --extra-vars=@./extra_vars.yaml
+
+# Once you know the baseline works, you may want to run the baseline in a loop
+# up to the number of times you define. We define this goal in kdevops as
+# the CONFIG_KERNEL_CI_STEADY_STATE_GOAL.
+gitr-baseline-loop:
+ $(Q)$(GITR_KERNEL_CI_LOOP) baseline
+
+# The kdevops kernel-ci target will try to upgrade your kernel to the latest
+# and then run the baseline-loop.
+gitr-baseline-kernelci:
+ $(Q)$(GITR_KERNEL_CI_LOOP_KOTD) baseline
+
+# Below are the corresponding dev targets
+gitr-dev-baseline:
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ -f 30 -i hosts -l dev playbooks/gitr.yml --tags vars,run_tests,copy_results --extra-vars=@./extra_vars.yaml
+
+gitr-dev-loop:
+ $(Q)$(GITR_KERNEL_CI_LOOP) dev
+
+gitr-dev-kernelci:
+ $(Q)$(GITR_KERNEL_CI_LOOP_KOTD) dev
+
+gitr-dev-reset:
+ $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \
+ -f 30 -i hosts -l dev playbooks/gitr.yml --tags vars,reset --extra-vars=@./extra_vars.yaml
+
+gitr-help-menu:
+ @echo "gitr options:"
+ @echo "gitr - Git clone git, build and install it"
+ @echo "gitr-{baseline,dev} - Run the gitr test on baseline or dev hosts and collect results"
+ @echo "gitr-{baseline,dev}-loop" - Run gitr in a loop until error or steady state
+ @echo "gitr-{baseline,dev}-kernelci - Run gitr kernel-ci loop"
+ @echo ""
+
+HELP_TARGETS += gitr-help-menu
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH RFC 3/5] gitr: Adjust the gen_hosts and gen_nodes playbooks
2023-12-12 16:29 [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever
2023-12-12 16:29 ` [PATCH RFC 1/5] Add playbook for the git regression workflow Chuck Lever
2023-12-12 16:30 ` [PATCH RFC 2/5] Add a workflow for the git regression suite Chuck Lever
@ 2023-12-12 16:30 ` Chuck Lever
2023-12-12 16:30 ` [PATCH RFC 4/5] Add the git regression workflow to the kdevops Makefile infrastructure Chuck Lever
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2023-12-12 16:30 UTC (permalink / raw)
To: kdevops
From: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
playbooks/roles/gen_hosts/defaults/main.yml | 1 +
playbooks/roles/gen_hosts/tasks/main.yml | 13 +++++++++++++
playbooks/roles/gen_hosts/templates/gitr.j2 | 17 +++++++++++++++++
playbooks/roles/gen_nodes/defaults/main.yml | 1 +
playbooks/roles/gen_nodes/tasks/main.yml | 15 +++++++++++++++
5 files changed, 47 insertions(+)
create mode 100644 playbooks/roles/gen_hosts/templates/gitr.j2
diff --git a/playbooks/roles/gen_hosts/defaults/main.yml b/playbooks/roles/gen_hosts/defaults/main.yml
index a62c53c64f53..ff1212a5d1e2 100644
--- a/playbooks/roles/gen_hosts/defaults/main.yml
+++ b/playbooks/roles/gen_hosts/defaults/main.yml
@@ -24,6 +24,7 @@ kdevops_workflow_enable_selftests: False
kdevops_workflow_enable_cxl: False
kdevops_workflow_enable_pynfs: False
+kdevops_workflow_enable_gitr: False
is_fstests: False
fstests_fstyp: "bogus"
diff --git a/playbooks/roles/gen_hosts/tasks/main.yml b/playbooks/roles/gen_hosts/tasks/main.yml
index 0c6029c4c7a7..826a58d31996 100644
--- a/playbooks/roles/gen_hosts/tasks/main.yml
+++ b/playbooks/roles/gen_hosts/tasks/main.yml
@@ -94,6 +94,19 @@
- kdevops_workflow_enable_pynfs
- ansible_hosts_template.stat.exists
+- name: Generate the Ansible hosts file for dedicated gitr workflow
+ tags: [ 'hosts' ]
+ template:
+ src: "{{ kdevops_hosts_template }}"
+ dest: "{{ topdir_path }}/{{ kdevops_hosts }}"
+ force: yes
+ trim_blocks: True
+ lstrip_blocks: True
+ when:
+ - kdevops_workflows_dedicated_workflow
+ - kdevops_workflow_enable_gitr
+ - ansible_hosts_template.stat.exists
+
- name: Set empty enabled test types list for fstests
tags: [ 'hosts' ]
set_fact:
diff --git a/playbooks/roles/gen_hosts/templates/gitr.j2 b/playbooks/roles/gen_hosts/templates/gitr.j2
new file mode 100644
index 000000000000..1b3034e05d58
--- /dev/null
+++ b/playbooks/roles/gen_hosts/templates/gitr.j2
@@ -0,0 +1,17 @@
+[all]
+{{ kdevops_hosts_prefix }}
+{% if kdevops_baseline_and_dev == True %}
+{{ kdevops_hosts_prefix }}-dev
+{% endif %}
+[all:vars]
+ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+[baseline]
+{{ kdevops_hosts_prefix }}
+[baseline:vars]
+ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+[dev]
+{% if kdevops_baseline_and_dev %}
+{{ kdevops_hosts_prefix }}-dev
+{% endif %}
+[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 2bd0f330517a..7541421b2b86 100644
--- a/playbooks/roles/gen_nodes/defaults/main.yml
+++ b/playbooks/roles/gen_nodes/defaults/main.yml
@@ -9,6 +9,7 @@ kdevops_nodes: "vagrant/kdevops_nodes.yaml"
kdevops_baseline_and_dev: False
kdevops_workflow_enable_cxl: False
kdevops_workflow_enable_pynfs: False
+kdevops_workflow_enable_gitr: False
kdevops_workflow_enable_selftests: False
virtualbox_provider: False
diff --git a/playbooks/roles/gen_nodes/tasks/main.yml b/playbooks/roles/gen_nodes/tasks/main.yml
index 7beea670f0e3..eaff50864099 100644
--- a/playbooks/roles/gen_nodes/tasks/main.yml
+++ b/playbooks/roles/gen_nodes/tasks/main.yml
@@ -126,6 +126,21 @@
- kdevops_workflow_enable_cxl
- ansible_nodes_template.stat.exists
+- name: Generate the gitr kdevops nodes file using {{ kdevops_nodes_template }} as jinja2 source template
+ tags: [ 'nodes' ]
+ vars:
+ node_template: "{{ kdevops_nodes_template | basename }}"
+ all_generic_nodes: "{{ generic_nodes }}"
+ nodes: "{{ all_generic_nodes }}"
+ template:
+ src: "{{ node_template }}"
+ dest: "{{ topdir_path }}/{{ kdevops_nodes }}"
+ force: yes
+ when:
+ - kdevops_workflows_dedicated_workflow
+ - kdevops_workflow_enable_gitr
+ - ansible_nodes_template.stat.exists
+
- name: Set empty enabled test types list for fstests
tags: [ 'hosts' ]
set_fact:
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH RFC 4/5] Add the git regression workflow to the kdevops Makefile infrastructure
2023-12-12 16:29 [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever
` (2 preceding siblings ...)
2023-12-12 16:30 ` [PATCH RFC 3/5] gitr: Adjust the gen_hosts and gen_nodes playbooks Chuck Lever
@ 2023-12-12 16:30 ` Chuck Lever
2023-12-12 16:30 ` [PATCH RFC 5/5] Add skeleton documentation for the git regression workflow Chuck Lever
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2023-12-12 16:30 UTC (permalink / raw)
To: kdevops
From: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
kconfigs/workflows/Kconfig | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/kconfigs/workflows/Kconfig b/kconfigs/workflows/Kconfig
index 1122b89e2657..65c32b4f2a22 100644
--- a/kconfigs/workflows/Kconfig
+++ b/kconfigs/workflows/Kconfig
@@ -152,6 +152,13 @@ config KDEVOPS_WORKFLOW_DEDICATE_SELFTESTS
selftests work. Note that you will need at least 8 GiB of RAM
for your target guests.
+config KDEVOPS_WORKFLOW_DEDICATE_GITR
+ bool "gitr"
+ select KDEVOPS_WORKFLOW_ENABLE_GITR
+ help
+ This will dedicate your configuration to running only the
+ multi-threaded git regression workflow.
+
endchoice
endif
@@ -209,6 +216,14 @@ config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_SELFTESTS
Select this option if you are doing Linux kernel developent and
testing with sefltests.
+config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_GITR
+ bool "gitr"
+ select KDEVOPS_WORKFLOW_ENABLE_GITR
+ depends on VAGRANT || TERRAFORM_PRIVATE_NET
+ help
+ Select this option if you want to configure the deployment for
+ testing via the multi-threaded git regression workflow.
+
endif # !WORKFLOWS_DEDICATED_WORKFLOW
config KDEVOPS_WORKFLOW_ENABLE_FSTESTS
@@ -262,6 +277,16 @@ source "workflows/selftests/Kconfig"
endmenu
endif # KDEVOPS_WORKFLOW_ENABLE_SELFTESTS
+config KDEVOPS_WORKFLOW_ENABLE_GITR
+ bool
+ default y if KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_GITR || KDEVOPS_WORKFLOW_DEDICATE_GITR
+
+if KDEVOPS_WORKFLOW_ENABLE_GITR
+menu "Configure and run the git regression suite"
+source "workflows/gitr/Kconfig"
+endmenu
+endif # KDEVOPS_WORKFLOW_ENABLE_GITR
+
config KDEVOPS_WORKFLOW_GIT_CLONES_KDEVOPS_GIT
bool
default y if KDEVOPS_WORKFLOW_ENABLE_FSTESTS || KDEVOPS_WORKFLOW_ENABLE_BLKTESTS
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH RFC 5/5] Add skeleton documentation for the git regression workflow
2023-12-12 16:29 [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever
` (3 preceding siblings ...)
2023-12-12 16:30 ` [PATCH RFC 4/5] Add the git regression workflow to the kdevops Makefile infrastructure Chuck Lever
@ 2023-12-12 16:30 ` Chuck Lever
2023-12-12 16:47 ` [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever III
2023-12-12 17:29 ` Jeff Layton
6 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever @ 2023-12-12 16:30 UTC (permalink / raw)
To: kdevops
From: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
README.md | 12 +++++++++++-
docs/gitr.md | 17 +++++++++++++++++
2 files changed, 28 insertions(+), 1 deletion(-)
create mode 100644 docs/gitr.md
diff --git a/README.md b/README.md
index 72bae4bd5f71..a0fd04314b58 100644
--- a/README.md
+++ b/README.md
@@ -79,7 +79,7 @@ workflow you can just run:
For more details see [kdevops blktests docs](docs/blktests.md)
-### Start testing NFS with in 2 commands
+### Start testing NFS in 2 commands
To test the kernel's nfs server with the pynfs testsuite, enable the pynfs
workflow and then run:
@@ -89,6 +89,16 @@ workflow and then run:
For more details see [kdevops nfs docs](docs/nfs.md)
+### Start running the git regression suite in 2 commands
+
+To test a kernel using the git regression suite, enable the gitr workflow
+and then run:
+
+ * `make gitr`
+ * `make gitr-baseline`
+
+For more details see [kdevops gitr docs](docs/gitr.md)
+
### Runs some kernel selftests in a parallel manner
kdevops supports running Linux kernel selftests in parallel, this is as easy as:
diff --git a/docs/gitr.md b/docs/gitr.md
new file mode 100644
index 000000000000..825b52f82619
--- /dev/null
+++ b/docs/gitr.md
@@ -0,0 +1,17 @@
+# kdevops git regression suite
+
+kdevops can run the git tool's internal regression suite against
+a target file system.
+
+First select the file system to test by running "make menuconfig"
+and going to the
+
+ Target workflows -> Shared workflow configuration ->
+ Shared workflow data partition
+
+menu. Then, use:
+
+ * `make`
+ * `make bringup`
+ * `make gitr`
+ * `make gitr-baseline`
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 0/5] Add a git regression test workflow
2023-12-12 16:29 [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever
` (4 preceding siblings ...)
2023-12-12 16:30 ` [PATCH RFC 5/5] Add skeleton documentation for the git regression workflow Chuck Lever
@ 2023-12-12 16:47 ` Chuck Lever III
2023-12-12 17:29 ` Jeff Layton
6 siblings, 0 replies; 11+ messages in thread
From: Chuck Lever III @ 2023-12-12 16:47 UTC (permalink / raw)
To: kdevops@lists.linux.dev
> On Dec 12, 2023, at 11:29 AM, Chuck Lever <cel@kernel.org> wrote:
>
> This new workflow builds the git tool and runs its built-in
> regression suite on the target file system. The git regression suite
> acts as an extensive file system functional test. This workflow runs
> the suite in multiple threads to add timing stress.
>
> I've broken this into smaller bits for easier review. They can be
> squashed into a single patch before the new workflow is merged.
> And obviously some changes will be necessary to avoid conflicting
> with Jeff's libguestfs work.
I should also mention there's a lot of copy pasta mixed in here.
Don't be afraid to suggest removing or replacing stuff that doesn't
make sense for my use case.
Some stuff like the CI scripts were copied and mechanically edited
but have not been tested.
> This workflow has been tested with Fedora 38/39, OpenSuSE Leap, and
> Debian unstable.
x86_64 vagrant only, of course. I don't have any cloud resources
for kdevops yet.
> Currently it can be run against xfs, btrfs, or
> ext4, but I'd like to be able to run it against nfs and tmpfs as
> well.
>
> I need some guidance about how to support nfs and tmpfs. Right now
> the new workflow uses the shared workflow data partition, /data, as
> its target. However, the create_partition playbook seems to require
> an underlying device, which neither nfs nor tmpfs have.
>
> Any advice?
>
> ---
>
> Chuck Lever (5):
> Add playbook for the git regression workflow
> Add a workflow for the git regression suite
> gitr: Adjust the gen_hosts and gen_nodes playbooks
> Add the git regression workflow to the kdevops Makefile infrastructure
> Add skeleton documentation for the git regression workflow
>
>
> .gitignore | 2 +
> README.md | 12 ++-
> docs/gitr.md | 17 ++++
> kconfigs/workflows/Kconfig | 25 +++++
> playbooks/gitr.yml | 4 +
> playbooks/roles/gen_hosts/defaults/main.yml | 1 +
> playbooks/roles/gen_hosts/tasks/main.yml | 13 +++
> playbooks/roles/gen_hosts/templates/gitr.j2 | 17 ++++
> playbooks/roles/gen_nodes/defaults/main.yml | 1 +
> playbooks/roles/gen_nodes/tasks/main.yml | 15 +++
> playbooks/roles/gitr/defaults/main.yml | 8 ++
> .../gitr/tasks/install-deps/debian/main.yml | 28 ++++++
> .../roles/gitr/tasks/install-deps/main.yml | 13 +++
> .../gitr/tasks/install-deps/redhat/main.yml | 38 ++++++++
> .../gitr/tasks/install-deps/suse/main.yml | 24 +++++
> playbooks/roles/gitr/tasks/main.yml | 97 +++++++++++++++++++
> scripts/workflows/gitr/run_kernel_ci.sh | 1 +
> scripts/workflows/gitr/run_kernel_ci_kotd.sh | 1 +
> scripts/workflows/gitr/run_loop.sh | 58 +++++++++++
> workflows/Makefile | 5 +
> workflows/gitr/Kconfig | 15 +++
> workflows/gitr/Makefile | 68 +++++++++++++
> 22 files changed, 462 insertions(+), 1 deletion(-)
> create mode 100644 docs/gitr.md
> create mode 100644 playbooks/gitr.yml
> create mode 100644 playbooks/roles/gen_hosts/templates/gitr.j2
> create mode 100644 playbooks/roles/gitr/defaults/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/debian/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/suse/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/main.yml
> create mode 120000 scripts/workflows/gitr/run_kernel_ci.sh
> create mode 120000 scripts/workflows/gitr/run_kernel_ci_kotd.sh
> create mode 100755 scripts/workflows/gitr/run_loop.sh
> create mode 100644 workflows/gitr/Kconfig
> create mode 100644 workflows/gitr/Makefile
>
> --
> Chuck Lever
>
>
--
Chuck Lever
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 0/5] Add a git regression test workflow
2023-12-12 16:29 [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever
` (5 preceding siblings ...)
2023-12-12 16:47 ` [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever III
@ 2023-12-12 17:29 ` Jeff Layton
6 siblings, 0 replies; 11+ messages in thread
From: Jeff Layton @ 2023-12-12 17:29 UTC (permalink / raw)
To: Chuck Lever, kdevops
On Tue, 2023-12-12 at 11:29 -0500, Chuck Lever wrote:
> This new workflow builds the git tool and runs its built-in
> regression suite on the target file system. The git regression suite
> acts as an extensive file system functional test. This workflow runs
> the suite in multiple threads to add timing stress.
>
> I've broken this into smaller bits for easier review. They can be
> squashed into a single patch before the new workflow is merged.
> And obviously some changes will be necessary to avoid conflicting
> with Jeff's libguestfs work.
>
> This workflow has been tested with Fedora 38/39, OpenSuSE Leap, and
> Debian unstable. Currently it can be run against xfs, btrfs, or
> ext4, but I'd like to be able to run it against nfs and tmpfs as
> well.
>
> I need some guidance about how to support nfs and tmpfs. Right now
> the new workflow uses the shared workflow data partition, /data, as
> its target. However, the create_partition playbook seems to require
> an underlying device, which neither nfs nor tmpfs have.
>
> Any advice?
>
For NFS, you'll want to create an export for your test via the
nfsd_add_export role (see pynfs and fstests workflows for examples). As
to whether you run the mount command in the playbook or your own script,
it's your call.
For tmpfs, you (obviously) shouldn't need any disk. I think it's
possible to run fstests on tmpfs now, so you may want to look at what
Luis did in that workflow.
> ---
>
> Chuck Lever (5):
> Add playbook for the git regression workflow
> Add a workflow for the git regression suite
> gitr: Adjust the gen_hosts and gen_nodes playbooks
> Add the git regression workflow to the kdevops Makefile infrastructure
> Add skeleton documentation for the git regression workflow
>
>
> .gitignore | 2 +
> README.md | 12 ++-
> docs/gitr.md | 17 ++++
> kconfigs/workflows/Kconfig | 25 +++++
> playbooks/gitr.yml | 4 +
> playbooks/roles/gen_hosts/defaults/main.yml | 1 +
> playbooks/roles/gen_hosts/tasks/main.yml | 13 +++
> playbooks/roles/gen_hosts/templates/gitr.j2 | 17 ++++
> playbooks/roles/gen_nodes/defaults/main.yml | 1 +
> playbooks/roles/gen_nodes/tasks/main.yml | 15 +++
> playbooks/roles/gitr/defaults/main.yml | 8 ++
> .../gitr/tasks/install-deps/debian/main.yml | 28 ++++++
> .../roles/gitr/tasks/install-deps/main.yml | 13 +++
> .../gitr/tasks/install-deps/redhat/main.yml | 38 ++++++++
> .../gitr/tasks/install-deps/suse/main.yml | 24 +++++
> playbooks/roles/gitr/tasks/main.yml | 97 +++++++++++++++++++
> scripts/workflows/gitr/run_kernel_ci.sh | 1 +
> scripts/workflows/gitr/run_kernel_ci_kotd.sh | 1 +
> scripts/workflows/gitr/run_loop.sh | 58 +++++++++++
> workflows/Makefile | 5 +
> workflows/gitr/Kconfig | 15 +++
> workflows/gitr/Makefile | 68 +++++++++++++
> 22 files changed, 462 insertions(+), 1 deletion(-)
> create mode 100644 docs/gitr.md
> create mode 100644 playbooks/gitr.yml
> create mode 100644 playbooks/roles/gen_hosts/templates/gitr.j2
> create mode 100644 playbooks/roles/gitr/defaults/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/debian/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/suse/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/main.yml
> create mode 120000 scripts/workflows/gitr/run_kernel_ci.sh
> create mode 120000 scripts/workflows/gitr/run_kernel_ci_kotd.sh
> create mode 100755 scripts/workflows/gitr/run_loop.sh
> create mode 100644 workflows/gitr/Kconfig
> create mode 100644 workflows/gitr/Makefile
>
> --
> Chuck Lever
>
>
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 1/5] Add playbook for the git regression workflow
2023-12-12 16:29 ` [PATCH RFC 1/5] Add playbook for the git regression workflow Chuck Lever
@ 2023-12-12 17:52 ` Jeff Layton
2023-12-12 19:23 ` Chuck Lever III
0 siblings, 1 reply; 11+ messages in thread
From: Jeff Layton @ 2023-12-12 17:52 UTC (permalink / raw)
To: Chuck Lever, kdevops
On Tue, 2023-12-12 at 11:29 -0500, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> This workflow builds the git tool and runs its built-in regression
> suite on the target file system. The git regression suite acts as an
> extensive file system behavior test. This workflow runs the suite in
> multiple threads to add timing stress to the file system under test.
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> playbooks/gitr.yml | 4 +
> playbooks/roles/gitr/defaults/main.yml | 8 ++
> .../roles/gitr/tasks/install-deps/debian/main.yml | 28 ++++++
> playbooks/roles/gitr/tasks/install-deps/main.yml | 13 +++
> .../roles/gitr/tasks/install-deps/redhat/main.yml | 38 ++++++++
> .../roles/gitr/tasks/install-deps/suse/main.yml | 24 +++++
> playbooks/roles/gitr/tasks/main.yml | 97 ++++++++++++++++++++
> 7 files changed, 212 insertions(+)
> create mode 100644 playbooks/gitr.yml
> create mode 100644 playbooks/roles/gitr/defaults/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/debian/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/install-deps/suse/main.yml
> create mode 100644 playbooks/roles/gitr/tasks/main.yml
>
> diff --git a/playbooks/gitr.yml b/playbooks/gitr.yml
> new file mode 100644
> index 000000000000..4c3e3ba919d7
> --- /dev/null
> +++ b/playbooks/gitr.yml
> @@ -0,0 +1,4 @@
> +---
> +- hosts: all
> + roles:
> + - role: gitr
> diff --git a/playbooks/roles/gitr/defaults/main.yml b/playbooks/roles/gitr/defaults/main.yml
> new file mode 100644
> index 000000000000..faddb5679bc9
> --- /dev/null
> +++ b/playbooks/roles/gitr/defaults/main.yml
> @@ -0,0 +1,8 @@
> +# SPDX-License-Identifier GPL-2.0+
> +---
> +# Our sensible defaults for the gitr role.
> +#
> +# We default to not run tests.
> +kdevops_run_gitr: False
> +
> +gitr_data: "{{ data_path }}/gitr"
> diff --git a/playbooks/roles/gitr/tasks/install-deps/debian/main.yml b/playbooks/roles/gitr/tasks/install-deps/debian/main.yml
> new file mode 100644
> index 000000000000..50d4ba1037f3
> --- /dev/null
> +++ b/playbooks/roles/gitr/tasks/install-deps/debian/main.yml
> @@ -0,0 +1,28 @@
> +---
> +- name: Install build dependencies for git
> + become: yes
> + become_method: sudo
> + apt:
> + name:
> + - gcc
> + - git-core
> + - gettext
> + - libcurl4-openssl-dev
> + - libexpat1-dev
> + - libssl-dev
> + - libz-dev
> + state: present
> + update_cache: yes
> + tags: [ 'gitr', 'deps' ]
> +
> +- name: Install run-time dependencies for git regression tests
> + become: yes
> + become_method: sudo
> + apt:
> + name:
> + - cvs
> + - cvsps
> + - sqlite3
> + state: present
> + update_cache: yes
> + tags: [ 'gitr', 'deps' ]
> diff --git a/playbooks/roles/gitr/tasks/install-deps/main.yml b/playbooks/roles/gitr/tasks/install-deps/main.yml
> new file mode 100644
> index 000000000000..005bb32650bf
> --- /dev/null
> +++ b/playbooks/roles/gitr/tasks/install-deps/main.yml
> @@ -0,0 +1,13 @@
> +---
> +# tasks to install dependencies for gitr
> +- name: Debian-specific setup
> + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/debian/main.yml
> + when: ansible_os_family == 'Debian'
> +
> +- name: SuSE-specific setup
> + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/suse/main.yml
> + when: ansible_os_family == 'Suse'
> +
> +- name: Red Hat-specific setup
> + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/redhat/main.yml
> + when: ansible_os_family == 'RedHat'
> diff --git a/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml b/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
> new file mode 100644
> index 000000000000..30fb0f9b16d5
> --- /dev/null
> +++ b/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
> @@ -0,0 +1,38 @@
> +---
> +- name: Install build dependencies for git
> + become: yes
> + become_method: sudo
> + yum:
> + update_cache: yes
> + name: "{{ packages }}"
> + retries: 3
> + delay: 5
> + register: result
> + until: result.rc == 0
> + vars:
> + packages:
> + - expat-devel
> + - gcc
> + - gettext
> + - git-core
> + - libcurl-devel
> + - openssl-devel
> + - zlib-devel
> +
> +- name: Install run-time dependencies for git regression tests
> + become: yes
> + become_method: sudo
> + yum:
> + update_cache: yes
> + name: "{{ packages }}"
> + retries: 3
> + delay: 5
> + register: result
> + until: result.rc == 0
> + vars:
> + packages:
> + - cvs
> + - cvsps
> + - git-email
> + - subversion
> +# - subversion-perl
> diff --git a/playbooks/roles/gitr/tasks/install-deps/suse/main.yml b/playbooks/roles/gitr/tasks/install-deps/suse/main.yml
> new file mode 100644
> index 000000000000..0db06c5b66d0
> --- /dev/null
> +++ b/playbooks/roles/gitr/tasks/install-deps/suse/main.yml
> @@ -0,0 +1,24 @@
> +---
> +- name: Install build dependencies for git
> + become: yes
> + become_method: sudo
> + zypper:
> + name:
> + - gcc
> + - gettext
> + - git-core
> + - libcurl-devel
> + - libexpat-devel
> + - libopenssl-1_1-devel
> + state: present
> +
> +- name: Install run-time dependencies for git regression tests
> + become: yes
> + become_method: sudo
> + zypper:
> + name:
> + - cvs
> + - cvsps
> + - subversion
> + - subversion-perl
> + state: present
> diff --git a/playbooks/roles/gitr/tasks/main.yml b/playbooks/roles/gitr/tasks/main.yml
> new file mode 100644
> index 000000000000..199b3aa7f432
> --- /dev/null
> +++ b/playbooks/roles/gitr/tasks/main.yml
> @@ -0,0 +1,97 @@
> +---
> +- name: Import optional extra_args file
> + include_vars: "{{ item }}"
> + ignore_errors: yes
> + with_first_found:
> + - files:
> + - "../extra_vars.yml"
> + - "../extra_vars.yaml"
> + - "../extra_vars.json"
> + skip: true
> + tags: vars
> +
> +- name: Set the path where we collect gitr test results
> + set_fact:
> + gitr_workflow_dir: "../workflows/gitr"
> + tags: [ 'vars' ]
> +
> +- name: Clean up localhost results directory and files
> + local_action: file path="{{ gitr_workflow_dir }}/results/" state=absent
> + run_once: true
> + tags: [ 'clean_local_results' ]
> +
> +- name: Create the results directory
> + local_action: file path="{{ gitr_workflow_dir }}/results/" state=directory
> + run_once: true
> + tags: [ 'first_run' ]
> +
> +- include_role:
> + name: create_data_partition
> + tags: [ 'data_partition' ]
> +
The above role will create /data on the host, of course, but that's
probably not where you want to run the tests since it's not very
flexible.
With NFS, you'll want to create an export and mount that (like I noted
in the other email). It would probably be nice to allow it to run this
test in parallel on multiple hosts using different mount options (like
we can with fstests).
On local machines you probably want to run this test on dedicated
devices (i.e. not in /data). When testing fstests with a local fs, the
clients mount up one of their 100g block devices to a different
directory, and then create sparse files in there that are loop mounted
to create a bunch of block devices for testing different filesystem
options. It might be nice to abstract that out or copy it here.
I wonder if there is a way to make the fstests filesystem option
selection more generic, so you could reuse all of that work here? Then
you could run the gitr suite on all of the different xfs or btrfs
variants that we already have defined for fstests (for instance).
> +- include: tasks/install-deps/main.yml
> +
> +- name: Remove old git dir
> + tags: [ 'git', 'gitr' ]
> + become: yes
> + become_flags: 'su - -c'
> + become_method: sudo
> + file:
> + path: "{{ gitr_data }}"
> + state: absent
> +
> +- name: git clone git
> + tags: [ 'git', 'gitr' ]
> + git:
> + repo: "{{ gitr_git }}"
> + dest: "{{ gitr_data }}"
> + update: yes
> + version: "{{ gitr_git_tag }}"
> + retries: 3
> + delay: 5
> + register: result
> + until: not result.failed
> +
> +- name: Get nproc
> + tags: [ 'oscheck', 'gitr', 'build', 'vars' ]
> + command: "{{ num_jobs }}"
> + register: nproc
> +
> +- name: Build git
> + tags: [ 'oscheck', 'gitr', 'build' ]
> + community.general.make:
> + chdir: "{{ gitr_data }}"
> + jobs: "{{ nproc.stdout }}"
> +
> +- name: Run the git regression suite
> + tags: [ 'run_tests' ]
> + community.general.make:
> + chdir: "{{ gitr_data }}"
> + target: "test"
> + jobs: "{{ nproc.stdout }}"
> + register: gitr_out
> + ignore_errors: true
> +
> +- name: Save git regression test output
> + tags: [ 'copy_results' ]
> + copy:
> + content: "{{ gitr_out.stdout_lines|join('\n') }}"
> + dest: "{{ gitr_data }}/gitr.log"
> +
> +- name: Get used target kernel version
> + tags: [ 'copy_results' ]
> + command: "uname -r"
> + register: uname_cmd
> +
> +- name: Store kernel_rev variable
> + tags: [ 'copy_results' ]
> + set_fact:
> + kernel_rev: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}"
> + run_once: true
> +
> +- name: Copy test results over
> + tags: [ 'copy_results' ]
> + fetch:
> + src: "{{ gitr_data }}/gitr.log"
> + dest: "{{ gitr_workflow_dir }}/results/{{ kernel_rev }}.txt"
> + flat: yes
>
>
>
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 1/5] Add playbook for the git regression workflow
2023-12-12 17:52 ` Jeff Layton
@ 2023-12-12 19:23 ` Chuck Lever III
2023-12-12 20:34 ` Jeff Layton
0 siblings, 1 reply; 11+ messages in thread
From: Chuck Lever III @ 2023-12-12 19:23 UTC (permalink / raw)
To: Jeff Layton; +Cc: Chuck Lever, kdevops@lists.linux.dev
> On Dec 12, 2023, at 12:52 PM, Jeff Layton <jlayton@kernel.org> wrote:
>
> On Tue, 2023-12-12 at 11:29 -0500, Chuck Lever wrote:
>> From: Chuck Lever <chuck.lever@oracle.com>
>>
>> This workflow builds the git tool and runs its built-in regression
>> suite on the target file system. The git regression suite acts as an
>> extensive file system behavior test. This workflow runs the suite in
>> multiple threads to add timing stress to the file system under test.
>>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>> playbooks/gitr.yml | 4 +
>> playbooks/roles/gitr/defaults/main.yml | 8 ++
>> .../roles/gitr/tasks/install-deps/debian/main.yml | 28 ++++++
>> playbooks/roles/gitr/tasks/install-deps/main.yml | 13 +++
>> .../roles/gitr/tasks/install-deps/redhat/main.yml | 38 ++++++++
>> .../roles/gitr/tasks/install-deps/suse/main.yml | 24 +++++
>> playbooks/roles/gitr/tasks/main.yml | 97 ++++++++++++++++++++
>> 7 files changed, 212 insertions(+)
>> create mode 100644 playbooks/gitr.yml
>> create mode 100644 playbooks/roles/gitr/defaults/main.yml
>> create mode 100644 playbooks/roles/gitr/tasks/install-deps/debian/main.yml
>> create mode 100644 playbooks/roles/gitr/tasks/install-deps/main.yml
>> create mode 100644 playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
>> create mode 100644 playbooks/roles/gitr/tasks/install-deps/suse/main.yml
>> create mode 100644 playbooks/roles/gitr/tasks/main.yml
>>
>> diff --git a/playbooks/gitr.yml b/playbooks/gitr.yml
>> new file mode 100644
>> index 000000000000..4c3e3ba919d7
>> --- /dev/null
>> +++ b/playbooks/gitr.yml
>> @@ -0,0 +1,4 @@
>> +---
>> +- hosts: all
>> + roles:
>> + - role: gitr
>> diff --git a/playbooks/roles/gitr/defaults/main.yml b/playbooks/roles/gitr/defaults/main.yml
>> new file mode 100644
>> index 000000000000..faddb5679bc9
>> --- /dev/null
>> +++ b/playbooks/roles/gitr/defaults/main.yml
>> @@ -0,0 +1,8 @@
>> +# SPDX-License-Identifier GPL-2.0+
>> +---
>> +# Our sensible defaults for the gitr role.
>> +#
>> +# We default to not run tests.
>> +kdevops_run_gitr: False
>> +
>> +gitr_data: "{{ data_path }}/gitr"
>> diff --git a/playbooks/roles/gitr/tasks/install-deps/debian/main.yml b/playbooks/roles/gitr/tasks/install-deps/debian/main.yml
>> new file mode 100644
>> index 000000000000..50d4ba1037f3
>> --- /dev/null
>> +++ b/playbooks/roles/gitr/tasks/install-deps/debian/main.yml
>> @@ -0,0 +1,28 @@
>> +---
>> +- name: Install build dependencies for git
>> + become: yes
>> + become_method: sudo
>> + apt:
>> + name:
>> + - gcc
>> + - git-core
>> + - gettext
>> + - libcurl4-openssl-dev
>> + - libexpat1-dev
>> + - libssl-dev
>> + - libz-dev
>> + state: present
>> + update_cache: yes
>> + tags: [ 'gitr', 'deps' ]
>> +
>> +- name: Install run-time dependencies for git regression tests
>> + become: yes
>> + become_method: sudo
>> + apt:
>> + name:
>> + - cvs
>> + - cvsps
>> + - sqlite3
>> + state: present
>> + update_cache: yes
>> + tags: [ 'gitr', 'deps' ]
>> diff --git a/playbooks/roles/gitr/tasks/install-deps/main.yml b/playbooks/roles/gitr/tasks/install-deps/main.yml
>> new file mode 100644
>> index 000000000000..005bb32650bf
>> --- /dev/null
>> +++ b/playbooks/roles/gitr/tasks/install-deps/main.yml
>> @@ -0,0 +1,13 @@
>> +---
>> +# tasks to install dependencies for gitr
>> +- name: Debian-specific setup
>> + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/debian/main.yml
>> + when: ansible_os_family == 'Debian'
>> +
>> +- name: SuSE-specific setup
>> + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/suse/main.yml
>> + when: ansible_os_family == 'Suse'
>> +
>> +- name: Red Hat-specific setup
>> + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/redhat/main.yml
>> + when: ansible_os_family == 'RedHat'
>> diff --git a/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml b/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
>> new file mode 100644
>> index 000000000000..30fb0f9b16d5
>> --- /dev/null
>> +++ b/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
>> @@ -0,0 +1,38 @@
>> +---
>> +- name: Install build dependencies for git
>> + become: yes
>> + become_method: sudo
>> + yum:
>> + update_cache: yes
>> + name: "{{ packages }}"
>> + retries: 3
>> + delay: 5
>> + register: result
>> + until: result.rc == 0
>> + vars:
>> + packages:
>> + - expat-devel
>> + - gcc
>> + - gettext
>> + - git-core
>> + - libcurl-devel
>> + - openssl-devel
>> + - zlib-devel
>> +
>> +- name: Install run-time dependencies for git regression tests
>> + become: yes
>> + become_method: sudo
>> + yum:
>> + update_cache: yes
>> + name: "{{ packages }}"
>> + retries: 3
>> + delay: 5
>> + register: result
>> + until: result.rc == 0
>> + vars:
>> + packages:
>> + - cvs
>> + - cvsps
>> + - git-email
>> + - subversion
>> +# - subversion-perl
>> diff --git a/playbooks/roles/gitr/tasks/install-deps/suse/main.yml b/playbooks/roles/gitr/tasks/install-deps/suse/main.yml
>> new file mode 100644
>> index 000000000000..0db06c5b66d0
>> --- /dev/null
>> +++ b/playbooks/roles/gitr/tasks/install-deps/suse/main.yml
>> @@ -0,0 +1,24 @@
>> +---
>> +- name: Install build dependencies for git
>> + become: yes
>> + become_method: sudo
>> + zypper:
>> + name:
>> + - gcc
>> + - gettext
>> + - git-core
>> + - libcurl-devel
>> + - libexpat-devel
>> + - libopenssl-1_1-devel
>> + state: present
>> +
>> +- name: Install run-time dependencies for git regression tests
>> + become: yes
>> + become_method: sudo
>> + zypper:
>> + name:
>> + - cvs
>> + - cvsps
>> + - subversion
>> + - subversion-perl
>> + state: present
>> diff --git a/playbooks/roles/gitr/tasks/main.yml b/playbooks/roles/gitr/tasks/main.yml
>> new file mode 100644
>> index 000000000000..199b3aa7f432
>> --- /dev/null
>> +++ b/playbooks/roles/gitr/tasks/main.yml
>> @@ -0,0 +1,97 @@
>> +---
>> +- name: Import optional extra_args file
>> + include_vars: "{{ item }}"
>> + ignore_errors: yes
>> + with_first_found:
>> + - files:
>> + - "../extra_vars.yml"
>> + - "../extra_vars.yaml"
>> + - "../extra_vars.json"
>> + skip: true
>> + tags: vars
>> +
>> +- name: Set the path where we collect gitr test results
>> + set_fact:
>> + gitr_workflow_dir: "../workflows/gitr"
>> + tags: [ 'vars' ]
>> +
>> +- name: Clean up localhost results directory and files
>> + local_action: file path="{{ gitr_workflow_dir }}/results/" state=absent
>> + run_once: true
>> + tags: [ 'clean_local_results' ]
>> +
>> +- name: Create the results directory
>> + local_action: file path="{{ gitr_workflow_dir }}/results/" state=directory
>> + run_once: true
>> + tags: [ 'first_run' ]
>> +
>> +- include_role:
>> + name: create_data_partition
>> + tags: [ 'data_partition' ]
>> +
>
> The above role will create /data on the host, of course, but that's
> probably not where you want to run the tests since it's not very
> flexible.
After "make gitr" I logged into the guests and found /data
mounted there, and it was the same fstype as was selected in
the "Shared workflow data partition". And the cloned git
repo was there in /data on the guest.
> With NFS, you'll want to create an export and mount that (like I noted
> in the other email).
It seems like the selection mechanism for the fstype to test
on the guests (kdevops) ought to be a separate choice than it
is on the NFS server (kdevops-nfsd).
Say: I want nfs (with certain mount options) on kdevops and
I want nfs or btrfs or xfs or tmpfs on kdevops-nfsd.
But right now I'm focused on running on local file systems
just to keep the learning curve down to a dull roar.
> It would probably be nice to allow it to run this
> test in parallel on multiple hosts using different mount options (like
> we can with fstests).
Yes, I was thinking of doing that, but down the road.
> On local machines you probably want to run this test on dedicated
> devices (i.e. not in /data). When testing fstests with a local fs, the
> clients mount up one of their 100g block devices to a different
> directory, and then create sparse files in there that are loop mounted
> to create a bunch of block devices for testing different filesystem
> options. It might be nice to abstract that out or copy it here.
OK, that's kind of what I was asking: is using /data as the
target to test what I should be doing? Or should gitr target
something else?
If it's not /data, then I can rework that part of "make gitr" --
strip out the create_partition play and set up one of the
block devices on the guest (or set up nfs or tmpfs) by hand.
> I wonder if there is a way to make the fstests filesystem option
> selection more generic, so you could reuse all of that work here? Then
> you could run the gitr suite on all of the different xfs or btrfs
> variants that we already have defined for fstests (for instance).
I considered it, and even started doing that, but didn't feel
I had the expertise quite yet to tackle that.
>> +- include: tasks/install-deps/main.yml
>> +
>> +- name: Remove old git dir
>> + tags: [ 'git', 'gitr' ]
>> + become: yes
>> + become_flags: 'su - -c'
>> + become_method: sudo
>> + file:
>> + path: "{{ gitr_data }}"
>> + state: absent
>> +
>> +- name: git clone git
>> + tags: [ 'git', 'gitr' ]
>> + git:
>> + repo: "{{ gitr_git }}"
>> + dest: "{{ gitr_data }}"
>> + update: yes
>> + version: "{{ gitr_git_tag }}"
>> + retries: 3
>> + delay: 5
>> + register: result
>> + until: not result.failed
>> +
>> +- name: Get nproc
>> + tags: [ 'oscheck', 'gitr', 'build', 'vars' ]
>> + command: "{{ num_jobs }}"
>> + register: nproc
>> +
>> +- name: Build git
>> + tags: [ 'oscheck', 'gitr', 'build' ]
>> + community.general.make:
>> + chdir: "{{ gitr_data }}"
>> + jobs: "{{ nproc.stdout }}"
>> +
>> +- name: Run the git regression suite
>> + tags: [ 'run_tests' ]
>> + community.general.make:
>> + chdir: "{{ gitr_data }}"
>> + target: "test"
>> + jobs: "{{ nproc.stdout }}"
>> + register: gitr_out
>> + ignore_errors: true
>> +
>> +- name: Save git regression test output
>> + tags: [ 'copy_results' ]
>> + copy:
>> + content: "{{ gitr_out.stdout_lines|join('\n') }}"
>> + dest: "{{ gitr_data }}/gitr.log"
>> +
>> +- name: Get used target kernel version
>> + tags: [ 'copy_results' ]
>> + command: "uname -r"
>> + register: uname_cmd
>> +
>> +- name: Store kernel_rev variable
>> + tags: [ 'copy_results' ]
>> + set_fact:
>> + kernel_rev: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}"
>> + run_once: true
>> +
>> +- name: Copy test results over
>> + tags: [ 'copy_results' ]
>> + fetch:
>> + src: "{{ gitr_data }}/gitr.log"
>> + dest: "{{ gitr_workflow_dir }}/results/{{ kernel_rev }}.txt"
>> + flat: yes
>>
>>
>>
>
> --
> Jeff Layton <jlayton@kernel.org>
--
Chuck Lever
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH RFC 1/5] Add playbook for the git regression workflow
2023-12-12 19:23 ` Chuck Lever III
@ 2023-12-12 20:34 ` Jeff Layton
0 siblings, 0 replies; 11+ messages in thread
From: Jeff Layton @ 2023-12-12 20:34 UTC (permalink / raw)
To: Chuck Lever III; +Cc: Chuck Lever, kdevops@lists.linux.dev
On Tue, 2023-12-12 at 19:23 +0000, Chuck Lever III wrote:
>
> > On Dec 12, 2023, at 12:52 PM, Jeff Layton <jlayton@kernel.org> wrote:
> >
> > On Tue, 2023-12-12 at 11:29 -0500, Chuck Lever wrote:
> > > From: Chuck Lever <chuck.lever@oracle.com>
> > >
> > > This workflow builds the git tool and runs its built-in regression
> > > suite on the target file system. The git regression suite acts as an
> > > extensive file system behavior test. This workflow runs the suite in
> > > multiple threads to add timing stress to the file system under test.
> > >
> > > Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> > > ---
> > > playbooks/gitr.yml | 4 +
> > > playbooks/roles/gitr/defaults/main.yml | 8 ++
> > > .../roles/gitr/tasks/install-deps/debian/main.yml | 28 ++++++
> > > playbooks/roles/gitr/tasks/install-deps/main.yml | 13 +++
> > > .../roles/gitr/tasks/install-deps/redhat/main.yml | 38 ++++++++
> > > .../roles/gitr/tasks/install-deps/suse/main.yml | 24 +++++
> > > playbooks/roles/gitr/tasks/main.yml | 97 ++++++++++++++++++++
> > > 7 files changed, 212 insertions(+)
> > > create mode 100644 playbooks/gitr.yml
> > > create mode 100644 playbooks/roles/gitr/defaults/main.yml
> > > create mode 100644 playbooks/roles/gitr/tasks/install-deps/debian/main.yml
> > > create mode 100644 playbooks/roles/gitr/tasks/install-deps/main.yml
> > > create mode 100644 playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
> > > create mode 100644 playbooks/roles/gitr/tasks/install-deps/suse/main.yml
> > > create mode 100644 playbooks/roles/gitr/tasks/main.yml
> > >
> > > diff --git a/playbooks/gitr.yml b/playbooks/gitr.yml
> > > new file mode 100644
> > > index 000000000000..4c3e3ba919d7
> > > --- /dev/null
> > > +++ b/playbooks/gitr.yml
> > > @@ -0,0 +1,4 @@
> > > +---
> > > +- hosts: all
> > > + roles:
> > > + - role: gitr
> > > diff --git a/playbooks/roles/gitr/defaults/main.yml b/playbooks/roles/gitr/defaults/main.yml
> > > new file mode 100644
> > > index 000000000000..faddb5679bc9
> > > --- /dev/null
> > > +++ b/playbooks/roles/gitr/defaults/main.yml
> > > @@ -0,0 +1,8 @@
> > > +# SPDX-License-Identifier GPL-2.0+
> > > +---
> > > +# Our sensible defaults for the gitr role.
> > > +#
> > > +# We default to not run tests.
> > > +kdevops_run_gitr: False
> > > +
> > > +gitr_data: "{{ data_path }}/gitr"
> > > diff --git a/playbooks/roles/gitr/tasks/install-deps/debian/main.yml b/playbooks/roles/gitr/tasks/install-deps/debian/main.yml
> > > new file mode 100644
> > > index 000000000000..50d4ba1037f3
> > > --- /dev/null
> > > +++ b/playbooks/roles/gitr/tasks/install-deps/debian/main.yml
> > > @@ -0,0 +1,28 @@
> > > +---
> > > +- name: Install build dependencies for git
> > > + become: yes
> > > + become_method: sudo
> > > + apt:
> > > + name:
> > > + - gcc
> > > + - git-core
> > > + - gettext
> > > + - libcurl4-openssl-dev
> > > + - libexpat1-dev
> > > + - libssl-dev
> > > + - libz-dev
> > > + state: present
> > > + update_cache: yes
> > > + tags: [ 'gitr', 'deps' ]
> > > +
> > > +- name: Install run-time dependencies for git regression tests
> > > + become: yes
> > > + become_method: sudo
> > > + apt:
> > > + name:
> > > + - cvs
> > > + - cvsps
> > > + - sqlite3
> > > + state: present
> > > + update_cache: yes
> > > + tags: [ 'gitr', 'deps' ]
> > > diff --git a/playbooks/roles/gitr/tasks/install-deps/main.yml b/playbooks/roles/gitr/tasks/install-deps/main.yml
> > > new file mode 100644
> > > index 000000000000..005bb32650bf
> > > --- /dev/null
> > > +++ b/playbooks/roles/gitr/tasks/install-deps/main.yml
> > > @@ -0,0 +1,13 @@
> > > +---
> > > +# tasks to install dependencies for gitr
> > > +- name: Debian-specific setup
> > > + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/debian/main.yml
> > > + when: ansible_os_family == 'Debian'
> > > +
> > > +- name: SuSE-specific setup
> > > + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/suse/main.yml
> > > + when: ansible_os_family == 'Suse'
> > > +
> > > +- name: Red Hat-specific setup
> > > + ansible.builtin.include_tasks: roles/gitr/tasks/install-deps/redhat/main.yml
> > > + when: ansible_os_family == 'RedHat'
> > > diff --git a/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml b/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
> > > new file mode 100644
> > > index 000000000000..30fb0f9b16d5
> > > --- /dev/null
> > > +++ b/playbooks/roles/gitr/tasks/install-deps/redhat/main.yml
> > > @@ -0,0 +1,38 @@
> > > +---
> > > +- name: Install build dependencies for git
> > > + become: yes
> > > + become_method: sudo
> > > + yum:
> > > + update_cache: yes
> > > + name: "{{ packages }}"
> > > + retries: 3
> > > + delay: 5
> > > + register: result
> > > + until: result.rc == 0
> > > + vars:
> > > + packages:
> > > + - expat-devel
> > > + - gcc
> > > + - gettext
> > > + - git-core
> > > + - libcurl-devel
> > > + - openssl-devel
> > > + - zlib-devel
> > > +
> > > +- name: Install run-time dependencies for git regression tests
> > > + become: yes
> > > + become_method: sudo
> > > + yum:
> > > + update_cache: yes
> > > + name: "{{ packages }}"
> > > + retries: 3
> > > + delay: 5
> > > + register: result
> > > + until: result.rc == 0
> > > + vars:
> > > + packages:
> > > + - cvs
> > > + - cvsps
> > > + - git-email
> > > + - subversion
> > > +# - subversion-perl
> > > diff --git a/playbooks/roles/gitr/tasks/install-deps/suse/main.yml b/playbooks/roles/gitr/tasks/install-deps/suse/main.yml
> > > new file mode 100644
> > > index 000000000000..0db06c5b66d0
> > > --- /dev/null
> > > +++ b/playbooks/roles/gitr/tasks/install-deps/suse/main.yml
> > > @@ -0,0 +1,24 @@
> > > +---
> > > +- name: Install build dependencies for git
> > > + become: yes
> > > + become_method: sudo
> > > + zypper:
> > > + name:
> > > + - gcc
> > > + - gettext
> > > + - git-core
> > > + - libcurl-devel
> > > + - libexpat-devel
> > > + - libopenssl-1_1-devel
> > > + state: present
> > > +
> > > +- name: Install run-time dependencies for git regression tests
> > > + become: yes
> > > + become_method: sudo
> > > + zypper:
> > > + name:
> > > + - cvs
> > > + - cvsps
> > > + - subversion
> > > + - subversion-perl
> > > + state: present
> > > diff --git a/playbooks/roles/gitr/tasks/main.yml b/playbooks/roles/gitr/tasks/main.yml
> > > new file mode 100644
> > > index 000000000000..199b3aa7f432
> > > --- /dev/null
> > > +++ b/playbooks/roles/gitr/tasks/main.yml
> > > @@ -0,0 +1,97 @@
> > > +---
> > > +- name: Import optional extra_args file
> > > + include_vars: "{{ item }}"
> > > + ignore_errors: yes
> > > + with_first_found:
> > > + - files:
> > > + - "../extra_vars.yml"
> > > + - "../extra_vars.yaml"
> > > + - "../extra_vars.json"
> > > + skip: true
> > > + tags: vars
> > > +
> > > +- name: Set the path where we collect gitr test results
> > > + set_fact:
> > > + gitr_workflow_dir: "../workflows/gitr"
> > > + tags: [ 'vars' ]
> > > +
> > > +- name: Clean up localhost results directory and files
> > > + local_action: file path="{{ gitr_workflow_dir }}/results/" state=absent
> > > + run_once: true
> > > + tags: [ 'clean_local_results' ]
> > > +
> > > +- name: Create the results directory
> > > + local_action: file path="{{ gitr_workflow_dir }}/results/" state=directory
> > > + run_once: true
> > > + tags: [ 'first_run' ]
> > > +
> > > +- include_role:
> > > + name: create_data_partition
> > > + tags: [ 'data_partition' ]
> > > +
> >
> > The above role will create /data on the host, of course, but that's
> > probably not where you want to run the tests since it's not very
> > flexible.
>
> After "make gitr" I logged into the guests and found /data
> mounted there, and it was the same fstype as was selected in
> the "Shared workflow data partition". And the cloned git
> repo was there in /data on the guest.
>
>
>
> > With NFS, you'll want to create an export and mount that (like I noted
> > in the other email).
>
> It seems like the selection mechanism for the fstype to test
> on the guests (kdevops) ought to be a separate choice than it
> is on the NFS server (kdevops-nfsd).
>
> Say: I want nfs (with certain mount options) on kdevops and
> I want nfs or btrfs or xfs or tmpfs on kdevops-nfsd.
>
> But right now I'm focused on running on local file systems
> just to keep the learning curve down to a dull roar.
>
>
Yes. This is something that could use some work in kdevops in general.
In principle, the test that is requesting a new export could request the
underlying fstype too.
> > It would probably be nice to allow it to run this
> > test in parallel on multiple hosts using different mount options (like
> > we can with fstests).
>
> Yes, I was thinking of doing that, but down the road.
>
> > On local machines you probably want to run this test on dedicated
> > devices (i.e. not in /data). When testing fstests with a local fs, the
> > clients mount up one of their 100g block devices to a different
> > directory, and then create sparse files in there that are loop mounted
> > to create a bunch of block devices for testing different filesystem
> > options. It might be nice to abstract that out or copy it here.
>
> OK, that's kind of what I was asking: is using /data as the
> target to test what I should be doing? Or should gitr target
> something else?
>
> If it's not /data, then I can rework that part of "make gitr" --
> strip out the create_partition play and set up one of the
> block devices on the guest (or set up nfs or tmpfs) by hand.
>
The workflow more or less decides how it's going to use the storage it
has. With a locally virtualized setup, there are 4 drives total. /data
is usually "disk0".
In general /data is the place where stuff like the testcases themselves
go, in the case of fstests or pynfs and sometimes other data. The git
cloned trees go into there and then we either make install out of that
directory (fstests) or just run out it directly (pynfs).
pynfs runs locally on nfsd host (which requires /data). That means we
can't use disk0 there. There we use disk2 and disk3 as LVM PVs (and I
was thinking about scarfing up disk1 too). I think that's simpler and
more efficient than messing around with loop devices. In the future we
could probably experiment with lvmthin too.
>
> > I wonder if there is a way to make the fstests filesystem option
> > selection more generic, so you could reuse all of that work here? Then
> > you could run the gitr suite on all of the different xfs or btrfs
> > variants that we already have defined for fstests (for instance).
>
> I considered it, and even started doing that, but didn't feel
> I had the expertise quite yet to tackle that.
>
>
Understood. Baby steps are fine here, IMO.
> > > +- include: tasks/install-deps/main.yml
> > > +
> > > +- name: Remove old git dir
> > > + tags: [ 'git', 'gitr' ]
> > > + become: yes
> > > + become_flags: 'su - -c'
> > > + become_method: sudo
> > > + file:
> > > + path: "{{ gitr_data }}"
> > > + state: absent
> > > +
> > > +- name: git clone git
> > > + tags: [ 'git', 'gitr' ]
> > > + git:
> > > + repo: "{{ gitr_git }}"
> > > + dest: "{{ gitr_data }}"
> > > + update: yes
> > > + version: "{{ gitr_git_tag }}"
> > > + retries: 3
> > > + delay: 5
> > > + register: result
> > > + until: not result.failed
> > > +
> > > +- name: Get nproc
> > > + tags: [ 'oscheck', 'gitr', 'build', 'vars' ]
> > > + command: "{{ num_jobs }}"
> > > + register: nproc
> > > +
> > > +- name: Build git
> > > + tags: [ 'oscheck', 'gitr', 'build' ]
> > > + community.general.make:
> > > + chdir: "{{ gitr_data }}"
> > > + jobs: "{{ nproc.stdout }}"
> > > +
> > > +- name: Run the git regression suite
> > > + tags: [ 'run_tests' ]
> > > + community.general.make:
> > > + chdir: "{{ gitr_data }}"
> > > + target: "test"
> > > + jobs: "{{ nproc.stdout }}"
> > > + register: gitr_out
> > > + ignore_errors: true
> > > +
> > > +- name: Save git regression test output
> > > + tags: [ 'copy_results' ]
> > > + copy:
> > > + content: "{{ gitr_out.stdout_lines|join('\n') }}"
> > > + dest: "{{ gitr_data }}/gitr.log"
> > > +
> > > +- name: Get used target kernel version
> > > + tags: [ 'copy_results' ]
> > > + command: "uname -r"
> > > + register: uname_cmd
> > > +
> > > +- name: Store kernel_rev variable
> > > + tags: [ 'copy_results' ]
> > > + set_fact:
> > > + kernel_rev: "{{ uname_cmd.stdout_lines | regex_replace('\\]') | regex_replace('\\[') | replace(\"'\",'') }}"
> > > + run_once: true
> > > +
> > > +- name: Copy test results over
> > > + tags: [ 'copy_results' ]
> > > + fetch:
> > > + src: "{{ gitr_data }}/gitr.log"
> > > + dest: "{{ gitr_workflow_dir }}/results/{{ kernel_rev }}.txt"
> > > + flat: yes
> > >
> > >
> > >
> >
> > --
> > Jeff Layton <jlayton@kernel.org>
>
>
> --
> Chuck Lever
>
>
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2023-12-12 20:34 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12 16:29 [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever
2023-12-12 16:29 ` [PATCH RFC 1/5] Add playbook for the git regression workflow Chuck Lever
2023-12-12 17:52 ` Jeff Layton
2023-12-12 19:23 ` Chuck Lever III
2023-12-12 20:34 ` Jeff Layton
2023-12-12 16:30 ` [PATCH RFC 2/5] Add a workflow for the git regression suite Chuck Lever
2023-12-12 16:30 ` [PATCH RFC 3/5] gitr: Adjust the gen_hosts and gen_nodes playbooks Chuck Lever
2023-12-12 16:30 ` [PATCH RFC 4/5] Add the git regression workflow to the kdevops Makefile infrastructure Chuck Lever
2023-12-12 16:30 ` [PATCH RFC 5/5] Add skeleton documentation for the git regression workflow Chuck Lever
2023-12-12 16:47 ` [PATCH RFC 0/5] Add a git regression test workflow Chuck Lever III
2023-12-12 17:29 ` Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox