public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/2] nfstest: add git-core to the list of install dependencies
@ 2024-04-24 21:15 Scott Mayhew
  2024-04-24 21:15 ` [PATCH 2/2] nfstest: fix another RHEL 8-ism Scott Mayhew
  2024-04-24 21:19 ` [PATCH 1/2] nfstest: add git-core to the list of install dependencies Chuck Lever
  0 siblings, 2 replies; 7+ messages in thread
From: Scott Mayhew @ 2024-04-24 21:15 UTC (permalink / raw)
  To: kdevops

Currently git-core won't be installed if you're running nfstest as a
dedicated workflow.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 playbooks/roles/nfstest/vars/Debian.yml | 1 +
 playbooks/roles/nfstest/vars/RedHat.yml | 1 +
 playbooks/roles/nfstest/vars/Suse.yml   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/playbooks/roles/nfstest/vars/Debian.yml b/playbooks/roles/nfstest/vars/Debian.yml
index cb4cfe5..05d87a2 100644
--- a/playbooks/roles/nfstest/vars/Debian.yml
+++ b/playbooks/roles/nfstest/vars/Debian.yml
@@ -3,3 +3,4 @@ nfstest_packages:
   - nfs-common
   - python-is-python3
   - tcpdump
+  - git-core
diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
index d8c65fb..a14c20e 100644
--- a/playbooks/roles/nfstest/vars/RedHat.yml
+++ b/playbooks/roles/nfstest/vars/RedHat.yml
@@ -3,3 +3,4 @@ nfstest_packages:
   - nfs-utils
   - python-unversioned-command
   - tcpdump
+  - git-core
diff --git a/playbooks/roles/nfstest/vars/Suse.yml b/playbooks/roles/nfstest/vars/Suse.yml
index 35fcc8e..76adc4d 100644
--- a/playbooks/roles/nfstest/vars/Suse.yml
+++ b/playbooks/roles/nfstest/vars/Suse.yml
@@ -2,3 +2,4 @@
 nfstest_packages:
   - nfs-utils
   - tcpdump
+  - git-core
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] nfstest: fix another RHEL 8-ism
  2024-04-24 21:15 [PATCH 1/2] nfstest: add git-core to the list of install dependencies Scott Mayhew
@ 2024-04-24 21:15 ` Scott Mayhew
  2024-04-24 21:21   ` Chuck Lever
  2024-04-24 21:19 ` [PATCH 1/2] nfstest: add git-core to the list of install dependencies Chuck Lever
  1 sibling, 1 reply; 7+ messages in thread
From: Scott Mayhew @ 2024-04-24 21:15 UTC (permalink / raw)
  To: kdevops

RHEL 8 doesn't have the python-unversioned-command package.  So we'll
install python-unversioned-command on RHEL/CentOS 9 and higher, and on
RHEL/CentOS 8 and lower we'll set up the /usr/bin/python symlink via
the 'alternatives' command.

I'm not doing any special checking on Fedora, which has had the
python-unversioned-command package since F29.  I'm assuming anyone using
kdevops to run nfstest on Fedora is going to be using a much more recent
version.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 playbooks/roles/nfstest/tasks/main.yml  | 19 +++++++++++++++++++
 playbooks/roles/nfstest/vars/RedHat.yml |  1 -
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
index 1ccd247..d0f7d18 100644
--- a/playbooks/roles/nfstest/tasks/main.yml
+++ b/playbooks/roles/nfstest/tasks/main.yml
@@ -23,6 +23,14 @@
         - 'vars'
   tags: vars
 
+- name: Add python-unversioned-command to list of nfstest packages
+  ansible.builtin.set_fact:
+    nfstest_packages: "{{ nfstest_packages + ['python-unversioned-command'] }}"
+  when:
+    - ansible_facts['os_family']|lower == 'redhat'
+    - ansible_facts['distribution_major_version'] | int >= 9
+  tags: vars
+
 - name: Install dependencies for nfstest
   become: true
   become_flags: 'su - -c'
@@ -32,6 +40,17 @@
     state: present
   tags: nfstest
 
+- name: Set /usr/bin/python symlink
+  become: true
+  become_flags: 'su - -c'
+  become_method: ansible.builtin.sudo
+  ansible.builtin.shell:
+    cmd: alternatives --set python /usr/bin/python3
+  when:
+    - ansible_facts['os_family']|lower == 'redhat'
+    - ansible_facts['distribution_major_version'] | int <= 8
+  tags: nfstest
+
 - name: Create the /data mount point on the target nodes
   ansible.builtin.include_role:
     name: create_data_partition
diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
index a14c20e..76adc4d 100644
--- a/playbooks/roles/nfstest/vars/RedHat.yml
+++ b/playbooks/roles/nfstest/vars/RedHat.yml
@@ -1,6 +1,5 @@
 ---
 nfstest_packages:
   - nfs-utils
-  - python-unversioned-command
   - tcpdump
   - git-core
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] nfstest: add git-core to the list of install dependencies
  2024-04-24 21:15 [PATCH 1/2] nfstest: add git-core to the list of install dependencies Scott Mayhew
  2024-04-24 21:15 ` [PATCH 2/2] nfstest: fix another RHEL 8-ism Scott Mayhew
@ 2024-04-24 21:19 ` Chuck Lever
  2024-04-24 21:50   ` Scott Mayhew
  1 sibling, 1 reply; 7+ messages in thread
From: Chuck Lever @ 2024-04-24 21:19 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: kdevops

On Wed, Apr 24, 2024 at 05:15:10PM -0400, Scott Mayhew wrote:
> Currently git-core won't be installed if you're running nfstest as a
> dedicated workflow.

I don't think it's the "dedicated workflow" that's the problem,
because I use that all the time. I think I have the "Install
kernel developer tools" option set or something like that, and
that pulls in git, trace-cmd, and other stuff.

But, OK... this is a real dependency for nfstest, so:

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>


> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> ---
>  playbooks/roles/nfstest/vars/Debian.yml | 1 +
>  playbooks/roles/nfstest/vars/RedHat.yml | 1 +
>  playbooks/roles/nfstest/vars/Suse.yml   | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/playbooks/roles/nfstest/vars/Debian.yml b/playbooks/roles/nfstest/vars/Debian.yml
> index cb4cfe5..05d87a2 100644
> --- a/playbooks/roles/nfstest/vars/Debian.yml
> +++ b/playbooks/roles/nfstest/vars/Debian.yml
> @@ -3,3 +3,4 @@ nfstest_packages:
>    - nfs-common
>    - python-is-python3
>    - tcpdump
> +  - git-core
> diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
> index d8c65fb..a14c20e 100644
> --- a/playbooks/roles/nfstest/vars/RedHat.yml
> +++ b/playbooks/roles/nfstest/vars/RedHat.yml
> @@ -3,3 +3,4 @@ nfstest_packages:
>    - nfs-utils
>    - python-unversioned-command
>    - tcpdump
> +  - git-core
> diff --git a/playbooks/roles/nfstest/vars/Suse.yml b/playbooks/roles/nfstest/vars/Suse.yml
> index 35fcc8e..76adc4d 100644
> --- a/playbooks/roles/nfstest/vars/Suse.yml
> +++ b/playbooks/roles/nfstest/vars/Suse.yml
> @@ -2,3 +2,4 @@
>  nfstest_packages:
>    - nfs-utils
>    - tcpdump
> +  - git-core
> -- 
> 2.44.0
> 
> 

-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] nfstest: fix another RHEL 8-ism
  2024-04-24 21:15 ` [PATCH 2/2] nfstest: fix another RHEL 8-ism Scott Mayhew
@ 2024-04-24 21:21   ` Chuck Lever
  2024-04-24 22:00     ` Scott Mayhew
  0 siblings, 1 reply; 7+ messages in thread
From: Chuck Lever @ 2024-04-24 21:21 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: kdevops

On Wed, Apr 24, 2024 at 05:15:11PM -0400, Scott Mayhew wrote:
> RHEL 8 doesn't have the python-unversioned-command package.  So we'll
> install python-unversioned-command on RHEL/CentOS 9 and higher, and on
> RHEL/CentOS 8 and lower we'll set up the /usr/bin/python symlink via
> the 'alternatives' command.
> 
> I'm not doing any special checking on Fedora, which has had the
> python-unversioned-command package since F29.  I'm assuming anyone using
> kdevops to run nfstest on Fedora is going to be using a much more recent
> version.

It seems like other workflows have python dependencies like this.
Would it be better to put this logic in a common role?


> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> ---
>  playbooks/roles/nfstest/tasks/main.yml  | 19 +++++++++++++++++++
>  playbooks/roles/nfstest/vars/RedHat.yml |  1 -
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
> index 1ccd247..d0f7d18 100644
> --- a/playbooks/roles/nfstest/tasks/main.yml
> +++ b/playbooks/roles/nfstest/tasks/main.yml
> @@ -23,6 +23,14 @@
>          - 'vars'
>    tags: vars
>  
> +- name: Add python-unversioned-command to list of nfstest packages
> +  ansible.builtin.set_fact:
> +    nfstest_packages: "{{ nfstest_packages + ['python-unversioned-command'] }}"
> +  when:
> +    - ansible_facts['os_family']|lower == 'redhat'
> +    - ansible_facts['distribution_major_version'] | int >= 9
> +  tags: vars
> +
>  - name: Install dependencies for nfstest
>    become: true
>    become_flags: 'su - -c'
> @@ -32,6 +40,17 @@
>      state: present
>    tags: nfstest
>  
> +- name: Set /usr/bin/python symlink
> +  become: true
> +  become_flags: 'su - -c'
> +  become_method: ansible.builtin.sudo
> +  ansible.builtin.shell:
> +    cmd: alternatives --set python /usr/bin/python3
> +  when:
> +    - ansible_facts['os_family']|lower == 'redhat'
> +    - ansible_facts['distribution_major_version'] | int <= 8
> +  tags: nfstest
> +
>  - name: Create the /data mount point on the target nodes
>    ansible.builtin.include_role:
>      name: create_data_partition
> diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
> index a14c20e..76adc4d 100644
> --- a/playbooks/roles/nfstest/vars/RedHat.yml
> +++ b/playbooks/roles/nfstest/vars/RedHat.yml
> @@ -1,6 +1,5 @@
>  ---
>  nfstest_packages:
>    - nfs-utils
> -  - python-unversioned-command
>    - tcpdump
>    - git-core
> -- 
> 2.44.0
> 
> 

-- 
Chuck Lever

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] nfstest: add git-core to the list of install dependencies
  2024-04-24 21:19 ` [PATCH 1/2] nfstest: add git-core to the list of install dependencies Chuck Lever
@ 2024-04-24 21:50   ` Scott Mayhew
  0 siblings, 0 replies; 7+ messages in thread
From: Scott Mayhew @ 2024-04-24 21:50 UTC (permalink / raw)
  To: Chuck Lever; +Cc: kdevops

On Wed, 24 Apr 2024, Chuck Lever wrote:

> On Wed, Apr 24, 2024 at 05:15:10PM -0400, Scott Mayhew wrote:
> > Currently git-core won't be installed if you're running nfstest as a
> > dedicated workflow.
> 
> I don't think it's the "dedicated workflow" that's the problem,
> because I use that all the time. I think I have the "Install
> kernel developer tools" option set or something like that, and
> that pulls in git, trace-cmd, and other stuff.

Ah, maybe that's it.  I have some workflows running where I'm not
building the kernel, so I'm not installing the kernel developer tools.
I'm just installing the latest RHEL8/RHEL9 nightlies and running tests,
and those are where I'm seeing the problem.

I'll tweak the commit message.

-Scott
> 
> But, OK... this is a real dependency for nfstest, so:
> 
> Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
> 
> 
> > Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> > ---
> >  playbooks/roles/nfstest/vars/Debian.yml | 1 +
> >  playbooks/roles/nfstest/vars/RedHat.yml | 1 +
> >  playbooks/roles/nfstest/vars/Suse.yml   | 1 +
> >  3 files changed, 3 insertions(+)
> > 
> > diff --git a/playbooks/roles/nfstest/vars/Debian.yml b/playbooks/roles/nfstest/vars/Debian.yml
> > index cb4cfe5..05d87a2 100644
> > --- a/playbooks/roles/nfstest/vars/Debian.yml
> > +++ b/playbooks/roles/nfstest/vars/Debian.yml
> > @@ -3,3 +3,4 @@ nfstest_packages:
> >    - nfs-common
> >    - python-is-python3
> >    - tcpdump
> > +  - git-core
> > diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
> > index d8c65fb..a14c20e 100644
> > --- a/playbooks/roles/nfstest/vars/RedHat.yml
> > +++ b/playbooks/roles/nfstest/vars/RedHat.yml
> > @@ -3,3 +3,4 @@ nfstest_packages:
> >    - nfs-utils
> >    - python-unversioned-command
> >    - tcpdump
> > +  - git-core
> > diff --git a/playbooks/roles/nfstest/vars/Suse.yml b/playbooks/roles/nfstest/vars/Suse.yml
> > index 35fcc8e..76adc4d 100644
> > --- a/playbooks/roles/nfstest/vars/Suse.yml
> > +++ b/playbooks/roles/nfstest/vars/Suse.yml
> > @@ -2,3 +2,4 @@
> >  nfstest_packages:
> >    - nfs-utils
> >    - tcpdump
> > +  - git-core
> > -- 
> > 2.44.0
> > 
> > 
> 
> -- 
> Chuck Lever
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] nfstest: fix another RHEL 8-ism
  2024-04-24 21:21   ` Chuck Lever
@ 2024-04-24 22:00     ` Scott Mayhew
  2024-04-24 22:52       ` Chuck Lever III
  0 siblings, 1 reply; 7+ messages in thread
From: Scott Mayhew @ 2024-04-24 22:00 UTC (permalink / raw)
  To: Chuck Lever; +Cc: kdevops

On Wed, 24 Apr 2024, Chuck Lever wrote:

> On Wed, Apr 24, 2024 at 05:15:11PM -0400, Scott Mayhew wrote:
> > RHEL 8 doesn't have the python-unversioned-command package.  So we'll
> > install python-unversioned-command on RHEL/CentOS 9 and higher, and on
> > RHEL/CentOS 8 and lower we'll set up the /usr/bin/python symlink via
> > the 'alternatives' command.
> > 
> > I'm not doing any special checking on Fedora, which has had the
> > python-unversioned-command package since F29.  I'm assuming anyone using
> > kdevops to run nfstest on Fedora is going to be using a much more recent
> > version.
> 
> It seems like other workflows have python dependencies like this.
> Would it be better to put this logic in a common role?

Actually it depends on whether any of those workflows are using commands
like 'python somescript.py'.  On a quick scan, I don't see anything.
But if there were, they could probably just be changed to use 'python3
somescript.py' (is anyone using python2 any more?).

The original nfstest patches that you posted had a step that was doing
'python setup.py build', and that's what I was tripping on, which
prompted me to suggest installing the python-unversioned-command
package.

But in the patches that you committed, you're just running nfstest
directly from the git dir (which BTW is the way I've always run nfstest
manually in the past).  So I don't think we even need the
python-unversioned-command package any more, and maybe we can just
yank it.  I'll do some testing.

-Scott

