Skip to content

HBASE-24318 Create-release scripts fixes and enhancements #1643

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 14 commits into from
May 9, 2020

Conversation

mattf-apache
Copy link
Member

@mattf-apache mattf-apache commented May 4, 2020

Clean up dev-support/create-release code, fix bugs, remove ambiguities, and clarify usage, to enable:

  • Clear statement of the four steps, which are now called tag, publish-dist, publish-snapshot, and publish-release (the latter two being mutually exclusive alternatives).
  • Ability to do the three tag-dist-release steps with a single command, or do any of the steps singly. (Fixed bugs and unfulfilled dependencies in single-steps.)
  • Ability to do a reliable and useful "dry run" of all steps or each step, and chain together the tag step with publish steps in a dry run. (Fixed many dry run bugs.)
  • Ability to run any or all steps without bugs in Docker or outside of Docker, on Linux and Mac.
  • Cleaned up all shellcheck errors in the scripts, and removed ambiguities and redundancies in the many environment variables used.
  • Refactoring to make the code more flexible, maintainable, or more easily understood (which will of course be somewhat subjective).

There is more detail in the commit logs attached.

In addition, the changes move the code toward being more general / less HBase-specific, so it can be run on any Apache project (while still accommodating HBase-specific features regarding how sub-projects are named and organized in Jira and release repos). In future I propose to take it further along that path, and move create-release into Yetus (recognizing that this create-release code has been passed between a couple other projects already).

These changes have NO IMPACT on HBase functionality.

TESTING: The scripts have been tested manually on Docker and Mac environments, singly and together, in dry run mode, on branch-2.3 builds. Testing in "live" mode (not dry run) will require cooperation from a Release Manager, as we'd like to avoid putting test material into the actual repos and then have to clean it up.

on hbase project only, while retaining special behaviors for
hbase sub-projects which share the hbase dist and jira locations.
… from tag step by keeping the tagged git repo.
to <publish-dist|publish-release>. In fact, what was formerly called
"build" built the distribution tarballs AND published them to dist,
while "publish" built the  maven artifacts AND published them to Nexus.
The new terminology clarifies what's happening, and removes the appearance
of order dependendency.
…. Remove unnecessary use of "-Dmaven.repo.local", put it in settings.xml instead. Stop putting password literals in settings.xml. (It's therefore no longer necessary to delete settings.xml in cleanup, but left that since there is no harm.)
…xed a couple bugs in the current release-tag.sh.
- Fix publish-snapshot so it does same checks as publish-release.
- Factor out common maven usages, and move them to build-util.sh.
- Change default polarity of DRY_RUN to default to true.
  Change -n ("no-publish") to -f ("force publish") to actually publish.
- Fix problems in do-release.sh so it runs correctly outside of docker,
  including DRY_RUN being exported.
- Have do-release.sh set REPO (shared maven local repository) if doing all three stages.
- Cleaned up REPO directory creation.
- General cleanup of comments and usage.
- use ${BASH_SOURCE[0]} instead of $0 to determine script directory path
- smarter way to read version from pom with mvn
- minor bug fixes
…word strings

- do maven-gpg-plugin config settings in maven settings file correctly as documented
- fix gpg signing failure on Mac due to gpg-agent timeout
- remove gpg debug code
…ish-release to work correctly as individual steps and/or without docker

- fix another gpg timeout
- improve log reporting from publish-release step
…ON with GIT_REF

- demote "PACKAGE_VERSION" to "package_version_name" and undocument it in favor of RELEASE_TAG. Still enable appropriate defaulting in case RELEASE_TAG is undefined.
- unify RELEASE_VERSION with VERSION, to remove ambiguity and allow it to be set when only running 'publish' step without 'tag'
- query confirm RELEASE_TAG
- emphasize that release-build.sh is called for a single action at a time, and should be called from do-release.sh.
- add '-s' option to do-release.sh
- suppress maven "Download from central:" messages
Copy link

@beettlle beettlle left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 31s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
_ Patch Compile Tests _
_ Other Tests _
1m 38s
Subsystem Report/Notes
Docker Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #1643
Optional Tests
uname Linux 997ab2142246 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e37aafc
Max. process+thread count 42 (vs. ulimit of 12500)
modules C: . U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/1/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 33s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
_ Patch Compile Tests _
_ Other Tests _
1m 42s
Subsystem Report/Notes
Docker Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #1643
Optional Tests
uname Linux 0fb0a416f83b 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e37aafc
Max. process+thread count 56 (vs. ulimit of 12500)
modules C: . U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/1/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 31s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
_ Patch Compile Tests _
-0 ⚠️ shellcheck 0m 4s The patch generated 3 new + 24 unchanged - 96 fixed = 27 total (was 120)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
_ Other Tests _
+1 💚 asflicense 0m 16s The patch does not generate ASF License warnings.
2m 17s
Subsystem Report/Notes
Docker Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #1643
Optional Tests dupname asflicense shellcheck shelldocs
uname Linux 30bcc9274826 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / e37aafc
shellcheck https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/1/artifact/yetus-general-check/output/diff-patch-shellcheck.txt
Max. process+thread count 49 (vs. ulimit of 12500)
modules C: . U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/1/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) shellcheck=0.4.6
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@saintstack saintstack left a comment

