Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
54 changes: 49 additions & 5 deletions dev-support/jenkins/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update && \
wget='1.21.2-*' \
shellcheck='0.8.0-*' \
patch='2.7.6-*' \
libxml2-dev='2.9.13+dfsg-*' \
libxml2-utils='2.9.13+dfsg-*' \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* \
Expand Down Expand Up @@ -110,14 +112,56 @@ ENV MAVEN_HOME='/opt/maven'
RUN mv /opt/maven/bin/mvn /opt/maven/bin/mvn-original && \
cat > /opt/maven/bin/mvn <<'EOF'
#!/bin/bash
TOOLCHAIN="${BASEDIR}/dev-support/toolchains-jenkins.xml"
if [ -f "$TOOLCHAIN" ]; then

echo "Maven wrapper called with args: $@"
Copy link
Contributor Author

@NihalJain NihalJain Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its good to keep the change as this improves logging and error handling. without this the out files were empty and swallowing errors making difficult to debug

echo "Current working directory: $(pwd)"
echo "BASEDIR environment variable: ${BASEDIR:-'(not set)'}"
echo "MAVEN_HOME: ${MAVEN_HOME:-'(not set)'}"

# Ensure Maven home exists
if [ ! -d "${MAVEN_HOME}" ]; then
echo "ERROR: MAVEN_HOME directory does not exist: ${MAVEN_HOME}"
exit 1
fi

if [ ! -f "${MAVEN_HOME}/bin/mvn-original" ]; then
echo "ERROR: mvn-original not found at: ${MAVEN_HOME}/bin/mvn-original"
exit 1
fi

# Try multiple possible locations for the toolchains file
TOOLCHAIN_LOCATIONS=(
"${BASEDIR}/dev-support/toolchains-jenkins.xml"
"$(pwd)/dev-support/toolchains-jenkins.xml"
Copy link
Contributor Author

@NihalJain NihalJain Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may be we do not need to try for different dirs as it should found in 1st dir itself? but why not, not a problem too? WDYT?

"./dev-support/toolchains-jenkins.xml"
"../dev-support/toolchains-jenkins.xml"
)

TOOLCHAIN=""
for location in "${TOOLCHAIN_LOCATIONS[@]}"; do
echo "Checking for toolchains file at: $location"
if [ -f "$location" ]; then
TOOLCHAIN="$location"
echo "Found toolchains file at: $TOOLCHAIN"
break
fi
done

if [ -n "$TOOLCHAIN" ]; then
echo "Added: -t ${TOOLCHAIN} to mvn flags!"
exec ${MAVEN_HOME}/bin/mvn-original "$@" -t "$TOOLCHAIN"
echo "Executing: ${MAVEN_HOME}/bin/mvn-original $@ -t $TOOLCHAIN"
"${MAVEN_HOME}/bin/mvn-original" "$@" -t "$TOOLCHAIN"
exit_code=$?
else
echo "Unexpected: ${TOOLCHAIN} file is missing!"
exec ${MAVEN_HOME}/bin/mvn-original "$@"
echo "Error: toolchains-jenkins.xml file not found in any expected location, please fix the build environment!"
echo "Proceeding without toolchains configuration..."
echo "Executing: ${MAVEN_HOME}/bin/mvn-original $@"
"${MAVEN_HOME}/bin/mvn-original" "$@"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fallback at least builds code, should not happen again though, but maybe with some yetus upgrade or dockerfile change

exit_code=$?
fi

echo "Maven execution completed with exit code: $exit_code"
exit $exit_code
EOF
RUN chmod +x /opt/maven/bin/mvn && cat /opt/maven/bin/mvn

Expand Down
26 changes: 20 additions & 6 deletions dev-support/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pipeline {
PATCH_REL = 'output'
YETUS_REL = 'yetus'
// Branch or tag name. Yetus release tags are 'rel/X.Y.Z'
YETUS_VERSION = 'rel/0.12.0'
YETUS_VERSION = '0.15.0'
DOCKERFILE_REL = "${SRC_REL}/dev-support/jenkins/Dockerfile"
YETUS_DRIVER_REL = "${SRC_REL}/dev-support/jenkins/jenkins_precommit_github_yetus.sh"
ARCHIVE_PATTERN_LIST = '*.dump'
Expand All @@ -71,6 +71,7 @@ pipeline {
SOURCEDIR = "${WORKDIR}/${SRC_REL}"
PATCHDIR = "${WORKDIR}/${PATCH_REL}"
DOCKERFILE = "${WORKDIR}/${DOCKERFILE_REL}"
CACHE_APACHE_ARTIFACT = "${WORKDIR}/tools/cache-apache-project-artifact.sh"
YETUS_DRIVER = "${WORKDIR}/${YETUS_DRIVER_REL}"
YETUSDIR = "${WORKDIR}/${YETUS_REL}"
BUILD_URL_ARTIFACTS = "artifact/${WORKDIR_REL}/${PATCH_REL}"
Expand All @@ -79,12 +80,25 @@ pipeline {
dir("${SOURCEDIR}") {
checkout scm
}
dir("${WORKDIR}") {
sh'''#!/usr/bin/env bash
set -e
mkdir -p tools
curl -L -O https://raw.githubusercontent.com/apache/hbase/HEAD/dev-support/jenkins-scripts/cache-apache-project-artifact.sh
mv cache-apache-project-artifact.sh tools/
chmod +x tools/cache-apache-project-artifact.sh
'''
}
dir("${YETUSDIR}") {
checkout([
$class : 'GitSCM',
branches : [[name: "${YETUS_VERSION}"]],
userRemoteConfigs: [[url: 'https://github.com/apache/yetus.git']]]
)
sh'''#!/usr/bin/env bash
"${CACHE_APACHE_ARTIFACT}" \
--keys 'https://downloads.apache.org/yetus/KEYS' \
--verify-tar-gz \
./apache-yetus-${YETUS_VERSION}-bin.tar.gz \
yetus/${YETUS_VERSION}/apache-yetus-${YETUS_VERSION}-bin.tar.gz && \
tar --strip-components=1 -xzf apache-yetus-${YETUS_VERSION}-bin.tar.gz && \
rm apache-yetus-${YETUS_VERSION}-bin.tar.gz
'''
}
dir("${WORKDIR}") {
withCredentials([
Expand Down
8 changes: 4 additions & 4 deletions dev-support/jenkins/jenkins_precommit_github_yetus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fi

declare -i missing_env=0
declare -a required_envs=(
# these ENV variables define the required API with Jenkinsfile_GitHub
# these ENV variables define the required API with Jenkinsfile
"ARCHIVE_PATTERN_LIST"
"BUILD_URL_ARTIFACTS"
"DOCKERFILE"
Expand All @@ -56,7 +56,7 @@ if [ ${missing_env} -gt 0 ]; then
fi

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

# this must be clean for every run
rm -rf "${PATCHDIR}"
Expand Down Expand Up @@ -88,8 +88,8 @@ YETUS_ARGS+=("--basedir=${SOURCEDIR}")
# lots of different output formats
YETUS_ARGS+=("--console-report-file=${PATCHDIR}/console.txt")
# enable writing back to Github
YETUS_ARGS+=("--github-password=${GITHUB_PASSWORD}")
YETUS_ARGS+=("--github-user=${GITHUB_USER}")
YETUS_ARGS+=("--github-token=${GITHUB_PASSWORD}")
YETUS_ARGS+=("--github-write-comment")
# auto-kill any surefire stragglers during unit test runs
YETUS_ARGS+=("--reapermode=kill")
# set relatively high limits for ASF machines
Expand Down
2 changes: 1 addition & 1 deletion hbase-shaded-jetty-12-plus-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</parent>
<artifactId>hbase-shaded-jetty-12-plus-core</artifactId>
<name>Apache HBase Relocated (Shaded) Jetty 12+ Libs: Core</name>
<description>Pulls down Jetty core, relocates it and makes a far jar.</description>
<description>Pulls down Jetty 12 core, relocates it and makes a fat jar.</description>
<properties>
<!-- Override bytecode enforcement for jetty modules -->
<skipJdk8BytecodeCheck>true</skipJdk8BytecodeCheck>
Expand Down
2 changes: 1 addition & 1 deletion hbase-shaded-jetty-12-plus-ee8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</parent>
<artifactId>hbase-shaded-jetty-12-plus-ee8</artifactId>
<name>Apache HBase Relocated (Shaded) Jetty 12+ Libs: EE8</name>
<description>Pulls down Jetty EE8, relocates it and makes a far jar.</description>
<description>Pulls down Jetty 12 EE8, relocates it and makes a fat jar.</description>
<properties>
<!-- Override bytecode enforcement for jetty modules -->
<skipJdk8BytecodeCheck>true</skipJdk8BytecodeCheck>
Expand Down
2 changes: 1 addition & 1 deletion hbase-shaded-jetty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</parent>
<artifactId>hbase-shaded-jetty</artifactId>
<name>Apache HBase Relocated (Shaded) Jetty Libs</name>
<description>Pulls down Jetty, relocates it and makes a far jar.</description>
<description>Pulls down Jetty 9, relocates it and makes a fat jar.</description>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
Expand Down
13 changes: 4 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,15 @@
<module>hbase-unsafe</module>
</modules>
<scm>
<connection>scm:git:git://git.apache.org/hbase-thirdparty.git</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/hbase-thirdparty.git</developerConnection>
<url>https://git-wip-us.apache.org/repos/asf?p=hbase-thirdparty.git</url>
<connection>scm:git:git://gitbox.apache.org/repos/asf/hbase-thirdparty.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/hbase-thirdparty.git</developerConnection>
<url>https://gitbox.apache.org/repos/asf?p=hbase-thirdparty.git</url>
</scm>
<issueManagement>
<!--File issues for this project against Apache HBase JIRA-->
<system>JIRA</system>
<url>http://issues.apache.org/jira/browse/HBASE</url>
<url>https://issues.apache.org/jira/browse/HBASE</url>
</issueManagement>
<ciManagement>
<system>hudson</system>
<url>http://hudson.zones.apache.org/hudson/view/HBase/job/HBase-TRUNK/</url>
</ciManagement>
<!--TODO-->
<properties>
<revision>4.1.12-SNAPSHOT</revision>
<maven.javadoc.skip>true</maven.javadoc.skip>
Expand Down