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

Check Python version on application launch #393

Merged
merged 11 commits into from
Aug 9, 2024

Conversation

dgaliffiAMD
Copy link
Collaborator

@dgaliffiAMD dgaliffiAMD commented Aug 2, 2024

On RHEL8, Omniperf fails to load after installing via the RPM package, because the default python3 installed is version 3.6.

RPM-build changes the "shebang" from #!/usr/bin/env python3 to #!/usr/libexec/platform-python, which interfered with setting virtual environments through conda.

Added an additional dependency check on launch. Just before we check for the PIP dependencies, we will now check the version of python being used. If it is less than 3.8, then output a more readable message, rather than a cryptic import failure that is currently seen.

Add a note to our "install via package manager" section in documentation.

Also, fixed some python linter warnings.

Internal ticket SWDEV-477233.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
@dgaliffiAMD dgaliffiAMD requested a review from a team as a code owner August 2, 2024 19:01
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
This was breaking the "tarball" workflow.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
docs/install/core-install.rst Show resolved Hide resolved
Copy link
Contributor

@skyreflectedinmirrors skyreflectedinmirrors left a comment

Choose a reason for hiding this comment

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

Looks mostly good, a few minor tweaks suggested

docs/install/core-install.rst Outdated Show resolved Hide resolved
docs/install/core-install.rst Outdated Show resolved Hide resolved
src/omniperf Outdated Show resolved Hide resolved
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Recommend `python3 -m pip <...>` instead, to ensure the version of `pip`
used is the same as the version of `python3` that will be use run
omniperf.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Copy link
Contributor

@skyreflectedinmirrors skyreflectedinmirrors left a comment

Choose a reason for hiding this comment

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

LGTM!

@dgaliffiAMD dgaliffiAMD merged commit 011ce17 into amd-staging Aug 9, 2024
10 checks passed
@dgaliffiAMD dgaliffiAMD deleted the amd/dgaliffi/python-version-check branch August 9, 2024 19:02
dgaliffiAMD added a commit that referenced this pull request Aug 13, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.


* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
lajagapp pushed a commit to lajagapp/omniperf that referenced this pull request Aug 14, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
dgaliffiAMD added a commit that referenced this pull request Aug 19, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.


* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
coleramos425 pushed a commit that referenced this pull request Sep 25, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.


* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
coleramos425 pushed a commit that referenced this pull request Sep 27, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.


* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 16, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 17, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 19, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 19, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 19, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 19, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
xuchen-amd pushed a commit to xuchen-amd/omniperf that referenced this pull request Oct 22, 2024
* Check that the minimum required Python (3.8) version is used.

Prints a descriptive error message, rather than a cryptic import
failure, if minimum Python version is not met.

Internal ticket SWDEV-477233.

* Disable the RPM mangling of shebangs.

The are changing the `#!/usr/bin/python3` to `#!/usr/libexec/platform-python`.
With this set, omniperf is always using the platform installed version
of python, which is python 3.6 on RHEL 8. Using virtual environments,
like conda, did not work.

* Fix pylint issues

---------

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Signed-off-by: xuchen-amd <xuchen@amd.com>
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