Choose a reason for hiding this comment

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

Took a look through. Looks really good. This stuff is hard. Actually run it is best test. A few comments below. Otherwise, I think we should put it in place for the next RM to exercise.

echo "It may take some time for the tag to be synchronized to github."
echo "Press enter when you've verified that the new tag ($RELEASE_TAG) is available."
read -r
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know where this comes from. The tag is immediate in my experience. A short wait and just move on would be nice future-to-have.

Copy link
Member Author

Choose a reason for hiding this comment

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

Apparently it was in the original code swiped from the Spark project. I think it would be pretty easy to replace it with a little wait loop; I'll do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

No hurry. Nice-to-have. Can come later too.

Copy link
Member Author

@mattf-apache mattf-apache May 6, 2020

Choose a reason for hiding this comment

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

Done. See commit db4bab6 just added.
It waits in 30-second increments up to 5 minutes.

increment version for ongoing dev, and publish to Apache git repo.
publish-dist Build and publish distribution packages (tarballs) to Apache dist repo
publish-snapshot Build and publish maven artifacts snapshot release to Apache snapshots repo
publish-release Build and publish maven artifacts release to Apache release repo, and
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this what I do when I want to run a release candidate? Release candidate goes into staging repo first.

Copy link
Member Author

@mattf-apache mattf-apache May 6, 2020

Choose a reason for hiding this comment

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

