-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: move patch apply logic to patchable #1032
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
Merged
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a2509c3
wip
dervoeti ee787fe
Merge branch 'main' of https://github.com/stackabletech/docker-images…
dervoeti 48e0345
Update druid/Dockerfile
dervoeti 21fbd88
fix: remove unnecessary check / shadow repo root var
dervoeti 5fa3620
fix: druid src path
dervoeti 75f8990
fix: druid src path
dervoeti bdc6dfd
feat: introduce stackable-devel image
dervoeti 597ec11
fix: use PathBuf in ProductVersionContext
dervoeti 0293728
chore: align zookeeper patch directory structure
dervoeti 455e2fa
fix: stackable-devel dnf and shell config
dervoeti 70360f2
chore: switch patch process in other products
dervoeti 1b02ecf
fix: hive build
dervoeti abd2a55
Merge branch 'main' of https://github.com/stackabletech/docker-images…
dervoeti de74bde
fix: trino build
dervoeti e17b727
fix: spark build
dervoeti df556a5
Merge branch 'main' of https://github.com/stackabletech/docker-images…
dervoeti 3019af4
chore: make hadolint happy
dervoeti 65a8ef9
fix: remove hbase intermediate sources / remove unnecessary and operator
dervoeti 0a92081
chore: remove product sources in subshell
dervoeti eb83aba
fix: permissions in patchable build process
dervoeti 237d275
Merge branch 'main' of https://github.com/stackabletech/docker-images…
dervoeti 92327a9
Merge branch 'main' of https://github.com/stackabletech/docker-images…
dervoeti 245f135
Merge branch 'main' of https://github.com/stackabletech/docker-images…
dervoeti d11d061
chore: remove unnecessary curl command in build process
dervoeti 8dbf055
chore: move adding of JMX config and start-metastore script from buil…
dervoeti 92b43bf
chore: remove git repo in trino and hbase-operator-tools to avoid mav…
dervoeti 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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -26,7 +26,7 @@ COPY hbase/licenses /licenses | |
USER ${STACKABLE_USER_UID} | ||
WORKDIR /stackable | ||
|
||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/patches /stackable/patches | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/patches/${PRODUCT} /stackable/src/hbase/stackable/patches/${PRODUCT} | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/jmx/config${JMX_EXPORTER} /stackable/jmx | ||
|
||
# Cache mounts are owned by root by default | ||
|
@@ -44,21 +44,18 @@ RUN --mount=type=cache,id=maven-hbase-${PRODUCT},uid=${STACKABLE_USER_UID},targe | |
### | ||
### HBase | ||
### | ||
curl "https://repo.stackable.tech/repository/packages/hbase/hbase-${PRODUCT}-src.tar.gz" | tar -xzC . | ||
mv hbase-${PRODUCT} hbase-${PRODUCT}-src | ||
|
||
chmod +x patches/apply_patches.sh | ||
patches/apply_patches.sh ${PRODUCT} | ||
|
||
cd /stackable/hbase-${PRODUCT}-src/ | ||
cd "$(/stackable/patchable --images-repo-root=src checkout hbase ${PRODUCT})" | ||
|
||
# The release scripts of HBase also run the build twice (three times in fact, once again to build the site which we skip here). | ||
# I chose to replicate that exact behavior for consistency so please don't merge the two mvn runs into one unless you really know what you're doing! | ||
mvn --batch-mode --no-transfer-progress -Dhadoop.profile=3.0 -Dhadoop-three.version=${HADOOP} clean install -DskipTests | ||
mvn --batch-mode --no-transfer-progress -Dhadoop.profile=3.0 -Dhadoop-three.version=${HADOOP} install assembly:single -DskipTests -Dcheckstyle.skip=true -Prelease | ||
tar -xzf hbase-assembly/target/hbase-${PRODUCT}-bin.tar.gz -C /stackable/ | ||
mv hbase-assembly/target/bom.json /stackable/hbase-${PRODUCT}/hbase-${PRODUCT}.cdx.json | ||
rm -rf /stackable/hbase-${PRODUCT}-src | ||
|
||
# Remove sources | ||
(cd .. && rm -r ${PRODUCT}) | ||
dervoeti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ln -s "/stackable/hbase-${PRODUCT}" /stackable/hbase | ||
|
||
### | ||
|
@@ -145,8 +142,7 @@ ARG DELETE_CACHES="true" | |
# so that they are not expanded. Disabling ShellCheck rules in a Dockerfile | ||
# does not work, so please ignore the according warning (SC2016). | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/bin/hbck2.env /stackable/bin/ | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/hbase-operator-tools/stackable/patches /stackable/patches | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/patches/apply_patches.sh /stackable/patches | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/hbase-operator-tools/stackable/patches/${HBASE_OPERATOR_TOOLS} /stackable/src/hbase-operator-tools/stackable/patches/${HBASE_OPERATOR_TOOLS} | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/bin/hbase-entrypoint.sh /stackable/bin/ | ||
|
||
USER ${STACKABLE_USER_UID} | ||
|
@@ -155,30 +151,32 @@ WORKDIR /stackable | |
# Cache mounts are owned by root by default | ||
# We need to explicitly give the uid to use | ||
RUN --mount=type=cache,id=maven-hbase-operator-tools-${HBASE_OPERATOR_TOOLS},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF | ||
|
||
curl --fail "https://repo.stackable.tech/repository/packages/hbase-operator-tools/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}-src.tar.gz" | tar -xzC . | ||
mv hbase-operator-tools-${HBASE_OPERATOR_TOOLS} hbase-operator-tools-${HBASE_OPERATOR_TOOLS}-src | ||
chmod +x patches/apply_patches.sh | ||
patches/apply_patches.sh ${HBASE_OPERATOR_TOOLS} hbase-operator-tools-${HBASE_OPERATOR_TOOLS}-src | ||
cd "$(/stackable/patchable --images-repo-root=src checkout hbase-operator-tools ${HBASE_OPERATOR_TOOLS})" | ||
cd hbase-hbck2 | ||
git init | ||
git config user.email "[email protected]" | ||
git config user.name "Fake commiter" | ||
git commit --allow-empty --message "Fake commit, so that we can create a tag" | ||
git tag ${HBASE_OPERATOR_TOOLS} | ||
cd .. | ||
dervoeti marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
mvn \ | ||
--batch-mode \ | ||
--no-transfer-progress \ | ||
-Dhbase.version=${PRODUCT} \ | ||
-Dhbase-thirdparty.version=${HBASE_THIRDPARTY} \ | ||
-DskipTests \ | ||
-fhbase-operator-tools-${HBASE_OPERATOR_TOOLS}-src \ | ||
package assembly:single | ||
|
||
# We need the "*" here as the directory won't be the same as the final tar file for SNAPSHOTs which we currently have to use for 2.6 | ||
# And we're stripping the top level directory while extracting because it may be called different than the folder name when it's a SNAPSHOT | ||
mkdir /stackable/hbase-operator-tools-${HBASE_OPERATOR_TOOLS} | ||
tar -xz \ | ||
-f hbase-operator-tools-${HBASE_OPERATOR_TOOLS}-src/hbase-operator-tools-assembly/target/hbase-operator-tools-*-bin.tar.gz \ | ||
-f hbase-operator-tools-assembly/target/hbase-operator-tools-*-bin.tar.gz \ | ||
-C /stackable/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}/ \ | ||
--strip-components=1 | ||
mv hbase-operator-tools-${HBASE_OPERATOR_TOOLS}-src/hbase-operator-tools-assembly/target/bom.json /stackable/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}.cdx.json | ||
rm -rf /stackable/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}-src | ||
mv hbase-operator-tools-assembly/target/bom.json /stackable/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}/hbase-operator-tools-${HBASE_OPERATOR_TOOLS}.cdx.json | ||
(cd .. && rm -r ${HBASE_OPERATOR_TOOLS}) | ||
|
||
envsubst '${PRODUCT}:${HBASE_OPERATOR_TOOLS}' < /stackable/bin/hbck2.env > /stackable/bin/hbck2 | ||
chmod +x /stackable/bin/hbck2 | ||
|
@@ -246,20 +244,13 @@ ARG STACKABLE_USER_UID | |
# This can be used to speed up builds when disk space is of no concern. | ||
ARG DELETE_CACHES="true" | ||
|
||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/phoenix/stackable/patches /stackable/patches | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/stackable/patches/apply_patches.sh /stackable/patches | ||
COPY --chown=${STACKABLE_USER_UID}:0 hbase/phoenix/stackable/patches/${PHOENIX} /stackable/src/phoenix/stackable/patches/${PHOENIX} | ||
USER ${STACKABLE_USER_UID} | ||
WORKDIR /stackable | ||
|
||
RUN --mount=type=cache,id=maven-phoenix-${PHOENIX},uid=${STACKABLE_USER_UID},target=/stackable/.m2/repository <<EOF | ||
cd /stackable | ||
curl --fail "https://repo.stackable.tech/repository/packages/phoenix/phoenix-${PHOENIX}-src.tar.gz" | tar -xzC . | ||
mv phoenix-${PHOENIX} phoenix-${PHOENIX}-src | ||
cd "$(/stackable/patchable --images-repo-root=src checkout phoenix ${PHOENIX})" | ||
|
||
chmod +x patches/apply_patches.sh | ||
patches/apply_patches.sh ${PHOENIX} phoenix-${PHOENIX}-src | ||
|
||
# Passing "-f" means it'll build in the phoenix source directory without cding into it | ||
# The Maven command can be found inside of the scripts in the create-release folder (release-util.sh as of Phoenix 5.2.0) | ||
# https://github.com/apache/phoenix/tree/5.2.0/dev/create-release | ||
mvn \ | ||
|
@@ -270,16 +261,17 @@ mvn \ | |
-Dhadoop.version=${HADOOP} \ | ||
-DskipTests \ | ||
-Dcheckstyle.skip=true \ | ||
-fphoenix-${PHOENIX}-src \ | ||
clean \ | ||
package | ||
|
||
# We need the "*" here as the directory won't be the same as the final tar file for SNAPSHOTs which we currently have to use for 2.6 | ||
# And we're stripping the top level directory while extracting because it may be called different than the folder name when it's a SNAPSHOT | ||
mkdir /stackable/phoenix-${HBASE_PROFILE}-${PHOENIX}-bin | ||
tar -xz -f phoenix-${PHOENIX}-src/phoenix-assembly/target/phoenix-hbase-*-bin.tar.gz -C /stackable/phoenix-${HBASE_PROFILE}-${PHOENIX}-bin/ --strip-components=1 | ||
mv phoenix-${PHOENIX}-src/phoenix-assembly/target/bom.json /stackable/phoenix-${HBASE_PROFILE}-${PHOENIX}-bin/phoenix-${HBASE_PROFILE}-${PHOENIX}.cdx.json | ||
rm -rf /stackable/phoenix-${PHOENIX}-src | ||
tar -xz -f phoenix-assembly/target/phoenix-hbase-*-bin.tar.gz -C /stackable/phoenix-${HBASE_PROFILE}-${PHOENIX}-bin/ --strip-components=1 | ||
mv phoenix-assembly/target/bom.json /stackable/phoenix-${HBASE_PROFILE}-${PHOENIX}-bin/phoenix-${HBASE_PROFILE}-${PHOENIX}.cdx.json | ||
|
||
# Remove sources | ||
(cd .. && rm -r ${PHOENIX}) | ||
ln -s "/stackable/phoenix-${HBASE_PROFILE}-${PHOENIX}-bin" /stackable/phoenix | ||
|
||
# We're removing these to make the intermediate layer smaller | ||
|
This file was deleted.
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.
Uh oh!
There was an error while loading. Please reload this page.