kdevops.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Chuck Lever <cel@kernel.org>,
	"kdevops@lists.linux.dev" <kdevops@lists.linux.dev>
Subject: Re: [PATCH RFC 1/5] Add playbook for the git regression workflow
Date: Tue, 12 Dec 2023 15:34:32 -0500	[thread overview]
Message-ID: <e5f4dffc0a22148c492b178bbdc2c32aa516edae.camel@kernel.org> (raw)
In-Reply-To: <735D77A5-98AE-4146-93D3-BA10699B2844@oracle.com>

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>

  reply	other threads:[~2023-12-12 20:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=e5f4dffc0a22148c492b178bbdc2c32aa516edae.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).