trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.32k stars 2.97k forks source link

trino-server-rpm doesn't support CentOS/RHEL 8 due to lack of unversioned python package #10743

Open sumit-gupta-sgt opened 2 years ago

sumit-gupta-sgt commented 2 years ago

When I am trying to install trino-server-rpm-368.rpm over rhel8 it always says python >= 2.4, i have python2.7 and python3.6 in my system already.

While i was using same package over centos7..everything works well.

mosabua commented 2 years ago

You need to ensure that the desired Python version is on the path for the user that you use to start the rpm with.

This might help as well. https://docs.starburst.io/starburst-enterprise/try/rpm.html#install-python

hashhar commented 2 years ago

@sumit-gupta-sgt I believe you are having errors installing the RPM itself? Can you share exactly what error RPM seems to throw when you install the rpm?

Also can you share output of rpm -qa | grep python?

Most probably RHEL8 has removed the python package and replaced it with explicit python2 and python3 packages which cause the RPM to error out since it cannot find a python package.

As a workaround you can still try to install the rpm by doing something like rpm -i --no-deps <your_rpm_file> which would ignore all listed dependencies and still work if you have the dependencies actually installed.

sumit-gupta-sgt commented 2 years ago

@hashhar @mosabua mosabuaI am using same version of python in centos7, everything work well. When i try to use trino rpm, it always says python >= 2.4 required, while i have python 2.7 and python3 in my system.

hashhar commented 2 years ago

The issue is that CentOS 8 doesn't have any package that provides python - the packages now either provide python2 or python3 so the RPM installation fails since we request python >= 2.4 which cannot be satisfied.

The only workaround at this time is:

yum install python2
sudo alternatives --set python /usr/bin/python2
rpm -i --nodeps <your_rpm_file>

I'm looking into ways to build a single RPM that would work on both RHEL 8 based as well as older systems.

hashhar commented 2 years ago

Seems like it's impossible to support both CentOS >= 8 as well as older versions with a single RPM file.

We'd need to create and distribute two different RPM files for each packaging variation. The gist is that the dependencies declared in RPM are static and cannot be conditional so we cannot alter behaviour of RPM according to what distro we are running on.

What we can do is to remove python as a dependency and provide a pre-install script that detects lack of an unversioned python executable and fails with some instructions - similar to how we do JDK detection today.

cc: @martint Any opinions? I'd prefer the similar solution that we have for JDK detection and remove python as a declared package dependency.

martint commented 2 years ago

That seems reasonable. Although, if CentOS < 8 is old and no longer supported, we might want to drop support for it altogether. If someone wants to install it in that distro, they can bypass the dependency check.

sumit-gupta-sgt commented 2 years ago

@hashhar When i try to use workaround you mentioned, looks like didn't work..python install and link looks good.

rpm -i --nodeps trino-server-rpm-368.rpm package trino-server-rpm-0:368-1.noarch does not verify: no digest

Please let me know if anything i am missing.

hashhar commented 2 years ago

Seems like you have FIPS enabled on your CentOS installation. You can skip the digest checking via --nodigest --nofiledigest options passed to rpm. Let's keep this issue focused on building CentOS/RHEL 8 compatible RPM.

You can join our Slack and continue the conversation there if you still run into issues.

sumit-gupta-sgt commented 2 years ago

@hashhar thanks let me try.

BTW when you are planning to have separate RPM ..any plan schedule ?

mosabua commented 2 years ago

I agree that it might be easier to have a script that checks for suitable python on the path. This could even be used in the tarball as well.

And on that note of tarball .. @sumit-gupta-sgt you can just use the tarball on Centos .. you just have to manually satisfy dependencies and hook up the launcher script as daemon (only if desired..)

sumit-gupta-sgt commented 2 years ago

@hashhar Quick note on command provide by you.

yum install python2 sudo alternatives --set python /usr/bin/python2 rpm -i --nodeps

Lets assume i don't have python2 in my system and trying to use python3, when i try to do sudo alternatives --set python /usr/bin/python3, Trino still says python >= 2.4 needed by trino-server-rpm.

sumit-gupta-sgt commented 2 years ago

Any plan to release rpm for RHEL8 ?

This is blocker if you don't have python2 on RHEL8.

ellieshen commented 2 years ago

@hashhar , any plan to remove python in RPM as a dependency to compatible CentOS/RHEL 8?

hashhar commented 2 years ago

Python is REQUIRED for the launcher to work. At this point we either need separate RPMs per OS version (which is not something we want to do) or have some hacky way of identifying whether expected Python version is available or not (which may or may not work on all distributions and still leaves the user to install proper Python version themselves).

These are some of the reasons why we have considered dropping the RPM as a distribution option in the past. The tarball can be used on all OSes and doesn't have any of these problems.

EDIT: I did try out adding a script that checks for suitable python but it doesn't work across all of CentOS 7/8, RHEL 7/8 and SUSE - and all that script could do is tell you python is missing but won't be able to fix it for you.