8000 [Proposal] Include libdisni.so into assembly jar by petro-rudenko · Pull Request #17 · zrlio/disni · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Proposal] Include libdisni.so into assembly jar #17

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,22 @@ DiSNI is a Java library for direct storage and networking access from userpace.
## Building DiSNI

Building the source requires [Apache Maven](http://maven.apache.org/) and [GNU/autotools](http://www.gnu.org/software/autoconf/autoconf.html) and Java version 8 or higher.
To build DiSNI and its example programs, obtain a copy of DiSNI from [Github](https://github.com/zrlio/disni) and execute the following steps:

1. Compile the Java sources using: mvn -DskipTests install
2. Compile libdisni using: cd libdisni; ./autoprepare.sh; ./configure --with-jdk=\<path\>; make install
To build DiSNI and its example programs, obtain a copy of DiSNI from [Github](https://github.com/zrlio/disni) and execute `mvn -DskipTests install`.

By de 8000 fault DiSNI will only build with RDMA support. To enable NVMf you will need to install DPDK and SPDK using following steps. Below, \<target\> refers to the DPDK 4-tuple for your platform, which would be `x86_64-native-linuxapp-gcc` for Intel/AMD processors and `ppc_64-power8-linuxapp-gcc` for Power (run `make help` in the DPDK top source directory for a list of 4-tuples supported by DPDK):

2. Obtain dpdk from [dpdk.org](http://dpdk.org/download) (version 17.11)\
3. Build dpdk using: make install T=\<target\> DESTDIR=. EXTRA_CFLAGS="-fPIC"
4. Obtain spdk from [Github](https://github.com/spdk/spdk) (version 17.10)
5. Build spdk using: make DPDK_DIR=\<dpdk-path/x86_64-native-linuxapp-gcc\> CONFIG_RDMA=y
6. Configure libdisni for NVMf: ./configure --with-jdk=\<path\> --with-spdk=\<path\> --with-dpdk=\<path\>/\<target\>
7. Build libdisni: make install
8. Make sure shared libraries of DPDK are in the LD_LIBRARY_PATH
6. Build Disni for NVMf: `mvn -DskipTests -Dexec.args="--with-spdk=<path> --with-dpdk=<path>/<target>" install`
7. Make sure shared libraries of DPDK are in the LD_LIBRARY_PATH

## How to Run the Examples

Common steps:

1. After building DiSNI, make sure DiSNI and its dependencies are in the classpath (e.g., disni-1.3-jar-with-dependencies.jar). Also add the DiSNI test jar (disni-1.3-tests.jar) which includes the examples.<br/>
2. Make sure libdisni is part of the LD_LIBRARY_PATH

### RDMA example
1. Make sure the RDMA network interface is configured and up on the test machines (run ibv\_devices to see the list of RDMA NICs). If your machine does not have RDMA hardware, you can also use SoftiWARP from [Github](https://github.com/zrlio/softiwarp).
Expand Down
51 changes: 51 additions & 0 deletions libdisni/build_libdisni.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env python
import errno
import glob
import os
import shutil
import subprocess
import sys

def maybe_makedirs(path):
path = normpath(path)
print("mkdir -p " + path)
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST:
raise


def run(command, **kwargs):
print(command)
subprocess.check_call(command, shell=True, **kwargs)


def cp(source, target):
source = normpath(source)
target = normpath(target)
print("cp {0} {1}".format(source, target))
shutil.copy(source, target)


def normpath(path):
"""Normalize UNIX path to a native path."""
normalized = os.path.join(*path.split("/"))
if os.path.isabs(path):
return os.path.abspath("/") + normalized
else:
return normalized


if __name__ == "__main__":
print("building libdisni")
maybe_makedirs("build")
run("./autoprepare.sh")
run("./configure --with-jdk={} --prefix={} {}".format(os.environ["JAVA_HOME"],
os.path.join(os.getcwd(), "build"),
sys.argv[1] if len(sys.argv) == 2 else ""))
run("make")
run("make install")
print("copying native library")
maybe_makedirs("../src/main/resources/lib")
cp("build/lib/libdisni.so", "../src/main/resources/lib")
19 changes: 19 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,25 @@
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>native</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>./build_libdisni.py</executable>
<workingDirectory>libdisni</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
Expand Down
0