Skip to content

Bump base image to RHEL9 and Python version to 3.12 #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

komish
Copy link
Contributor

@komish komish commented Oct 8, 2024

Description of the change:

  • Bump the base image used in ansible-operator's container image to use UBI9 (From UBI9)
  • Bump the Python version to Python 3.12 (from Python 3.9)

Motivation for the change:

There's an active initiative to bump various software versions for the ansible-operator project to move it inline with the current state of packages that are available. This PR just focuses on bumping the UBI and be based off of RHEL9, and bumps the Python version at the same time to move away from the system's (image's) default.

The goal was to be as close to the original design as possible. Some changes to the underlying design were made with intention to minimize or simplify requirements.

Notes for reviewers

  • UBI9 comes with python 3.9 by default, available at /usr/bin/python3. Python 3.12 is installed at /usr/bin/python3.12. For this reason, you'll see modifications here adding /usr/local/bin/python3, which will be linked to python 3.12 for our use cases. This is the recommended path in RHEL9 documentation.
    • The ansible_python_interpreter in tests needed to be adjusted for this reason.
  • yum was swapped with dnf.
  • pip is no longer installed via RPM, and is instead installed using ensurepip which is available in the standard library. This is due to the fact that it didn't quite make sense to install something via the RPM, and then use pip to update it.
  • setuptools is not being installed, as it doesn't seem necessary for what we're doing.
  • The base image phase no longer installs pip or pipenv, as those are transferred over from the builder image when we copy site-packages in my testing.
  • I intend to keep pipfile.Dockerfile consistent with the contents of Dockerfile, though its existence is unclear to me.

@openshift-ci openshift-ci bot requested review from fabianvf and grokspawn October 8, 2024 22:03
@Neo2308 Neo2308 mentioned this pull request Oct 9, 2024
4 tasks
@TrilokGeer
Copy link
Contributor

TrilokGeer commented Oct 12, 2024

Using PIPENV_SYSTEM=1 will require modifications whenever there is a conflict in the base system version packages. Nevertheless, closing #92 in favour of the better implementation here.

@acornett21 acornett21 merged commit 8e08a45 into operator-framework:main Oct 15, 2024
5 checks passed
@komish
Copy link
Contributor Author

komish commented Oct 15, 2024

@TrilokGeer I know I didn't remove it as a part of this PR, but just for the record - I 100% agree. In general, I think using system python may be an explicit choice for this project, but leveraging pipenv in this way complicates things in a way I don't like. I have this noted as something to address as well (as I saw you do in similar PRs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants