Skip to content

Commit 06062de

Browse files
authored
HBASE-29465 [hbase-thirdparty] Update yetus to a newer version(#144)
- Upgrades yetus to `0.15.0`, making required changes in sync with hbase main repo - Improves error handling and logging of wrapper maven script - Unrelated changes: Fix typos and git urls Signed-off-by: Duo Zhang <zhangduo@apache.org>
1 parent fd76b1e commit 06062de

File tree

7 files changed

+80
-27
lines changed

7 files changed

+80
-27
lines changed

dev-support/jenkins/Dockerfile

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update && \
3636
wget='1.21.2-*' \
3737
shellcheck='0.8.0-*' \
3838
patch='2.7.6-*' \
39+
libxml2-dev='2.9.13+dfsg-*' \
40+
libxml2-utils='2.9.13+dfsg-*' \
3941
&& \
4042
apt-get clean && \
4143
rm -rf /var/lib/apt/lists/* \
@@ -110,14 +112,56 @@ ENV MAVEN_HOME='/opt/maven'
110112
RUN mv /opt/maven/bin/mvn /opt/maven/bin/mvn-original && \
111113
cat > /opt/maven/bin/mvn <<'EOF'
112114
#!/bin/bash
113-
TOOLCHAIN="${BASEDIR}/dev-support/toolchains-jenkins.xml"
114-
if [ -f "$TOOLCHAIN" ]; then
115+
116+
echo "Maven wrapper called with args: $@"
117+
echo "Current working directory: $(pwd)"
118+
echo "BASEDIR environment variable: ${BASEDIR:-'(not set)'}"
119+
echo "MAVEN_HOME: ${MAVEN_HOME:-'(not set)'}"
120+
121+
# Ensure Maven home exists
122+
if [ ! -d "${MAVEN_HOME}" ]; then
123+
echo "ERROR: MAVEN_HOME directory does not exist: ${MAVEN_HOME}"
124+
exit 1
125+
fi
126+
127+
if [ ! -f "${MAVEN_HOME}/bin/mvn-original" ]; then
128+
echo "ERROR: mvn-original not found at: ${MAVEN_HOME}/bin/mvn-original"
129+
exit 1
130+
fi
131+
132+
# Try multiple possible locations for the toolchains file
133+
TOOLCHAIN_LOCATIONS=(
134+
"${BASEDIR}/dev-support/toolchains-jenkins.xml"
135+
"$(pwd)/dev-support/toolchains-jenkins.xml"
136+
"./dev-support/toolchains-jenkins.xml"
137+
"../dev-support/toolchains-jenkins.xml"
138+
)
139+
140+
TOOLCHAIN=""
141+
for location in "${TOOLCHAIN_LOCATIONS[@]}"; do
142+
echo "Checking for toolchains file at: $location"
143+
if [ -f "$location" ]; then
144+
TOOLCHAIN="$location"
145+
echo "Found toolchains file at: $TOOLCHAIN"
146+
break
147+
fi
148+
done
149+
150+
if [ -n "$TOOLCHAIN" ]; then
115151
echo "Added: -t ${TOOLCHAIN} to mvn flags!"
116-
exec ${MAVEN_HOME}/bin/mvn-original "$@" -t "$TOOLCHAIN"
152+
echo "Executing: ${MAVEN_HOME}/bin/mvn-original $@ -t $TOOLCHAIN"
153+
"${MAVEN_HOME}/bin/mvn-original" "$@" -t "$TOOLCHAIN"
154+
exit_code=$?
117155
else
118-
echo "Unexpected: ${TOOLCHAIN} file is missing!"
119-
exec ${MAVEN_HOME}/bin/mvn-original "$@"
156+
echo "Error: toolchains-jenkins.xml file not found in any expected location, please fix the build environment!"
157+
echo "Proceeding without toolchains configuration..."
158+
echo "Executing: ${MAVEN_HOME}/bin/mvn-original $@"
159+
"${MAVEN_HOME}/bin/mvn-original" "$@"
160+
exit_code=$?
120161
fi
162+
163+
echo "Maven execution completed with exit code: $exit_code"
164+
exit $exit_code
121165
EOF
122166
RUN chmod +x /opt/maven/bin/mvn && cat /opt/maven/bin/mvn
123167

dev-support/jenkins/Jenkinsfile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pipeline {
4949
PATCH_REL = 'output'
5050
YETUS_REL = 'yetus'
5151
// Branch or tag name. Yetus release tags are 'rel/X.Y.Z'
52-
YETUS_VERSION = 'rel/0.12.0'
52+
YETUS_VERSION = '0.15.0'
5353
DOCKERFILE_REL = "${SRC_REL}/dev-support/jenkins/Dockerfile"
5454
YETUS_DRIVER_REL = "${SRC_REL}/dev-support/jenkins/jenkins_precommit_github_yetus.sh"
5555
ARCHIVE_PATTERN_LIST = '*.dump'
@@ -71,6 +71,7 @@ pipeline {
7171
SOURCEDIR = "${WORKDIR}/${SRC_REL}"
7272
PATCHDIR = "${WORKDIR}/${PATCH_REL}"
7373
DOCKERFILE = "${WORKDIR}/${DOCKERFILE_REL}"
74+
CACHE_APACHE_ARTIFACT = "${WORKDIR}/tools/cache-apache-project-artifact.sh"
7475
YETUS_DRIVER = "${WORKDIR}/${YETUS_DRIVER_REL}"
7576
YETUSDIR = "${WORKDIR}/${YETUS_REL}"
7677
BUILD_URL_ARTIFACTS = "artifact/${WORKDIR_REL}/${PATCH_REL}"
@@ -79,12 +80,25 @@ pipeline {
7980
dir("${SOURCEDIR}") {
8081
checkout scm
8182
}
83+
dir("${WORKDIR}") {
84+
sh'''#!/usr/bin/env bash
85+
set -e
86+
mkdir -p tools
87+
curl -L -O https://raw.githubusercontent.com/apache/hbase/HEAD/dev-support/jenkins-scripts/cache-apache-project-artifact.sh
88+
mv cache-apache-project-artifact.sh tools/
89+
chmod +x tools/cache-apache-project-artifact.sh
90+
'''
91+
}
8292
dir("${YETUSDIR}") {
83-
checkout([
84-
$class : 'GitSCM',
85-
branches : [[name: "${YETUS_VERSION}"]],
86-
userRemoteConfigs: [[url: 'https://github.com/apache/yetus.git']]]
87-
)
93+
sh'''#!/usr/bin/env bash
94+
"${CACHE_APACHE_ARTIFACT}" \
95+
--keys 'https://downloads.apache.org/yetus/KEYS' \
96+
--verify-tar-gz \
97+
./apache-yetus-${YETUS_VERSION}-bin.tar.gz \
98+
yetus/${YETUS_VERSION}/apache-yetus-${YETUS_VERSION}-bin.tar.gz && \
99+
tar --strip-components=1 -xzf apache-yetus-${YETUS_VERSION}-bin.tar.gz && \
100+
rm apache-yetus-${YETUS_VERSION}-bin.tar.gz
101+
'''
88102
}
89103
dir("${WORKDIR}") {
90104
withCredentials([

dev-support/jenkins/jenkins_precommit_github_yetus.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fi
2929

3030
declare -i missing_env=0
3131
declare -a required_envs=(
32-
# these ENV variables define the required API with Jenkinsfile_GitHub
32+
# these ENV variables define the required API with Jenkinsfile
3333
"ARCHIVE_PATTERN_LIST"
3434
"BUILD_URL_ARTIFACTS"
3535
"DOCKERFILE"
@@ -56,7 +56,7 @@ if [ ${missing_env} -gt 0 ]; then
5656
fi
5757

5858
# TODO (HBASE-23900): cannot assume test-patch runs directly from sources
59-
TESTPATCHBIN="${YETUSDIR}/precommit/src/main/shell/test-patch.sh"
59+
TESTPATCHBIN="${YETUSDIR}/bin/test-patch"
6060

6161
# this must be clean for every run
6262
rm -rf "${PATCHDIR}"
@@ -88,8 +88,8 @@ YETUS_ARGS+=("--basedir=${SOURCEDIR}")
8888
# lots of different output formats
8989
YETUS_ARGS+=("--console-report-file=${PATCHDIR}/console.txt")
9090
# enable writing back to Github
91-
YETUS_ARGS+=("--github-password=${GITHUB_PASSWORD}")
92-
YETUS_ARGS+=("--github-user=${GITHUB_USER}")
91+
YETUS_ARGS+=("--github-token=${GITHUB_PASSWORD}")
92+
YETUS_ARGS+=("--github-write-comment")
9393
# auto-kill any surefire stragglers during unit test runs
9494
YETUS_ARGS+=("--reapermode=kill")
9595
# set relatively high limits for ASF machines

hbase-shaded-jetty-12-plus-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</parent>
3838
<artifactId>hbase-shaded-jetty-12-plus-core</artifactId>
3939
<name>Apache HBase Relocated (Shaded) Jetty 12+ Libs: Core</name>
40-
<description>Pulls down Jetty core, relocates it and makes a far jar.</description>
40+
<description>Pulls down Jetty 12 core, relocates it and makes a fat jar.</description>
4141
<properties>
4242
<!-- Override bytecode enforcement for jetty modules -->
4343
<skipJdk8BytecodeCheck>true</skipJdk8BytecodeCheck>

hbase-shaded-jetty-12-plus-ee8/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</parent>
3838
<artifactId>hbase-shaded-jetty-12-plus-ee8</artifactId>
3939
<name>Apache HBase Relocated (Shaded) Jetty 12+ Libs: EE8</name>
40-
<description>Pulls down Jetty EE8, relocates it and makes a far jar.</description>
40+
<description>Pulls down Jetty 12 EE8, relocates it and makes a fat jar.</description>
4141
<properties>
4242
<!-- Override bytecode enforcement for jetty modules -->
4343
<skipJdk8BytecodeCheck>true</skipJdk8BytecodeCheck>

hbase-shaded-jetty/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</parent>
3838
<artifactId>hbase-shaded-jetty</artifactId>
3939
<name>Apache HBase Relocated (Shaded) Jetty Libs</name>
40-
<description>Pulls down Jetty, relocates it and makes a far jar.</description>
40+
<description>Pulls down Jetty 9, relocates it and makes a fat jar.</description>
4141
<dependencies>
4242
<dependency>
4343
<groupId>org.eclipse.jetty</groupId>

pom.xml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,15 @@
108108
<module>hbase-unsafe</module>
109109
</modules>
110110
<scm>
111-
<connection>scm:git:git://git.apache.org/hbase-thirdparty.git</connection>
112-
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/hbase-thirdparty.git</developerConnection>
113-
<url>https://git-wip-us.apache.org/repos/asf?p=hbase-thirdparty.git</url>
111+
<connection>scm:git:git://gitbox.apache.org/repos/asf/hbase-thirdparty.git</connection>
112+
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/hbase-thirdparty.git</developerConnection>
113+
<url>https://gitbox.apache.org/repos/asf?p=hbase-thirdparty.git</url>
114114
</scm>
115115
<issueManagement>
116116
<!--File issues for this project against Apache HBase JIRA-->
117117
<system>JIRA</system>
118-
<url>http://issues.apache.org/jira/browse/HBASE</url>
118+
<url>https://issues.apache.org/jira/browse/HBASE</url>
119119
</issueManagement>
120-
<ciManagement>
121-
<system>hudson</system>
122-
<url>http://hudson.zones.apache.org/hudson/view/HBase/job/HBase-TRUNK/</url>
123-
</ciManagement>
124-
<!--TODO-->
125120
<properties>
126121
<revision>4.1.12-SNAPSHOT</revision>
127122
<maven.javadoc.skip>true</maven.javadoc.skip>

0 commit comments

Comments
 (0)