What one should do to run a release candidate, is invoke do-release-docker.sh (preferably) or do-release.sh (if there's a reason not to use docker). I agree with your comments here and in the next item below, that this script must clearly be documented as NOT the entrance script. And yet, the many env variables that get passed around as inter-script communication do need to be documented somewhere. Let me see if I can move them to do-release.sh, and make the comments and the README more useful.

On a completely unrelated note, you mention, as a question,

Release candidate goes into staging repo first.

That's correct, for non-snapshot releases/release candidates. The business with staging repo in Nexus is part of the publish-release step. I did not change its basic logic, which is now in release-util.sh::maven_deploy():

  1. Use mvn to set the version in pom.xml
  2. Do mvn deploy to Nexus, using -P apache-release,release profiles, which use the maven-release-plugin, nexus-staging-maven-plugin, and configs from the HBase top-level pom and root ASF pom, to manage Nexus deployment.
  3. Afterward (back to release-build.sh, at the end of publish-release step), the code expects to find that the Staging Repo has been closed (made immutable), and returns the repo ID to the user. Note that for snapshot releases, the Staging Repo intermediate appears not to be used.

Copy link
Contributor

Choose a reason for hiding this comment

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

k. This sounds like it works as it used to which sort of basically worked.


All other inputs are environment variables. Please use do-release-docker.sh or
do-release.sh to set up the needed environment variables. This script, release-build.sh,
is not intended to be called stand-alone, and such use is untested. The env variables used are:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we need an entrance script or a rename of the one of these scripts as main.sh or some such. As is, operator has to consult the README. I suppose this ok given how specialized this all is.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was letting it go due to how specialized it is, but you're right; there's no reason not to make it nice and clear. Will try to improve this; see comment immediately above.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sweet

Copy link
Member Author

Choose a reason for hiding this comment

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

Getting late, will tackle this in the morning.

GPG_PASSPHRASE - Passphrase for GPG key
REPO - Set to full path of a directory to use as maven local repo (dependencies cache)
to avoid re-downloading dependencies for each stage. It is automatically set if you
request full sequence of stages (tag, publish-dist, publish-release) in do-release.sh.
Copy link
Contributor

Choose a reason for hiding this comment

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

Good doc.

@busbey
Copy link
Contributor

busbey commented May 4, 2020

I have been working through trying to use the release scripts to roll 3.0.0-alpha-1. unless it is pressing I would like to incorporate this PR into me doing that as a review

@mattf-apache
Copy link
Member Author

@saintstack , thank you for the thorough review, I will respond to all comments momentarily.

@busbey , I'd be delighted to have you use it. This can be done two ways:

  • We can commit this patch as is, and fix any issues as new bugs. This has the benefit that the improved tools will be included in the 3.0.0-alpha-1 release.
  • Or you can take advantage of the fact that these tools don't use the workspace they are called from. Instead, they always create a clean workspace directory, and into that they pull a fresh "official" copy of the code from gitbox.apache.org, at the branch being built. Since the invoking workspace won't be used in the build, you can just apply this patch to a private workspace, or clone https://github.com/mattf-apache/hbase/ and checkout branch release-tool-enhancements, and invoke the tools from there. Then we can keep this PR open, and only commit it after your test.

In either case, I'd be happy to respond promptly to any problems you find.

@saintstack
Copy link
Contributor

@busbey and @ndimiduk You both are about to RM. You could review this as sub-task of RM'ing but may I suggest that you'll have your hands full RM'ing anyways; just take what is here and build on its benefit? It might be a bit hard to review because it does some renaming toward improved clarity and moves some actions around to make more sensible grouping. Just a suggestion.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 29s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 shelldocs 0m 1s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
_ Patch Compile Tests _
-0 ⚠️ shellcheck 0m 3s The patch generated 3 new + 24 unchanged - 96 fixed = 27 total (was 120)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
_ Other Tests _
+1 💚 asflicense 0m 15s The patch does not generate ASF License warnings.
2m 7s
Subsystem Report/Notes
Docker Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #1643
Optional Tests dupname asflicense shellcheck shelldocs
uname Linux 36e7ca75fc1e 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 07077a3
shellcheck https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/2/artifact/yetus-general-check/output/diff-patch-shellcheck.txt
Max. process+thread count 49 (vs. ulimit of 12500)
modules C: . U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/2/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) shellcheck=0.4.6
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 3s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
_ Patch Compile Tests _
_ Other Tests _
2m 11s
Subsystem Report/Notes
Docker Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #1643
Optional Tests
uname Linux 0ee7d07ffa42 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 07077a3
Max. process+thread count 49 (vs. ulimit of 12500)
modules C: . U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/2/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 35s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
_ Patch Compile Tests _
_ Other Tests _
2m 51s
Subsystem Report/Notes
Docker Client=19.03.8 Server=19.03.8 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #1643
Optional Tests
uname Linux 5543e1e5eca4 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 07077a3
Max. process+thread count 41 (vs. ulimit of 12500)
modules C: . U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-1643/2/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@busbey
Copy link
Contributor

busbey commented May 7, 2020

As I said previously, if this is pressing for someone go ahead. I am already on a forked branch in order to fix problems with the release creation tooling as I find them getting towards RC0. As I become sure that the things I am fixing are actually fixed, I'll post them up for reviews. I'm trying to minimize repeated updates or addenda as I figure out that something was only fixed for a part of the RC generation process.

I had wanted to incorporate this change on the branch I'm on (https://github.com/busbey/hbase/tree/HBASE-23339) so that I could ensure they work prior to HBase 3 alpha-1 rather then when I'm trying to maintain a regular cadence of alpha releases. If you are not willing to wait for that for some reason then by all means go ahead. I am likely to ignore them until after alpha-1 RCs are done in that case.

@busbey busbey merged commit f3c0a0e into apache:master May 9, 2020
@busbey
Copy link
Contributor

busbey commented May 9, 2020

Thanks for working through all of this @mattf-apache!

@mattf-apache
Copy link
Member Author

Thanks, @busbey !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants