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

Upgrade to airline 2.x #17308

Closed
wants to merge 2 commits into from

Conversation

rguillome
Copy link

@rguillome rguillome commented Feb 16, 2022

Test plan - Existing TU and launch Presto Spark Launcher and Presto Cli from local environment

Depends on https://github.com/facebookexternal/presto-facebook/pull/1840

This migration remove deprecated dependency to airline 0.x version and bring new features as allowing two options to be mutualy exclusive.

Fix this issue #16236

== NO RELEASE NOTE ==

@rguillome rguillome force-pushed the migration-to-airlift-2 branch 6 times, most recently from 6289fbb to 782ce95 Compare February 17, 2022 10:32
@rguillome rguillome marked this pull request as ready for review February 17, 2022 11:07
@zacw7
Copy link
Member

zacw7 commented Feb 17, 2022

Thanks for the contribution. But Presto maintains its own airline and I don't think we are planning to adopt any forked version.

@rguillome
Copy link
Author

rguillome commented Feb 18, 2022

Hi @zacw7,

I created one year ago, an issue on presto's airline but one maintainer told me this version would be deprecated soon.
As I understood there is a conflict between 2 fork and maybe this maintainer didn't speak in the name of the presto team. Could you confirm that after looking at the issue and this comment.

If you confirm that it won't be a waste of time, I would make a PR to the presto's airline version to add the mutually exclusive option.

@zacw7
Copy link
Member

zacw7 commented Feb 22, 2022

Thanks for the explanations. Is the mutually exclusive option for presto-on-spark?

@rguillome
Copy link
Author

Yes, this mutually exclusive option is for presto-on-spark.
We need to pass a new argument to the command : query instead of file because we want to pass the query directly from the command line (see the PR #16249) in an AWS EMR use case. For now, the related PR is not convinient because we can't mutually exclude passing the argument file or query to the presto-on-spark command line.

@zacw7
Copy link
Member

zacw7 commented Feb 28, 2022

@aweisberg Ariel, do you mind taking a look and providing some insights from Presto-on-Spark perspective? Thanks!

@aweisberg aweisberg self-requested a review February 28, 2022 22:03
@aweisberg
Copy link
Contributor

aweisberg commented Feb 28, 2022

Thanks for the contribution. But Presto maintains its own airline and I don't think we are planning to adopt any forked version.

Oddly enough it looks like we never deployed the forked version? I think it would be fine to upgrade assuming no bugs/compatibility issues. It's just going from one version of the dependency we don't own to another.

I'll do a real review tomorrow.

@rguillome
Copy link
Author

Hi @aweisberg

Are changes ok for you ?

@aweisberg
Copy link
Contributor

Sorry been very busy. At a high level yes, but I need to test it. I have a hard time knowing what these ignored class patterns are about, and the exclusion for Jakarta and whether it is safe. Nothing ever seems safe with Java dependencies.

@rguillome
Copy link
Author

rguillome commented Mar 17, 2022

Thanks for the feedback !

Yes I should commit these ignored-class-patterns appart in a separate commit in order to indicate why they were mandatory. I didn't find a better way to avoid duplicate-finder-maven-plugin complaining about the "file" META-INF.versions.9.module-info present twice in airline-io and airline jars.

Excluding Jakarta is for the same reason: to avoid duplication of several classes between the new "Jakarta" jar vs the old-javax one. Jakarta had a bad time (before its 2.x version) where they kept the same package name as the javax one.
At the end, I chose to had as less impact as possible with the existant so keeping only the javax.inject:javax.inject jars seemed to be the safer solution.
But I 'm going to ask airline why they don't migrate on jakarta 2.x. Using a different package name should avoid to exclude the jakarta jar from the airline dependency.

@aweisberg
Copy link
Contributor

aweisberg commented Mar 20, 2022

META-INF.versions.9.module-info seems to be an issue with the duplicate finder plugin. Instead of putting the exclusion in everywhere it would be better to add it to the root pom or even the base pom in airlift.

It looks like there are already quite a few https://github.com/prestodb/airbase/blob/master/airbase/pom.xml
FYI we have our own airbase fork that I just linked to.

@aweisberg
Copy link
Contributor

Created prestodb/airbase#20 to add the duplicate-finder exclusion to airbase. We can remove it from the Presto poms.

@aweisberg
Copy link
Contributor

Airbase 103 is out now.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 22, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: rguillome / name: Guillaume Renaudin (782ce9597e69582621b6d71f1ef5150b77df88e1, d85be1c2d4ccce3d9d7bc5af92cff9e62603f7ab)

@rguillome
Copy link
Author

@aweisberg this is updated. I just kept the exclusion on presto-spark-testing/pom.xml since it needs a redefinition of the duplicate-finder-plugin.

@aweisberg
Copy link
Contributor

Can you clean up the history? So first commit should just be upgrade airbase, second commit would be the functional upgrade to airline 2.x. Then I can approve.

@rguillome
Copy link
Author

It's done @aweisberg !

Copy link
Contributor

@aweisberg aweisberg left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

I don't think this needs a release note because it isn't a user visible change.

@rschlussel
Copy link
Contributor

Can you test that there are no changes with --help for the cli? Looks like the way that is generated has changed a bit with airline 2.x, so want to confirm that it still works as expected.

@rguillome
Copy link
Author

rguillome commented Mar 31, 2022

Hi @rschlussel

I checked differences between my branch and the current master one for presto-cli --help and presto-spark-launcher --help

As I can see, the only differences are :

  • some options are not at the same line. For example, on master for presto-cli --help, I see two lines for
                [--client-tags <client tags>] [--debug] [--disable-compression]

                [--execute <execute>] [--extra-credential <extra-credential>...]
                [(-f <file> | --file <file>)] [(-h | --help)]

while on this migration-to-airlift-2 branch, I see 4 lines

                [ --client-tags <client tags> ] [ --debug ]
                [ --disable-compression ] [ --execute <execute> ]
                [ --extra-credential <extra-credential>... ]
                [ {-f | --file} <file> ] [ {-h | --help} ]

But there are exactly the same number of options with the same names

  • Space are added after the opening square brackets and before the closing square brackets. Ex :
    [--client-tags <client tags>] => [ --client-tags <client tags> ]
  • brackets are replaced by curl brackets when having choices for option Ex:
    [(-h | --help)]=> [ {-h | --help} ]
  • on presto-spark-launcher there is a change, in the master version, the -c option is required in the help, while in the airline2 it's coherent with the others options : there are indicated as optional
    (-c <file> | --config <file>) => [ {-c | --config} <file> ]
    That brings up the point : why all required arguments are indicated as optional by the help ? The following example indicates that it should appears without square brackets in the help : https://rvesse.github.io/airline/guide/restrictions/index.html (breaking with the current CLI help message)

@rschlussel
Copy link
Contributor

The multiple lines thing is fine, but would be good to fix the issue with required arguments not showing up correctly.

@highker highker removed their request for review April 9, 2022 06:40
@wanglinsong wanglinsong requested review from shrinidhijoshi and a team as code owners July 6, 2024 04:32
@elharo
Copy link
Contributor

elharo commented Sep 17, 2024

stale, closing due to conflicts

@elharo elharo closed this Sep 17, 2024
@rguillome
Copy link
Author

rguillome commented Oct 13, 2024

It could have been better to ask for a rebase and maybe to integrate the fix about required arguments than closing the PR. I think upgrading to airline 2.x should be a good move for prestodb !

@tdcmeehan
Copy link
Contributor

@rguillome please feel free to reopen after you have fixed the merge conflicts and incorporate @rschlussel's suggestions, we'll be happy to review once you do.

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.

6 participants