-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Build RocksDB JNI cross-platform fat jar #318
Merged
+214
−13
Merged
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
9db1398
Update RocksDB's Java bindings to support multiple native RocksDB bui…
82a8f43
Document RELEASE.mdgit status
4e735bb
Rsync files to VM rather than sync folders, since sync folders was ca…
b8e2661
since we're not sharing folders with the vm, copy built .so files and…
c4519c7
fix mis-named jar in JNI loader
6a64ea6
add note about java 7
0b923f0
add centos 5.6 build instead of ubuntu.
a2f98ef
fix tabs in Makefile
726ac5b
shrink vagrant commands to single line
3a0d498
rebase master
d0916f4
add major minor micro version to java jars
fd2545c
add maven publication target and instructions
deefcf4
make fat jar unclassified to satisfy sonatype
df08a2d
add single rocksdbjni pom
2e80124
add javadoc and sources targets for sonatype
8322cf0
use javadoc instead of javadocs
2d72f78
update release docs in java
2a1add6
use proper major/minor/micro version rather than hard coding 3.5.0
c832f16
add not about updating pom version and rename pom to be unversioned
a1d3f0d
don't fail if javadocs diretory doesn't exist
378f321
merge master to resolve merge conflicts
45d526e
singular javadoc directory
99744e0
bump version to 3.6
e869fc6
remove proper javadoc directory
6b2c1d9
make publish jni jars depend on release jni jars
2a4d6e7
merge master to resolve merge conflicts
d44871e
fix java doc directory in git ignore
1e5a528
update release readme
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
## Cross-building | ||
|
||
RocksDB can be built as a single self contained cross-platform JAR. The cross-platform jar can be usd on any 64-bit OSX system, 32-bit Linux system, or 64-bit Linux system. | ||
|
||
Building a cross-platform JAR requires: | ||
|
||
* [Vagrant](https://www.vagrantup.com/) | ||
* [Virtualbox](https://www.virtualbox.org/) | ||
* A Mac OSX machine that can compile RocksDB. | ||
* Java 7 set as JAVA_HOME. | ||
|
||
Once you have these items, run this make command from RocksDB's root source directory: | ||
|
||
make jclean clean rocksdbjavastaticrelease | ||
|
||
This command will build RocksDB natively on OSX, and will then spin up two Vagrant Virtualbox Ubuntu images to build RocksDB for both 32-bit and 64-bit Linux. | ||
|
||
You can find all native binaries and JARs in the java directory upon completion: | ||
|
||
librocksdbjni-linux32.so | ||
librocksdbjni-linux64.so | ||
librocksdbjni-osx.jnilib | ||
rocksdbjni-3.5.0-javadoc.jar | ||
rocksdbjni-3.5.0-linux32.jar | ||
rocksdbjni-3.5.0-linux64.jar | ||
rocksdbjni-3.5.0-osx.jar | ||
rocksdbjni-3.5.0-sources.jar | ||
rocksdbjni-3.5.0.jar | ||
|
||
## Maven publication | ||
|
||
Set ~/.m2/settings.xml to contain: | ||
|
||
<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> | ||
<server> | ||
<id>sonatype-nexus-staging</id> | ||
<username>your-sonatype-jira-username</username> | ||
<password>your-sonatype-jira-password</password> | ||
</server> | ||
</servers> | ||
</settings> | ||
|
||
Then update rocksjni.pom's version tag to reflect the release version. | ||
|
||
From RocksDB's root directory, first build the Java static JARs: | ||
|
||
make jclean clean rocksdbjavastaticrelease | ||
|
||
Then publish the release to Sonatype: | ||
|
||
make rocksdbjavastaticpublish | ||
|
||
This command will [stage the JAR artifacts on the Sonatype staging repository](http://central.sonatype.org/pages/manual-staging-bundle-creation-and-deployment.html). To release the staged artifacts. | ||
|
||
1. Go to [https://oss.sonatype.org/#stagingRepositories](https://oss.sonatype.org/#stagingRepositories) and search for "rocksdb" in the upper right hand search box. | ||
2. Select the rocksdb staging repository, and inspect its contents. | ||
3. If all is well, follow [these steps](https://oss.sonatype.org/#stagingRepositories) to close the repository and release it. | ||
|
||
After the release has occurred, the artifacts will be synced to Maven central within 24-48 hours. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | ||
VAGRANTFILE_API_VERSION = "2" | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
|
||
config.vm.define "linux32" do |linux32| | ||
linux32.vm.box = "hansode/centos-5.6-i386" | ||
end | ||
|
||
config.vm.define "linux64" do |linux64| | ||
linux64.vm.box = "hansode/centos-5.6-x86_64" | ||
end | ||
|
||
config.vm.provider "virtualbox" do |v| | ||
v.memory = 2048 | ||
v.cpus = 4 | ||
end | ||
|
||
config.vm.provision :shell, path: "build-linux-centos.sh" | ||
config.vm.synced_folder "../", "/rocksdb-build" | ||
config.vm.synced_folder "../..", "/rocksdb", type: "rsync" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
# install all required packages for rocksdb that are available through yum | ||
ARCH=$(uname -i) | ||
sudo yum -y install java-1.6.0-openjdk-devel.$ARCH zlib zlib-devel bzip2 bzip2-devel | ||
|
||
# install gcc/g++ 4.7 via CERN (http://linux.web.cern.ch/linux/devtoolset/) | ||
sudo wget -O /etc/yum.repos.d/slc5-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo | ||
sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-cern http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern | ||
sudo yum -y install devtoolset-1.1 | ||
wget http://gflags.googlecode.com/files/gflags-1.6.tar.gz | ||
tar xvfz gflags-1.6.tar.gz; cd gflags-1.6; scl enable devtoolset-1.1 ./configure; scl enable devtoolset-1.1 make; sudo make install | ||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib | ||
|
||
# set java home so we can build rocksdb jars | ||
export JAVA_HOME=/usr/lib/jvm/java-1.6.0 | ||
|
||
# build rocksdb | ||
cd /rocksdb | ||
scl enable devtoolset-1.1 'make jclean clean' | ||
scl enable devtoolset-1.1 'make -j 4 rocksdbjavastatic' | ||
cp /rocksdb/java/librocksdbjni-* /rocksdb-build | ||
cp /rocksdb/java/rocksdbjni-* /rocksdb-build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
# install all required packages for rocksdb | ||
sudo apt-get update | ||
sudo apt-get -y install git make gcc g++ libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev default-jdk | ||
|
||
# set java home so we can build rocksdb jars | ||
export JAVA_HOME=$(echo /usr/lib/jvm/java-7-openjdk*) | ||
cd /rocksdb | ||
make jclean clean | ||
make -j 4 rocksdbjavastatic | ||
cp /rocksdb/java/librocksdbjni-* /rocksdb-build | ||
cp /rocksdb/java/rocksdbjni-* /rocksdb-build | ||
sudo shutdown -h now | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<name>RocksDB JNI</name> | ||
<url>http://rocksdb.org/</url> | ||
<groupId>org.rocksdb</groupId> | ||
<artifactId>rocksdbjni</artifactId> | ||
<version>3.6.0</version> | ||
<description>RocksDB fat jar that contains .so files for linux32 and linux64, and jnilib files for Mac OSX.</description> | ||
<licenses> | ||
<license> | ||
<name>Apache License 2.0</name> | ||
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<scm> | ||
<connection>scm:git:git://github.com/dropwizard/metrics.git</connection> | ||
<developerConnection>scm:git:[email protected]:dropwizard/metrics.git</developerConnection> | ||
<url>http://github.com/dropwizard/metrics/</url> | ||
<tag>HEAD</tag> | ||
</scm> | ||
<developers> | ||
<developer> | ||
<name>Facebook</name> | ||
<email>[email protected]</email> | ||
<timezone>America/New_York</timezone> | ||
<roles> | ||
<role>architect</role> | ||
</roles> | ||
</developer> | ||
</developers> | ||
</project> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this depend on rocksdbjavastaticrelease?