-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29756: Beeline native installer added, native images compatibili… #6652
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
Open
illiabarbashov-sketch
wants to merge
18
commits into
apache:master
Choose a base branch
from
illiabarbashov-sketch:HIVE-29666_beeline_native
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+700
−5
Open
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bf78755
HIVE-29756: Beeline native installer added, native images compatibili…
illiabarbashov-sketch df5a3f8
HIVE-29666: pom xml formatted
illiabarbashov-sketch 16c97b7
HIVE-29666: windows github runner fixed
illiabarbashov-sketch c62a4d8
HIVE-29666: windows github runner fixed
illiabarbashov-sketch a47d3a8
HIVE-29666: windows github runner fixed
illiabarbashov-sketch 8697de5
HIVE-29666: macos 13 runner timeout added
illiabarbashov-sketch 6eb1f76
HIVE-29666: windows jpackage flag for console app
illiabarbashov-sketch 9b3b3ba
Merge branch 'apache:master' into HIVE-29666_beeline_native
illiabarbashov-sketch 8eaaad5
HIVE-29666: msi installer added
illiabarbashov-sketch a8e9e3f
Merge branch 'HIVE-29666_beeline_native' of github.com:illiabarbashov…
illiabarbashov-sketch 9b83954
HIVE-29666: msi installer added
illiabarbashov-sketch e0c1025
HIVE-29666: windows installer improvements
illiabarbashov-sketch e4d4dd2
HIVE-29666: windows installer improvements
illiabarbashov-sketch bba5606
HIVE-29666: windows installer improvements
illiabarbashov-sketch b54944c
HIVE-29666: address comments
illiabarbashov-sketch 0c0db4a
HIVE-29666: address comments
illiabarbashov-sketch 076d2be
HIVE-29666: address comments
illiabarbashov-sketch 1a42fca
HIVE-29666: address comments
illiabarbashov-sketch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Beeline Native Installer Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| release_tag: | ||
| description: 'GitHub release tag to upload artifacts to. Leave empty to skip release upload.' | ||
| required: false | ||
| default: '' | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: macos-13 | ||
| label: macos-x64 | ||
| artifact_glob: beeline/target/installer/x64/*.dmg | ||
| - os: macos-latest | ||
| label: macos-arm64 | ||
| artifact_glob: beeline/target/installer/arm64/*.dmg | ||
| - os: ubuntu-latest | ||
| label: linux-x64 | ||
| artifact_glob: beeline/target/installer/x64/*.deb | ||
| - os: windows-latest | ||
| label: windows-x64 | ||
| artifact_glob: beeline/target/installer/x64/*.msi | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| # Bounds total job time (queue + execution). Notably guards against macos-13 | ||
| # runner-pool starvation as GitHub drains its capacity ahead of deprecation. | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up JDK 21 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '21' | ||
| distribution: temurin | ||
| cache: maven | ||
|
|
||
| - name: Disable WSL bash stub so Git Bash wins (Windows only) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| $stub = "C:\Windows\System32\bash.exe" | ||
| if (Test-Path $stub) { | ||
| Write-Host "Taking ownership of $stub" | ||
| takeown.exe /F $stub /A | Out-Null | ||
| icacls.exe $stub /grant "*S-1-5-32-544:F" | Out-Null # Administrators group SID | ||
| Rename-Item -Path $stub -NewName "bash.exe.disabled" -Force | ||
| } | ||
| "C:\Program Files\Git\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
| Write-Host "bash now resolves to:" | ||
| where.exe bash | ||
| bash --version | ||
|
|
||
| - name: Build Beeline installer | ||
| run: mvn package -pl beeline -am -DskipTests -P native-installer | ||
|
|
||
| - name: Upload installer artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: beeline-${{ matrix.label }} | ||
| path: ${{ matrix.artifact_glob }} | ||
| if-no-files-found: error | ||
|
|
||
| - name: Upload installer to GitHub release | ||
| if: ${{ inputs.release_tag != '' }} | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ inputs.release_tag }} | ||
| files: ${{ matrix.artifact_glob }} | ||
| allow_updates: true | ||
| fail_on_unmatched_files: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| <name>Hive Beeline</name> | ||
| <properties> | ||
| <hive.path.to.root>..</hive.path.to.root> | ||
| <jpackage.plugin.version>4.3.0</jpackage.plugin.version> | ||
| </properties> | ||
| <dependencies> | ||
| <!-- dependencies are always listed in sorted order by groupId, artifactId --> | ||
|
|
@@ -68,10 +69,10 @@ | |
| </dependency> | ||
| <dependency> | ||
| <!-- | ||
| Since the compile-time hive-jdbc dependency contains Utils.java, | ||
| which directly imports HiveSQLException from hive-service, | ||
| hive-service is also required at runtime and should therefore be declared as a compile-time dependency. | ||
| --> | ||
| Since the compile-time hive-jdbc dependency contains Utils.java, | ||
| which directly imports HiveSQLException from hive-service, | ||
| hive-service is also required at runtime and should therefore be declared as a compile-time dependency. | ||
| --> | ||
| <groupId>org.apache.hive</groupId> | ||
| <artifactId>hive-service</artifactId> | ||
| <version>${project.version}</version> | ||
|
|
@@ -147,7 +148,7 @@ | |
| <!-- | ||
| hive-exec, hive-llap-server, and hive-hplsql are declared test scope here so that | ||
| are all needed to run BeelineCli test to manage the embedded HS2 session. | ||
| --> | ||
| --> | ||
| <dependency> | ||
| <groupId>org.apache.hive</groupId> | ||
| <artifactId>hive-exec</artifactId> | ||
|
|
@@ -242,6 +243,111 @@ | |
| </dependency> | ||
| </dependencies> | ||
| <profiles> | ||
| <!-- | ||
| Build a native installer (dmg on macOS, exe/msi on Windows, deb/rpm on Linux). | ||
|
|
||
| Usage: | ||
| mvn package -pl beeline -am -DskipTests -P native-installer | ||
|
|
||
| Output (arch sub-directory so x64 and arm64 artifacts coexist): | ||
| beeline/target/installer/x64/beeline-4.3.0.dmg (Intel Mac) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
| beeline/target/installer/arm64/beeline-4.3.0.dmg (Apple Silicon — macos-arm64 auto-activates) | ||
| beeline/target/installer/x64/beeline-4.3.0.exe (Windows) | ||
| beeline/target/installer/x64/beeline_4.3.0_amd64.deb (Linux) | ||
| --> | ||
| <profile> | ||
| <id>native-installer</id> | ||
| <properties> | ||
| <!-- jpackage requires version as 1-3 integers separated by dots --> | ||
| <installer.app.version>${jpackage.plugin.version}</installer.app.version> | ||
| <!-- Default architecture label; overridden to arm64 by the macos-arm64 profile --> | ||
| <installer.arch>x64</installer.arch> | ||
| </properties> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-antrun-plugin</artifactId> | ||
| <executions> | ||
| <execution> | ||
| <id>jpackage</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>run</goal> | ||
| </goals> | ||
| <configuration> | ||
| <target> | ||
| <mkdir dir="${project.build.directory}/installer/${installer.arch}"/> | ||
| <exec executable="jpackage" failonerror="true"> | ||
| <!-- Application identity --> | ||
| <arg value="--name"/> | ||
| <arg value="beeline"/> | ||
| <arg value="--app-version"/> | ||
| <arg value="${installer.app.version}"/> | ||
| <arg value="--vendor"/> | ||
| <arg value="Apache Software Foundation"/> | ||
| <arg value="--description"/> | ||
| <arg value="Apache Hive Beeline SQL client"/> | ||
| <!-- Input: the self-contained fat jar --> | ||
| <arg value="--input"/> | ||
| <arg value="${project.build.directory}"/> | ||
| <arg value="--main-jar"/> | ||
| <arg value="beeline-standalone.jar"/> | ||
| <arg value="--main-class"/> | ||
| <arg value="org.apache.hive.beeline.BeeLine"/> | ||
| <!-- Output: arch-specific subdirectory so x64 and arm64 coexist --> | ||
| <arg value="--dest"/> | ||
| <arg value="${project.build.directory}/installer/${installer.arch}"/> | ||
| <arg line="${jpackage.platform.args}"/> | ||
| <!-- | ||
| jpackage picks the native format automatically: | ||
| macOS → dmg (x64 on Intel, arm64 on Apple Silicon) | ||
| Windows → exe | ||
| Linux → deb | ||
| To force a specific type, add: | ||
| <arg value="- -type"/> <arg value="pkg"/> | ||
| --> | ||
| </exec> | ||
| </target> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </profile> | ||
| <!-- | ||
| Auto-detects Apple Silicon and sets installer.arch=arm64. | ||
| Declared AFTER native-installer so its property value wins over the x64 | ||
| default when both profiles are active simultaneously on Apple Silicon. | ||
| No -P flag needed — activates automatically via os.name=Mac OS X + os.arch=aarch64. | ||
| --> | ||
| <profile> | ||
| <id>macos-arm64-installer</id> | ||
| <activation> | ||
| <os> | ||
| <name>Mac OS X</name> | ||
| <arch>aarch64</arch> | ||
| </os> | ||
| </activation> | ||
| <properties> | ||
| <installer.arch>arm64</installer.arch> | ||
| </properties> | ||
| </profile> | ||
| <!-- | ||
| Auto-activates on Windows. | ||
| --> | ||
| <profile> | ||
| <id>windows-installer</id> | ||
| <activation> | ||
| <os> | ||
| <family>windows</family> | ||
| </os> | ||
| </activation> | ||
| <properties> | ||
| <jpackage.platform.args>--win-console --type msi --win-dir-chooser --win-menu --win-menu-group "Apache Hive" --win-shortcut-prompt --win-help-url https://hive.apache.org/ --license-file ${project.basedir}/../LICENSE --resource-dir ${project.basedir}/src/main/jpackage/windows</jpackage.platform.args> | ||
| </properties> | ||
| </profile> | ||
| <profile> | ||
| <id>sources</id> | ||
| <build> | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we reuse the existing
-Pdistprofile here?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we would need this? I mean, if we just rename native-isntaller to dist profile for beeline, wouldn't it triggered the jpackage native app on every nightly build? I thought it was something to avoid. Current hive building command, to what I know, is
mvn install -Dtest=noMatches -Pdist -pl packaging -amBeeline currently doesn't have dist profile so it's just get built with the install command. If we change native-installer profile to dist the earlier hive build command will propagate the dist profile to beeline and jpackage will get activated. And we should be sure that Jenkins agent is able to run that. Also this will extend the time for nightly build.