Releasing Apache HBase
Complete guide to creating HBase release candidates including building, signing, staging artifacts, and publishing releases.
Building against HBase 1.x
See old refguides for how to build HBase 1.x. The below is for building hbase2.
Making a Release Candidate
Only committers can make releases of hbase artifacts.
Before You Begin
Check to be sure recent builds have been passing for the branch from where you
are going to take your release. You should also have tried recent branch tips
out on a cluster under load, perhaps by running the hbase-it integration test
suite for a few hours to 'burn in' the near-candidate bits.
You will need a published signing key added to the hbase KEYS file. (For how to add a KEY, see Step 1. in How To Release, the Hadoop version of this document).
Next make sure JIRA is properly primed, that all issues targeted against the prospective release have been resolved and are present in git on the particular branch. If any outstanding issues, move them out of the release by adjusting the fix version to remove this pending release as a target. Any JIRA with a fix version that matches the release candidate target release will be included in the generated CHANGES.md/RELEASENOTES.md files that ship with the release so make sure JIRA is correct before you begin.
After doing the above, you can move to the manufacture of an RC.
Building an RC is involved so we've scripted it. The script builds in a Docker container to ensure we have a consistent environment building. It will ask you for passwords for apache and for your gpg signing key so it can sign and commit on your behalf. The passwords are passed to gpg-agent in the container and purged along with the container when the build is done.
The script will:
- Set version to the release version
- Updates RELEASENOTES.md and CHANGES.md
- Tag the RC
- Set version to next SNAPSHOT version.
- Builds, signs, and hashes all artifacts.
- Generates the api compatibility report
- Pushes release tgzs to the dev dir in a apache dist.
- Pushes to repository.apache.org staging.
- Creates vote email template.
The dev-support/create-release/do-release-docker.sh Release Candidate (RC) Generating script is maintained in the master branch but can generate RCs for any 2.x+ branch (The script does not work against branch-1). Check out and update the master branch when making RCs. See dev-support/create-release/README.txt for how to configure your environment and run the script.
dev-support/create-release/do-release-docker.sh supercedes the previous dev-support/make_rc.sh script. It is more comprehensive automating all steps, rather than a portion, building a RC.
Release Candidate Procedure
Here we outline the steps involved generating a Release Candidate, the steps automated by the dev-support/create-release/do-release-docker.sh script described in the previous section. Running these steps manually tends to be error-prone so is not recommended. The below is informational only.
The process below makes use of various tools, mainly git and maven.
Specifying the Heap Space for Maven
You may run into OutOfMemoryErrors building, particularly building the site and
documentation. Up the heap for Maven by setting the MAVEN_OPTS variable.
You can prefix the variable to the Maven command, as in the following example:
MAVEN_OPTS="-Xmx4g -XX:MaxPermSize=256m" mvn packageYou could also set this in an environment variable or alias in your shell.
Example ~/.m2/settings.xml File
Publishing to maven requires you sign the artifacts you want to upload. For the build to sign them for you, you a properly configured settings.xml in your local repository under .m2, such as the following.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<!- To publish a snapshot of some part of Maven -->
<server>
<id>apache.snapshots.https</id>
<username>YOUR_APACHE_ID
</username>
<password>YOUR_APACHE_PASSWORD
</password>
</server>
<!-- To publish a website using Maven -->
<!-- To stage a release of some part of Maven -->
<server>
<id>apache.releases.https</id>
<username>YOUR_APACHE_ID
</username>
<password>YOUR_APACHE_PASSWORD
</password>
</server>
</servers>
<profiles>
<profile>
<id>apache-release</id>
<properties>
<gpg.keyname>YOUR_KEYNAME</gpg.keyname>
<!--Keyname is something like this ... 00A5F21E... do `gpg ——list-keys` to find it-->
<gpg.passphrase>YOUR_KEY_PASSWORD
</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>Update the CHANGES.md and RELEASENOTES.md files and the POM files.
Update CHANGES.md with the changes since the last release. Be careful with where you put headings and license. Respect the instructions and warning you find in current CHANGES.md and RELEASENOTES.md since these two files are processed by tooling that is looking for particular string sequences. See HBASE-21399 for description on how to make use of yetus generating additions to CHANGES.md and RELEASENOTES.md (RECOMMENDED!). Adding JIRA fixes, make sure the URL to the JIRA points to the proper location which lists fixes for this release.
Next, adjust the version in all the POM files appropriately.
If you are making a release candidate, you must remove the -SNAPSHOT label from all versions
in all pom.xml files.
If you are running this receipe to publish a snapshot, you must keep the -SNAPSHOT suffix on the hbase version.
The Versions Maven Plugin can be of use here.
To set a version in all the many poms of the hbase multi-module project, use a command like the following:
$ mvn clean org.codehaus.mojo:versions-maven-plugin:2.5:set -DnewVersion=2.1.0-SNAPSHOTMake sure all versions in poms are changed! Checkin the CHANGES.md, RELEASENOTES.md, and any maven version changes.
Update the documentation.
Update the documentation under hbase-website/app/page/_docs/docs/_mdx/(multi-page). This usually involves copying the latest from master branch and making version-particular adjustments to suit this release candidate version. Commit your changes.
Clean the checkout dir
$ mvn clean
$ git clean -f -x -dRun Apache-Rat
Check licenses are good
$ mvn apache-rat:checkIf the above fails, check the rat log.
$ grep 'Rat check' patchprocess/mvn_apache_rat.logCreate a release tag.
Presuming you have run basic tests, the rat check, passes and all is looking good, now is the time to tag the release candidate (You always remove the tag if you need to redo). To tag, do what follows substituting in the version appropriate to your build. All tags should be signed tags; i.e. pass the -s option (See Signing Your Work for how to set up your git environment for signing).
$ git tag -s 2.0.0-alpha4-RC0 -m "Tagging the 2.0.0-alpha4 first Releae Candidate (Candidates start at zero)"Or, if you are making a release, tags should have a rel/ prefix to ensure they are preserved in the Apache repo as in:
+$ git tag -s rel/2.0.0-alpha4 -m "Tagging the 2.0.0-alpha4 Release"Push the (specific) tag (only) so others have access.
$ git push origin 2.0.0-alpha4-RC0For how to delete tags, see How to Delete a Tag. Covers deleting tags that have not yet been pushed to the remote Apache repo as well as delete of tags pushed to Apache.
Build the source tarball.
Now, build the source tarball. Lets presume we are building the source tarball for the tag 2.0.0-alpha4-RC0 into /tmp/hbase-2.0.0-alpha4-RC0/ (This step requires that the mvn and git clean steps described above have just been done).
$ git archive --format=tar.gz --output="/tmp/hbase-2.0.0-alpha4-RC0/hbase-2.0.0-alpha4-src.tar.gz" --prefix="hbase-2.0.0-alpha4/" $git_tagAbove we generate the hbase-2.0.0-alpha4-src.tar.gz tarball into the /tmp/hbase-2.0.0-alpha4-RC0 build output directory (We don't want the RC0 in the name or prefix. These bits are currently a release candidate but if the VOTE passes, they will become the release so we do not taint the artifact names with RCX).
Build the binary tarball.
Next, build the binary tarball. Add the -Prelease profile when building.
It runs the license apache-rat check among other rules that help ensure
all is wholesome. Do it in two steps.
First install into the local repository
$ mvn clean install -DskipTests -PreleaseNext, generate documentation and assemble the tarball. Be warned, this next step can take a good while, a couple of hours generating site documentation.
$ mvn install -DskipTests site assembly:single -PreleaseOtherwise, the build complains that hbase modules are not in the maven repository when you try to do it all in one step, especially on a fresh repository. It seems that you need the install goal in both steps.
Extract the generated tarball — you'll find it under hbase-assembly/target and check it out. Look at the documentation, see if it runs, etc. If good, copy the tarball beside the source tarball in the build output directory.
Deploy to the Maven Repository.
Next, deploy HBase to the Apache Maven repository. Add the
apache-releaseprofile when running themvn deploy` command.
This profile comes from the Apache parent pom referenced by our pom files.
It does signing of your artifacts published to Maven, as long as the
settings.xml is configured correctly, as described in Example ~/.m2/settings.xml File.
This step depends on the local repository having been populate
by the just-previous bin tarball build.
$ mvn deploy -DskipTests -Papache-release -PreleaseThis command copies all artifacts up to a temporary staging Apache mvn repository in an 'open' state. More work needs to be done on these maven artifacts to make them generally available.
We do not release HBase tarball to the Apache Maven repository. To avoid deploying the tarball, do not
include the assembly:single goal in your mvn deploy command. Check the deployed artifacts as described in the next section.
make_rc.sh
If you ran the old dev-support/make_rc.sh script, this is as far as it takes you. To finish the release, take up the script from here on out.
Make the Release Candidate available.
The artifacts are in the maven repository in the staging area in the 'open' state. While in this 'open' state you can check out what you've published to make sure all is good. To do this, log in to Apache's Nexus at repository.apache.org using your Apache ID. Find your artifacts in the staging repository. Click on 'Staging Repositories' and look for a new one ending in "hbase" with a status of 'Open', select it. Use the tree view to expand the list of repository contents and inspect if the artifacts you expect are present. Check the POMs. As long as the staging repo is open you can re-upload if something is missing or built incorrectly.
If something is seriously wrong and you would like to back out the upload, you can use the 'Drop' button to drop and delete the staging repository. Sometimes the upload fails in the middle. This is another reason you might have to 'Drop' the upload from the staging repository.
If it checks out, close the repo using the 'Close' button. The repository must be closed before a public URL to it becomes available. It may take a few minutes for the repository to close. Once complete you'll see a public URL to the repository in the Nexus UI. You may also receive an email with the URL. Provide the URL to the temporary staging repository in the email that announces the release candidate. (Folks will need to add this repo URL to their local poms or to their local settings.xml file to pull the published release candidate artifacts.)
When the release vote concludes successfully, return here and click the 'Release' button to release the artifacts to central. The release process will automatically drop and delete the staging repository.
hbase-downstreamer
See the hbase-downstreamer test for a simple
example of a project that is downstream of HBase an depends on it. Check it out and run its simple
test to make sure maven artifacts are properly deployed to the maven repository. Be sure to edit
the pom to point to the proper staging repository. Make sure you are pulling from the repository
when tests run and that you are not getting from your local repository, by either passing the -U
flag or deleting your local repo content and check maven is pulling from remote out of the staging
repository.
See Publishing Maven Artifacts for some pointers on this maven staging process.
If the HBase version ends in -SNAPSHOT, the artifacts go elsewhere.
They are put into the Apache snapshots repository directly and are immediately available.
Making a SNAPSHOT release, this is what you want to happen.
At this stage, you have two tarballs in your 'build output directory' and a set of artifacts in a staging area of the maven repository, in the 'closed' state. Next sign, fingerprint and then 'stage' your release candiate build output directory via svnpubsub by committing your directory to The dev distribution directory (See comments on HBASE-10554 Please delete old releases from mirroring system but in essence it is an svn checkout of dev/hbase — releases are at release/hbase). In the version directory run the following commands:
$ for i in *.tar.gz; do echo $i; gpg --print-md MD5 $i > $i.md5 ; done
$ for i in *.tar.gz; do echo $i; gpg --print-md SHA512 $i > $i.sha ; done
$ for i in *.tar.gz; do echo $i; gpg --armor --output $i.asc --detach-sig $i ; done
$ cd ..
# Presuming our 'build output directory' is named 0.96.0RC0, copy it to the svn checkout of the dist dev dir
# in this case named hbase.dist.dev.svn
$ cd /Users/stack/checkouts/hbase.dist.dev.svn
$ svn info
Path: .
Working Copy Root Path: /Users/stack/checkouts/hbase.dist.dev.svn
URL: https://dist.apache.org/repos/dist/dev/hbase
Repository Root: https://dist.apache.org/repos/dist
Repository UUID: 0d268c88-bc11-4956-87df-91683dc98e59
Revision: 15087
Node Kind: directory
Schedule: normal
Last Changed Author: ndimiduk
Last Changed Rev: 15045
Last Changed Date: 2016-08-28 11:13:36 -0700 (Sun, 28 Aug 2016)
$ mv 0.96.0RC0 /Users/stack/checkouts/hbase.dist.dev.svn
$ svn add 0.96.0RC0
$ svn commit ...Ensure it actually gets published by checking https://dist.apache.org/repos/dist/dev/hbase/.
Announce the release candidate on the mailing list and call a vote.
Publishing a SNAPSHOT to maven
Make sure your settings.xml is set up properly (see Example ~/.m2/settings.xml File).
Make sure the hbase version includes -SNAPSHOT as a suffix.
Following is an example of publishing SNAPSHOTS of a release that had an hbase version of 0.96.0 in its poms.
$ mvn clean install -DskipTests javadoc:aggregate site assembly:single -Prelease
$ mvn -DskipTests deploy -Papache-releaseThe make_rc.sh script mentioned above (see Making a Release Candidate) can help you publish SNAPSHOTS.
Make sure your hbase.version has a -SNAPSHOT suffix before running the script.
It will put a snapshot up into the apache snapshot repository for you.
Building Apache HBase
Maven build commands, JDK requirements, Hadoop version selection, and building HBase from source including protobuf and thrift generation.
Voting on Release Candidates
Baseline and additional verification procedures for voting on HBase release candidates including checksums, signatures, and testing.