public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, kdevops@lists.linux.dev
Subject: Re: [PATCH RFC 1/5] Add playbook for the git regression workflow
Date: Tue, 12 Dec 2023 12:52:58 -0500	[thread overview]
Message-ID: <46dd5e395eba02e71a2a321fdad33cc09fa436a7.camel@kernel.org> (raw)
In-Reply-To: <170239859866.465055.695373279749357532.stgit@renoir.1015granger.net>

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>

  reply	other threads:[~2023-12-12 17:53 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 [this message]
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

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=46dd5e395eba02e71a2a321fdad33cc09fa436a7.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=cel@kernel.org \
    --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