Skip to content
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

Dockerfile: switch to virtualenv #418

Conversation

fcami
Copy link
Contributor

@fcami fcami commented Jun 16, 2022

Installing any RPM-packaged Python application will pull Python 3.6
on RHEL8/Streams8 because 3.6 is the system default.
This, in turn, will break building the ods-ci container because ods-ci
has been using Python 3.7 features since ff7ac1f.

virtualenv ( https://virtualenv.pypa.io/en/latest/ ) should be used
instead of the venv module to force Python's version to 3.8 instead
of the RHEL8/Streams8 default 3.6.

Fixes: #406

Installing any RPM-packaged Python application will pull Python 3.6
on RHEL8/Streams8 because 3.6 is the system default.
This, in turn, will break building the ods-ci container because ods-ci
has been using Python 3.7 features since ff7ac1f.

virtualenv ( https://virtualenv.pypa.io/en/latest/ ) should be used
instead of the venv module to force Python's version to 3.8 instead
of the RHEL8/Streams8 default 3.6.

Fixes: red-hat-data-services#406
Signed-off-by: François Cami <[email protected]>
@fcami
Copy link
Contributor Author

fcami commented Jun 16, 2022

Reproducers: either:

  • add "s3cmd" to the dnf command line in the Dockerfile
  • add a "dnf -y install s3cmd" invocation after creating the venv.

@fcami fcami mentioned this pull request Jun 16, 2022
@kpouget
Copy link
Contributor

kpouget commented Jun 16, 2022

+1

here is a simple reproducer, showing how installing a Python package "breaks" the default mapping of python3

[root@281af3cc9a67 ci-artifacts]# python3 --version
bash: python3: command not found
[root@281af3cc9a67 ci-artifacts]# dnf install -y --quiet python3.8

Installed:
  python38-3.8.12-1.module_el8.6.0+929+89303463.x86_64            python38-libs-3.8.12-1.module_el8.6.0+929+89303463.x86_64             python38-pip-19.3.1-5.module_el8.6.0+960+f11a9b17.noarch python38-pip-wheel-19.3.1-5.module_el8.6.0+960+f11a9b17.noarch
  python38-setuptools-41.6.0-5.module_el8.6.0+929+89303463.noarch python38-setuptools-wheel-41.6.0-5.module_el8.6.0+929+89303463.noarch

[root@281af3cc9a67 ci-artifacts]# python3 --version
Python 3.8.12 (default, Sep 21 2021, 00:10:52)
[root@281af3cc9a67 ci-artifacts]# dnf -y install --quiet https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Installed:
  epel-release-8-15.el8.noarch

[root@281af3cc9a67 ci-artifacts]# dnf install -y --quiet s3cmd

Installed:
  file-5.33-20.el8.x86_64  platform-python-pip-9.0.3-22.el8.noarch  python3-magic-5.33-20.el8.noarch  python3-pip-9.0.3-22.el8.noarch  python3-setuptools-39.2.0-6.el8.noarch  python36-3.6.8-38.module_el8.5.0+895+a459eca8.x86_64  s3cmd-2.2.0-2.el8.noarch

[root@281af3cc9a67 ci-artifacts]# python3 --version
Python 3.6.8 (default, Mar 25 2022, 11:15:52)

@jgarciao jgarciao added enhancements Bugfixes, enhancements, refactoring, ... in tests or libraries (PR will be listed in release-notes) do not merge Do not merge this yet please labels Jun 16, 2022
@fcami
Copy link
Contributor Author

fcami commented Jul 5, 2022

Hi @bdattoma @jgarciao @tarukumar could you take a second look please? The above makes ods-ci more robust to system changes.

@bdattoma
Copy link
Contributor

we couldn't find time and priority for these changes. I'm closing this PR. Thanks for the suggested changes, we might apply them in the future!

@bdattoma bdattoma closed this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Do not merge this yet please enhancements Bugfixes, enhancements, refactoring, ... in tests or libraries (PR will be listed in release-notes)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dockerfile installs Python 3.6 but uses 3.8
4 participants