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

fix(hbase): remove dependency on htrace #820

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
- vector: Remove version `0.39.0` ([#802]).
- airflow: Remove versions `2.6.3`, `2.8.1`, `2.8.4` ([#809]).
- kafka: Remove versions `3.4.1`, `3.6.1`, `3.6.2` ([#813]).
- hbase: Reorganize folder structure to allow patching Phoenix, exclude old `jackson-databind` dependency from Phoenix SNAPSHOT ([#820])

### Fixed

Expand All @@ -27,6 +28,7 @@ All notable changes to this project will be documented in this file.
[#809]: https://github.com/stackabletech/docker-images/pull/809
[#811]: https://github.com/stackabletech/docker-images/pull/811
[#813]: https://github.com/stackabletech/docker-images/pull/813
[#820]: https://github.com/stackabletech/docker-images/pull/820

## [24.7.0] - 2024-07-24

Expand Down
14 changes: 6 additions & 8 deletions hbase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ RUN --mount=type=cache,id=maven-hbase-${PRODUCT},uid=1000,target=/stackable/.m2/
###
curl --fail -L "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/
/stackable/patches/apply_patches.sh /stackable/patches/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!
Expand Down Expand Up @@ -222,12 +219,15 @@ ARG DELETE_CACHES="true"
USER stackable
WORKDIR /stackable

COPY --chown=stackable:stackable hbase/stackable/patches /stackable/patches

RUN --mount=type=cache,id=maven-phoenix,uid=1000,target=/stackable/.m2/repository <<EOF
cd /stackable
curl --fail -L "https://repo.stackable.tech/repository/packages/phoenix/phoenix-${PHOENIX}-src.tar.gz" | tar -xzC .
mv phoenix-${PHOENIX} phoenix-${PHOENIX}-src
cd /stackable/phoenix-${PHOENIX}-src/
/stackable/patches/apply_patches.sh /stackable/patches/phoenix/${PHOENIX}

# 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 \
Expand All @@ -237,15 +237,13 @@ mvn \
-Dhbase.profile=${HBASE_PROFILE} \
-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
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
ln -s "/stackable/phoenix-${HBASE_PROFILE}-${PHOENIX}-bin" /stackable/phoenix


Expand Down
20 changes: 13 additions & 7 deletions hbase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,34 @@ As of SDP 24.7 we do include HBase 2.6 support in an experimental state.

## Phoenix

At the time of this writing (July 12, 2024) there is no Phoenix release that supports HBase 2.6 so the script `upload_new_phoenix_version.sh` will not work.
At the time of this writing (August 29, 2024) there is no Phoenix release that supports HBase 2.6 so the script `upload_new_phoenix_version.sh` will not work.

HBase 2.6 support [was added](https://github.com/apache/phoenix/pull/1793) with [PHOENIX-7172](https://issues.apache.org/jira/browse/PHOENIX-7172).
SDP 24.7 includes Phoenix built from the master branch from commit [4afe457](https://github.com/apache/phoenix/tree/4afe4579bb3ab01725e4939746d0b7b807b438ac).

Prepare the Phoenix source tarball:

```bash
# clone the Phoenix repo
git clone [email protected]:apache/phoenix.git
cd phoenix
git checkout 4afe457
git checkout master
# Save the commit ID of the patched Phoenix version for later
COMMIT_ID=$(git rev-parse --short HEAD) # ca21a87dd6

# create a tarball
mkdir ../phoenix-5.3.0-4afe457
git archive --format=tar --output ../phoenix-5.3.0-4afe457/phoenix.tar 4afe457
cd ../phoenix-5.3.0-4afe457
mkdir "../phoenix-5.3.0-$COMMIT_ID"
git archive --format=tar --output "../phoenix-5.3.0-$COMMIT_ID/phoenix.tar" "$COMMIT_ID"
cd "../phoenix-5.3.0-$COMMIT_ID"
tar xf phoenix.tar
rm phoenix.tar
echo 4afe457 > git-commit
echo "$COMMIT_ID" > git-commit
cd ..
tar -c phoenix-5.3.0-4afe457 | gzip > phoenix-5.3.0-4afe457-src.tar.gz
tar -c "phoenix-5.3.0-$COMMIT_ID" | gzip > "phoenix-5.3.0-$COMMIT_ID-src.tar.gz"
```

Upload it to the packages/phoenix folder in Nexus.

## HBase operator tools

Repository: [hbase-operator-tools](https://github.com/apache/hbase-operator-tools)
Expand Down
9 changes: 4 additions & 5 deletions hbase/stackable/patches/apply_patches.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
set -eu
set -o pipefail

# Check if $1 (VERSION) is provided
# Check if $1 (patch directory) is provided
if [ -z "${1-}" ]; then
echo "Please provide a value for VERSION as the first argument."
echo "Please provide a value for patch directory as the first argument."
exit 1
fi

VERSION="$1"
PATCH_DIR="patches/$VERSION"
PATCH_DIR="$1"

# Check if version-specific patches directory exists
if [ ! -d "$PATCH_DIR" ]; then
Expand All @@ -34,7 +33,7 @@ echo "Found ${#patch_files[@]} patches, applying now"
# Iterate through sorted patch files
for patch_file in "${patch_files[@]}"; do
echo "Applying $patch_file"
git apply --directory "hbase-${VERSION}-src" "$patch_file" || {
git apply "$patch_file" || {
echo "Failed to apply $patch_file"
exit 1
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/phoenix-core-client/pom.xml b/phoenix-core-client/pom.xml
index f711b0f6fd..360d1b7150 100644
--- a/phoenix-core-client/pom.xml
+++ b/phoenix-core-client/pom.xml
@@ -366,6 +366,12 @@
<dependency>
<groupId>org.apache.htrace</groupId>
<artifactId>htrace-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
diff --git a/phoenix-core-server/pom.xml b/phoenix-core-server/pom.xml
index d5032ece29..49daed0de4 100644
--- a/phoenix-core-server/pom.xml
+++ b/phoenix-core-server/pom.xml
@@ -131,6 +131,12 @@
<dependency>
<groupId>org.apache.htrace</groupId>
<artifactId>htrace-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
diff --git a/pom.xml b/pom.xml
index bce239830f..e8e7badcb8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1585,6 +1585,12 @@
<groupId>org.apache.htrace</groupId>
<artifactId>htrace-core</artifactId>
<version>${htrace.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
Loading