Skip to content

Conversation

@sursingh
Copy link
Contributor

@sursingh sursingh commented Apr 7, 2021

Motivation

Migrate bookkeeper build to gradle: Add support for doing releases from gradle

Changes

This change automates staging of release candidate. The artifacts are staged
to SVN and nexus repositories.

This change uses stage-vote-release plugin from:
https://github.com/vlsi/vlsi-release-plugins/blob/master/plugins/stage-vote-release-plugin/README.md.

Master Issue: #2640

Preparing release candidate:

  1. Checkout release branch: git checkout -b branch-4.14 origin/branch-4.14
  2. Update the version in version.gradle and commit the change
  3. Create and stage release candidate. This will build and upload all release
    artifacts to staging areas under nexus and SVN repos. A template for Vote
    email will also be generated. Link to the release notes will need to be
    updated in the email templateA release candidate tag will also be added.
./gradlew prepareVote -Pasf -Prc=1
  1. If needed additional release candidates can be create by running the above
    command with appropriate rc value
./gradlew prepareVote -Pasf -Prc=2
  1. Once the voting is done, the release can be published using:
./gradlew publishDist -Pasf -Prc=2
  1. Remove stale artifacts:
./gradlew removeStaleArtifacts -Pasf

Configuration:

  • Following configuration can be added to $HOME/.gradle/gradle.properties.
signing.gnupg.keyName=...
asfCommitterId=...
asfNexusUsername=...
asfNexusPassword=...
asfGitSourceUsername=...
asfGitSourcePassword=...
asfGitSitePreviewUsername=...
asfGitSitePreviewPassword=...
asfSvnUsername=...
asfSvnPassword=...
  • The above config can also be passed from commandline -P<property>=<value>

Testing:

The change was testing using a local setup based on https://github.com/vlsi/asflike-release-environment

@sursingh sursingh force-pushed the gradle-stage-release branch from 184f298 to a2aa8cf Compare April 7, 2021 17:56
This change automates staging of release candidate. The artifacts are staged
to SVN and nexus repositories.

This change uses
https://github.com/vlsi/vlsi-release-plugins/blob/master/plugins/stage-vote-release-plugin/README.md.

Preparing release candidate:

1. Checkout release branch: `git checkout -b branch-4.14 origin/branch-4.14`
2. Update the version in version.gradle and commit the change
3. Create and stage release candidate. This will build and upload all release
artifacts to staging areas under nexus and SVN repos.  A template for Vote
email will also be generated. Link to the release notes will need to be
updated in the email template. A release candidate tag  will also be added.
```
./gradlew prepareVote -Pasf -Prc=1
```
4. If needed additional release candidates can be create by running the above
command with appropriate `rc` value
5. Once the voting is done, the release can be published using:
```
./gradlew publishDist -Pasf -Prc=1
```
6. Remove stale artifacts:
```
./gradlew removeStaleArtifacts -Pasf
```

Configuration:

* Following configuration can be added to $HOME/.gradle/gradle.properties.
```
signing.gnupg.keyName=...
asfCommitterId=...
asfNexusUsername=...
asfNexusPassword=...
asfGitSourceUsername=...
asfGitSourcePassword=...
asfGitSitePreviewUsername=...
asfGitSitePreviewPassword=...
asfSvnUsername=...
asfSvnPassword=...
```
* The above config can also be passed from commandline `-P<property>=<value>`

Testing:

The change was testing useing a local setup based on
https://github.com/vlsi/asflike-release-environment
@sursingh sursingh force-pushed the gradle-stage-release branch from a2aa8cf to 8146cf1 Compare April 7, 2021 18:25
@sursingh
Copy link
Contributor Author

sursingh commented Apr 7, 2021

rerun failure checks

Copy link
Contributor

@hsaputra hsaputra left a comment

Choose a reason for hiding this comment

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

LGTM +1

@hsaputra
Copy link
Contributor

Will merge this end of day PST if no more comments or questions. Thank you.

@merlimat merlimat merged commit f1a1f12 into apache:master Apr 12, 2021
hsaputra pushed a commit that referenced this pull request Apr 16, 2021
### Motivation

**Migrate bookkeeper to gradle spotbug plugin.**
spotbugs is gradle as well as maven plugin which checks for obvious bugs in source code.
**How to run** 
 `./gradlew spotbugsMain `

### Changes

- Integrate gradle build with spotbugs plugin
- Second commit is for fixing issues reported by spotbugs plugin 

### Test
Just to validate it's working. 
I introduced following bug.
 ```
public void test() {
+
+        String[] field = {"a", "b", "c", "s", "e"};
+
+        //concatenates strings using + in a loop
+        String ip = "127.0.0.1";
+        String s = "";
+        for (int i = 0; i < field.length; ++i) {
+            s = s + field[i];
+        }
+
+        System.out.println(ip);
+
+    }
```

spotbugs plugin reported following violation.
```
<BugInstance type="SBSC_USE_STRINGBUFFER_CONCATENATION" priority="2" rank="18" abbrev="SBSC" category="PERFORMANCE" instanceHash="2aa8e4ebcc4cd86190fe3e7bd8a4913c" instanceOccurrenceNum="0" instanceOccurrenceMax="0">
    <ShortMessage>Method concatenates strings using + in a loop</ShortMessage>
    <LongMessage>org.apache.bookkeeper.meta.LongZkLedgerIdGenerator.test() concatenates strings using + in a loop</LongMessage>
    <Class classname="org.apache.bookkeeper.meta.LongZkLedgerIdGenerator" primary="true">
      <SourceLine classname="org.apache.bookkeeper.meta.LongZkLedgerIdGenerator" start="58" end="350" sourcefile="LongZkLedgerIdGenerator.java" sourcepath="org/apache/bookkeeper/meta/LongZkLedgerIdGenerator.java" relSourcepath="java/org/apache/bookkeeper/meta/LongZkLedgerIdGenerator.java">
        <Message>At LongZkLedgerIdGenerator.java:[lines 58-350]</Message>
      </SourceLine>
      <Message>In class org.apache.bookkeeper.meta.LongZkLedgerIdGenerator</Message>
    </Class>
```
Master Issue: #2640



Reviewers: Henry Saputra <hsaputra@apache.org>, Enrico Olivelli <eolivelli@gmail.com>

This closes #2682 from pkumar-singh/merge_internal_gradle_spotbugs, closes #2640 and squashes the following commits:

5883732 [Prashant] Fix for gradle spotbug plugin found violation
2bc79b0 [Prashant] ISSUE-2640: BP-43 Gradle migration integrating with spotbug gradle plugin
f1a1f12 [Surinder Singh] staging and setting up vote for release candidates (#2681)
2dd4afe [Prashant Kumar] ISSUE-2640: BP-43: Gradle integration with RAT plugin (#2683)
79768fe [Jack Vanlightly] ISSUE #2615: Fix for invalid ensemble issue during ledger recovery
646e590 [Prashant Kumar] ISSUE #2640: BP-43 integrate gradle javadoc plugin
d70153f [hangc0276] Update documentation with default value for openLedgerRereplicationGracePeriod config option
hsaputra pushed a commit that referenced this pull request Apr 19, 2021
### Motivation

After deleting many ledgers, seeking to the end of the RocksDB metadata can take a long time and trigger timeouts upstream. Address this by improving the seek logic as well as compacting out tombstones in situations where we've just deleted many entries.  This affects the entry location index and the ledger metadata index.


Reviewers: Andrey Yegorov, Prashant Kumar

This closes #2686 from mauricebarnum/rocksdb-tombstones and squashes the following commits:

c029968 [Maurice Barnum] Partially compact RocksDB after removing deleted ledgers
0be68a1 [Maurice Barnum] KeyValueStorageRocksDB bounded key iterator: use RocksDB upper bound
0c5ef8f [Maurice Barnum] KeyValueStorageRocksDB.getFloor() - reimplement to avoid two seeks
114cc73 [Maurice Barnum] update rocksdb to 6.16.4
f489a05 [Surinder Singh] Fix test cases using gradle build (#2689)
9256dba [Lari Hotari] Add current ip address, long hostname and short hostname to /etc/hosts (#2688)
f1a1f12 [Surinder Singh] staging and setting up vote for release candidates (#2681)
2dd4afe [Prashant Kumar] ISSUE-2640: BP-43: Gradle integration with RAT plugin (#2683)
79768fe [Jack Vanlightly] ISSUE #2615: Fix for invalid ensemble issue during ledger recovery
646e590 [Prashant Kumar] ISSUE #2640: BP-43 integrate gradle javadoc plugin
d70153f [hangc0276] Update documentation with default value for openLedgerRereplicationGracePeriod config option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants