Skip to content

Support wsgi on python 3.8, 3.9, 3.11 and 3.12 on rhel8#372

Open
teluq-pbrideau wants to merge 2 commits into
voxpupuli:masterfrom
teluq-pbrideau:fix/rhel8-wsgi
Open

Support wsgi on python 3.8, 3.9, 3.11 and 3.12 on rhel8#372
teluq-pbrideau wants to merge 2 commits into
voxpupuli:masterfrom
teluq-pbrideau:fix/rhel8-wsgi

Conversation

@teluq-pbrideau

@teluq-pbrideau teluq-pbrideau commented Oct 13, 2022

Copy link
Copy Markdown
Contributor

Pull Request (PR) description

As inspired by issue mentioned, this fix the install of wsgi for python 3.8 and 3.9 on rhel.
There is no need to set to specific mod_path as the packages provides the file in httpd/modules

yum provides /usr/lib64/httpd/modules/mod_wsgi_python3.so
python3-mod_wsgi-4.6.4-4.el8.x86_64 : A WSGI interface for Python web applications in Apache
Repo        : appstream
Matched from:
Filename    : /usr/lib64/httpd/modules/mod_wsgi_python3.so

python38-mod_wsgi-4.6.8-3.module+el8.4.0+570+c2eaf144.x86_64 : A WSGI interface for Python web applications in Apache
Repo        : appstream
Matched from:
Filename    : /usr/lib64/httpd/modules/mod_wsgi_python3.so

python39-mod_wsgi-4.7.1-4.module+el8.4.0+574+843c4898.x86_64 : A WSGI interface for Python web applications in Apache
Repo        : appstream
Matched from:
Filename    : /usr/lib64/httpd/modules/mod_wsgi_python3.so

I’m not a very confident test writer, but I did my best to test the changes I made. Please suggest what could be done better if you think it is required.

EDIT: as of now, following versions are supported:

  • 5.x: Python 3.8-3.11
  • 6.x: Python 3.9-3.13
    I’ve added versions supported on EL8

This Pull Request (PR) fixes the following issues

Fixes #369
Fixes #373

@teluq-pbrideau teluq-pbrideau changed the title Fix/rhel8 wsgi Support wsgi on python 3.8 and 3.9 on rhel8 Oct 13, 2022
@gdubicki gdubicki mentioned this pull request Oct 27, 2022
@gdubicki

gdubicki commented Oct 27, 2022

Copy link
Copy Markdown
Contributor

Hi @teluq-pbrideau, thanks for your contribution! I wanted to help as I have some experience with a similar thing from #370. Initially I pushed some changes directly to your branch - sorry for that! 😓 - but I reverted them now. I am doing my further experiments on it's copy, here #373.

@teluq-pbrideau

Copy link
Copy Markdown
Contributor Author

@gdubicki Thanks for what you tried, no problems.
I did install my infrastructure with different profiles for puppetdb and postgersql on my side, so i did not notice these bugs on the puppetboard class.
Maybe we should try to fix #364 and merge before merging my PR?

@teluq-pbrideau

teluq-pbrideau commented Oct 27, 2022

Copy link
Copy Markdown
Contributor Author

It seems to be a problem about upstream configuration about puppetdb itself. On my side, i’ve configured my infrastructure with

  package { 'postgresql-module':
    ensure      => '13',
    name        => 'postgresql',
    enable_only => true,
    provider    => 'dnfmodule',
  }
  class { 'puppetdb::database::postgresql' :
    listen_addresses    => '0.0.0.0',
    postgres_version    => '10',
    manage_package_repo => false,
    manage_server       => false,
    database_password   => $db_password.unwrap,
  }

as a weird hack that gets around installing correctly postgres

Is the upstream puppetdb module run the acceptance test on centos successfully?

@gdubicki

gdubicki commented Oct 27, 2022

Copy link
Copy Markdown
Contributor

(Yes, sorry @teluq-pbrideau, I moved your comment here.)

@gdubicki

gdubicki commented Oct 27, 2022

Copy link
Copy Markdown
Contributor

Is the upstream puppetdb module run the acceptance test on centos successfully?

No, but it's hard to tell why as the logs are gone, see https://github.com/puppetlabs/puppetlabs-puppetdb/actions/runs/2064063268 ....

But it seems that the default installed Postgres version is 11 (https://github.com/puppetlabs/puppetlabs-puppetdb/blob/main/manifests/params.pp#L29), while this package does not seem to exist for Centos / Redhat 8 as both our Ci logs say:

Error: /Stage[main]/Postgresql::Server::Install/Package[postgresql-server]/ensure: change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install postgresql11-server' returned 1: Error: Unable to find a match: postgresql11-server

...as well as the Postgres docs: https://www.postgresql.org/download/linux/redhat/ No, sorry I misunderstood this. There is Postgres 11 for RHEL/Centos 8, it's just not included in the distro.

@teluq-pbrideau

teluq-pbrideau commented Dec 5, 2023

Copy link
Copy Markdown
Contributor Author

Would it be possible to merge this PR now that the test pass successfully? At lest start again the process to review this?
Thanks

Nevermind, just rebase from master, and test fail, I’ll work on them

@kenyon

kenyon commented Dec 5, 2023

Copy link
Copy Markdown
Member

Only Ubuntu 18.04 is failing right now, which is an EOL OS, so you may remove support for that OS.

@teluq-pbrideau

Copy link
Copy Markdown
Contributor Author

@kenyon I’m not sure if it is the only place, I've found references on ubuntu 18.04 in metadata.json and .sync.yml, should I change something else?

@kenyon kenyon linked an issue Dec 5, 2023 that may be closed by this pull request
@kenyon

kenyon commented Dec 5, 2023

Copy link
Copy Markdown
Member

@teluq-pbrideau

Copy link
Copy Markdown
Contributor Author

Also, I see there is no acceptance test on RHEL (only on Debian and Ubuntu) and my PR is only related to RHEL.

Would it be simple to include acceptance on Rocky also? I’ve never done these kind of tests, so not sure if I really want to go down this rabbit hole, but if it is simple to add Rocky to the mix, would you be willing to help me helping this community?

@gdubicki

gdubicki commented Dec 7, 2023

Copy link
Copy Markdown
Contributor

(...) would you be willing to help me helping this community?

I would like to but apparently I don't know how as I failed to fix the tests the last time I tried.

@kenyon ?

@teluq-pbrideau

Copy link
Copy Markdown
Contributor Author

I would rather have my changes merged than to wait another year for RHEL test to be included… Could we move forward please?

Comment thread metadata.json
@teluq-pbrideau

teluq-pbrideau commented May 8, 2025

Copy link
Copy Markdown
Contributor Author

python3.6 is the version shipped with rocky8. At least, now tests successfully run, but the puppetboard github page indicate require python 3.9-3.13: https://github.com/voxpupuli/puppetboard

So Python should also be configured correctly now I guess…

@teluq-pbrideau teluq-pbrideau marked this pull request as draft May 8, 2025 14:06
@teluq-pbrideau teluq-pbrideau force-pushed the fix/rhel8-wsgi branch 3 times, most recently from 74c2ecd to b2eb724 Compare May 8, 2025 17:46
@teluq-pbrideau teluq-pbrideau changed the title Support wsgi on python 3.8 and 3.9 on rhel8 Support wsgi on python 3.8, 3.9, 3.11 and 3.12 on rhel8 May 8, 2025
fix: linter

feat: also test for OracleLinux 8 and AlmaLinux 8

fix: python 3.6 shipped with RedHat8

fix: require python3.9 on EL8

fix: support python 3.6, 3.8, 3.9, 3.11, 3.12 on EL8
test: install mod_wsgi from puppetboard::apache::conf

test: fix puppetdb dependency for postgresql on el8
@teluq-pbrideau

Copy link
Copy Markdown
Contributor Author

At last, more than 2 years later, tests run successfully!

@teluq-pbrideau teluq-pbrideau marked this pull request as ready for review May 8, 2025 18:44
@kenyon kenyon added the enhancement New feature or request label May 8, 2025

@kenyon kenyon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if the code could be deduplicated a bit, but that can be for another pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to install version 4.0.3 on RHEL 8 using python 3.9 Drop support for EOL Ubuntu 18.04

4 participants