> 
> 
> > Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> > ---
> >  playbooks/roles/nfstest/tasks/main.yml  | 19 +++++++++++++++++++
> >  playbooks/roles/nfstest/vars/RedHat.yml |  1 -
> >  2 files changed, 19 insertions(+), 1 deletion(-)
> > 
> > diff --git a/playbooks/roles/nfstest/tasks/main.yml b/playbooks/roles/nfstest/tasks/main.yml
> > index 1ccd247..d0f7d18 100644
> > --- a/playbooks/roles/nfstest/tasks/main.yml
> > +++ b/playbooks/roles/nfstest/tasks/main.yml
> > @@ -23,6 +23,14 @@
> >          - 'vars'
> >    tags: vars
> >  
> > +- name: Add python-unversioned-command to list of nfstest packages
> > +  ansible.builtin.set_fact:
> > +    nfstest_packages: "{{ nfstest_packages + ['python-unversioned-command'] }}"
> > +  when:
> > +    - ansible_facts['os_family']|lower == 'redhat'
> > +    - ansible_facts['distribution_major_version'] | int >= 9
> > +  tags: vars
> > +
> >  - name: Install dependencies for nfstest
> >    become: true
> >    become_flags: 'su - -c'
> > @@ -32,6 +40,17 @@
> >      state: present
> >    tags: nfstest
> >  
> > +- name: Set /usr/bin/python symlink
> > +  become: true
> > +  become_flags: 'su - -c'
> > +  become_method: ansible.builtin.sudo
> > +  ansible.builtin.shell:
> > +    cmd: alternatives --set python /usr/bin/python3
> > +  when:
> > +    - ansible_facts['os_family']|lower == 'redhat'
> > +    - ansible_facts['distribution_major_version'] | int <= 8
> > +  tags: nfstest
> > +
> >  - name: Create the /data mount point on the target nodes
> >    ansible.builtin.include_role:
> >      name: create_data_partition
> > diff --git a/playbooks/roles/nfstest/vars/RedHat.yml b/playbooks/roles/nfstest/vars/RedHat.yml
> > index a14c20e..76adc4d 100644
> > --- a/playbooks/roles/nfstest/vars/RedHat.yml
> > +++ b/playbooks/roles/nfstest/vars/RedHat.yml
> > @@ -1,6 +1,5 @@
> >  ---
> >  nfstest_packages:
> >    - nfs-utils
> > -  - python-unversioned-command
> >    - tcpdump
> >    - git-core
> > -- 
> > 2.44.0
> > 
> > 
> 
> -- 
> Chuck Lever
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] nfstest: fix another RHEL 8-ism
  2024-04-24 22:00     ` Scott Mayhew
@ 2024-04-24 22:52       ` Chuck Lever III
  0 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever III @ 2024-04-24 22:52 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: kdevops@lists.linux.dev



> On Apr 24, 2024, at 6:00 PM, Scott Mayhew <smayhew@redhat.com> wrote:
> 
> On Wed, 24 Apr 2024, Chuck Lever wrote:
> 
>> On Wed, Apr 24, 2024 at 05:15:11PM -0400, Scott Mayhew wrote:
>>> RHEL 8 doesn't have the python-unversioned-command package.  So we'll
>>> install python-unversioned-command on RHEL/CentOS 9 and higher, and on
>>> RHEL/CentOS 8 and lower we'll set up the /usr/bin/python symlink via
>>> the 'alternatives' command.
>>> 
>>> I'm not doing any special checking on Fedora, which has had the
>>> python-unversioned-command package since F29.  I'm assuming anyone using
>>> kdevops to run nfstest on Fedora is going to be using a much more recent
>>> version.
>> 
>> It seems like other workflows have python dependencies like this.
>> Would it be better to put this logic in a common role?
> 
> Actually it depends on whether any of those workflows are using commands
> like 'python somescript.py'.  On a quick scan, I don't see anything.
> But if there were, they could probably just be changed to use 'python3
> somescript.py' (is anyone using python2 any more?).
> 
> The original nfstest patches that you posted had a step that was doing
> 'python setup.py build', and that's what I was tripping on, which
> prompted me to suggest installing the python-unversioned-command
> package.
> 
> But in the patches that you committed, you're just running nfstest
> directly from the git dir (which BTW is the way I've always run nfstest
> manually in the past).  So I don't think we even need the
> python-unversioned-command package any more, and maybe we can just
> yank it.  I'll do some testing.

Yeah, one of the distros I was testing just before I committed
these patches just didn't have a clean way to manage the
python2 v. python3 thing (I think it was OpenSuSE) so I just
punted and went with running the tests directly.

I'd like to see nfstest get a little better at dealing with
the differences in the way Python installation works on
each distro. Maybe I'll bring that up during tomorrow's BoF.


--
Chuck Lever



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-04-24 22:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-24 21:15 [PATCH 1/2] nfstest: add git-core to the list of install dependencies Scott Mayhew
2024-04-24 21:15 ` [PATCH 2/2] nfstest: fix another RHEL 8-ism Scott Mayhew
2024-04-24 21:21   ` Chuck Lever
2024-04-24 22:00     ` Scott Mayhew
2024-04-24 22:52       ` Chuck Lever III
2024-04-24 21:19 ` [PATCH 1/2] nfstest: add git-core to the list of install dependencies Chuck Lever
2024-04-24 21:50   ` Scott Mayhew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox