-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat(hive): Build hive-metastore-opa-authorizer from source #1340
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
Merged
maltesander
merged 16 commits into
main
from
feat/add-and-build-opa-authorizer-from-source
Nov 17, 2025
+126
−14
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c75deb8
hive 4.0.1 is building
maltesander 4445cdd
move env var definition
maltesander 2ff0b50
added todo
maltesander 76bf2a7
3.1.3 building and working with patchable
maltesander 76b3066
use patchable for all versions
maltesander 3c49266
use non-shaded opa-authz jar for 4.x.x
maltesander ce16594
Merge branch 'main' into feat/add-and-build-opa-authorizer-from-source
maltesander a6469f8
adapted changelog
maltesander d23501c
Merge branch 'main' into feat/add-and-build-opa-authorizer-from-source
maltesander 9319470
Merge remote-tracking branch 'origin/main' into feat/add-and-build-op…
maltesander 128adf5
use local maven jars
maltesander 83b4bca
mention hive 4.0.0 removal in changelog
maltesander 44828b7
set mvn authorizer version
maltesander 604bc23
use bash shell for regex operations
maltesander 43c10b7
use bash in hive docker file
maltesander b0c26b0
fix jar names
maltesander 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
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
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
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,58 @@ | ||
| # syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7 | ||
| # check=error=true | ||
|
|
||
| FROM local-image/java-devel | ||
|
|
||
| ARG AUTHORIZER_VERSION | ||
| ARG HIVE_VERSION | ||
| ARG HADOOP_VERSION | ||
| ARG STACKABLE_USER_UID | ||
| # Setting this to anything other than "true" will keep the cache folders around (e.g. for Maven, NPM etc.) | ||
| # This can be used to speed up builds when disk space is of no concern. | ||
| ARG DELETE_CACHES="true" | ||
|
|
||
| USER ${STACKABLE_USER_UID} | ||
| WORKDIR /stackable | ||
|
|
||
| COPY --chown=${STACKABLE_USER_UID}:0 hive/hive-metastore-opa-authorizer/stackable/patches/patchable.toml /stackable/src/hive/hive-metastore-opa-authorizer/stackable/patches/patchable.toml | ||
| COPY --chown=${STACKABLE_USER_UID}:0 hive/hive-metastore-opa-authorizer/stackable/patches/${AUTHORIZER_VERSION} /stackable/src/hive/hive-metastore-opa-authorizer/stackable/patches/${AUTHORIZER_VERSION} | ||
|
|
||
| RUN <<'EOF' | ||
| set -euo pipefail | ||
|
|
||
| # for moving nested artifacts out of target folder | ||
| mkdir -p /stackable/opa-authorizer-bin | ||
| # containing sources | ||
| mkdir -p /stackable/opa-authorizer-src | ||
|
|
||
| cd "$(/stackable/patchable --images-repo-root=src checkout hive/hive-metastore-opa-authorizer ${AUTHORIZER_VERSION})" | ||
|
|
||
| # Create snapshot of the source code including custom patches | ||
| tar -czf /stackable/opa-authorizer-src/hive-metastore-opa-authorizer-${AUTHORIZER_VERSION}-hive-${HIVE_VERSION}-hadoop-${HADOOP_VERSION}-src.tar.gz . | ||
|
|
||
| # The if part can be removed once we do no longer support Hive 3.x.x | ||
| if [[ "${HIVE_VERSION}" =~ ^3 ]]; then | ||
| mvn clean package -DskipTests -Dhive.version=${HIVE_VERSION} -Dhadoop.version=${HADOOP_VERSION} -f hms-v3/pom.xml | ||
| mv hms-v3/target/com.bosch.bdps.hms3-${HIVE_VERSION}-${HADOOP_VERSION}-dev.jar /stackable/opa-authorizer-bin | ||
| else | ||
| mvn clean package -DskipTests -Dhive.version=${HIVE_VERSION} -Dhadoop.version=${HADOOP_VERSION} -f hms-v4/pom.xml | ||
|
|
||
| # The hive-metastore-opa-authorizer offers a shaded jar from version 4.x.x. Using the shaded jar leads to problems with schema tool at pod startup. | ||
| # mv hms-v4/target/com.bosch.bdps.hms4-${HIVE_VERSION}-${HADOOP_VERSION}-dev.jar /stackable/opa-authorizer-bin | ||
| mv hms-v4/target/hms4-dev.jar /stackable/opa-authorizer-bin | ||
| fi | ||
|
|
||
| # We're removing these to make the intermediate layer smaller | ||
| # This can be necessary even though it's only a builder image because the GitHub Action Runners only have very limited space available | ||
| # and we are sometimes running into errors because we're out of space. | ||
| # Therefore, we try to clean up all layers as much as possible. | ||
| if [ "${DELETE_CACHES}" = "true" ] ; then | ||
| rm -rf /stackable/.m2/repository/* | ||
| rm -rf /stackable/.npm/* | ||
| rm -rf /stackable/.cache/* | ||
| rm -rf /stackable/src | ||
| fi | ||
|
|
||
| # fix permissions | ||
| chmod --recursive g=u /stackable/opa-authorizer-bin | ||
| EOF | ||
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,26 @@ | ||
| [versions."v1.0.0-hive-3.1.3-hadoop-3.3.6".local-images] | ||
| "java-devel" = "11" | ||
|
|
||
| [versions."v1.0.0-hive-3.1.3-hadoop-3.3.6".build-arguments] | ||
| authorizer-version = "v1.0.0" | ||
| hive-version = "3.1.3" | ||
| hadoop-version = "3.3.6" | ||
| delete-caches = "true" | ||
|
|
||
| [versions."v1.0.0-hive-4.0.1-hadoop-3.3.6".local-images] | ||
| "java-devel" = "11" | ||
|
|
||
| [versions."v1.0.0-hive-4.0.1-hadoop-3.3.6".build-arguments] | ||
| authorizer-version = "v1.0.0" | ||
| hive-version = "4.0.1" | ||
| hadoop-version = "3.3.6" | ||
| delete-caches = "true" | ||
|
|
||
| [versions."v1.0.0-hive-4.1.0-hadoop-3.4.2".local-images] | ||
| "java-devel" = "17" | ||
|
|
||
| [versions."v1.0.0-hive-4.1.0-hadoop-3.4.2".build-arguments] | ||
| authorizer-version = "v1.0.0" | ||
| hive-version = "4.1.0" | ||
| hadoop-version = "3.4.2" | ||
| delete-caches = "true" |
2 changes: 2 additions & 0 deletions
2
hive/hive-metastore-opa-authorizer/stackable/patches/patchable.toml
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,2 @@ | ||
| upstream = "https://github.com/boschglobal/hive-metastore-opa-authorizer" | ||
| default-mirror = "https://github.com/stackabletech/hive-metastore-opa-authorizer" |
2 changes: 2 additions & 0 deletions
2
hive/hive-metastore-opa-authorizer/stackable/patches/v1.0.0/patchable.toml
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,2 @@ | ||
| mirror = "https://github.com/stackabletech/hive-metastore-opa-authorizer" | ||
| base = "1925fee7512d4afba4a9d83c303aa241d0e5412e" |
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.
Uh oh!
There was an error while loading. Please reload this page.