Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5 from HongW2019/doc-1.1
Browse files Browse the repository at this point in the history
[PMem-Common-4]Add mkdocs.yml and update docs
  • Loading branch information
zhixingheyi-tian authored Jan 13, 2021
2 parents 8277ca8 + bc16373 commit 022e9ac
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 65 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# OAP Common
# PMem Common

OAP common package includes native libraries and JNI interface for Intel Optane PMem.
PMem Common package includes native libraries and JNI interface for Intel Optane PMem.

## Online Documentation

You can find the all the PMem Common documents on the [project web page](https://oap-project.github.io/pmem-common/).

## Prerequisites

Below libraries need to be installed in the machine

- [Memkind](http://memkind.github.io/memkind/)
Expand Down
92 changes: 42 additions & 50 deletions docs/Developer-Guide.md → docs/OAP-Developer-Guide.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# OAP Developer Guide

This document contains the instructions & scripts on installing necessary dependencies and building OAP.
You can get more detailed information from OAP each module blew.
You can get more detailed information from OAP each module below.

* [SQL Index and Data Source Cache](../oap-cache/oap/docs/Developer-Guide.md)
* [RDD Cache PMem Extension](../oap-spark/README.md#compiling)
* [Shuffle Remote PMem Extension](../oap-shuffle/RPMem-shuffle/README.md#5-install-dependencies-for-shuffle-remote-pmem-extension)
* [Remote Shuffle](../oap-shuffle/remote-shuffle/README.md#build-and-deploy)
* [Intel MLlib](../oap-mllib/README.md)
* [Unified Arrow Data Source](../oap-data-source/arrow/README.md)
* [Native SQL Engine](../oap-native-sql/README.md)
* [SQL Index and Data Source Cache](https://github.com/oap-project/sql-ds-cache/blob/master/docs/Developer-Guide.md)
* [PMem Common](https://github.com/oap-project/pmem-common)
* [PMem Shuffle](https://github.com/oap-project/pmem-shuffle#5-install-dependencies-for-shuffle-remote-pmem-extension)
* [Remote Shuffle](https://github.com/oap-project/remote-shuffle)
* [OAP MLlib](https://github.com/oap-project/oap-mllib)
* [Arrow Data Source](https://github.com/oap-project/arrow-data-source)
* [Native SQL Engine](https://github.com/oap-project/native-sql-engine)

## Building OAP

Expand All @@ -27,60 +27,64 @@ OAP is built with [Apache Maven](http://maven.apache.org/) and Oracle Java 8, an
- [Arrow](https://github.com/Intel-bigdata/arrow)

- **Requirements for Shuffle Remote PMem Extension**
If enable Shuffle Remote PMem extension with RDMA, you can refer to [Shuffle Remote PMem Extension Guide](../oap-shuffle/RPMem-shuffle/README.md) to configure and validate RDMA in advance.
If enable Shuffle Remote PMem extension with RDMA, you can refer to [PMem Shuffle](https://github.com/oap-project/pmem-shuffle) to configure and validate RDMA in advance.

We provide scripts below to help automatically install dependencies above **except RDMA**, need change to **root** account, run:

```shell script
```
# git clone -b <tag-version> https://github.com/Intel-bigdata/OAP.git
# cd OAP
# sh dev/install-compile-time-dependencies.sh
# sh $OAP_HOME/dev/install-compile-time-dependencies.sh
```

Run the following command to learn more.

```shell script
```
# sh $OAP_HOME/dev/scripts/prepare_oap_env.sh --help
```

Run the following command to automatically install specific dependency such as Maven.

```shell script
```
# sh $OAP_HOME/dev/scripts/prepare_oap_env.sh --prepare_maven
```

***NOTE:*** If you use `install-compile-time-dependencies.sh` or `prepare_oap_env.sh` to install GCC, or your GCC is not installed in the default path, please ensure you have exported `CC` (and `CXX`) before calling maven.
```shell script
# export CXX=$OAPHOME/dev/thirdparty/gcc7/bin/g++
# export CC=$OAPHOME/dev/thirdparty/gcc7/bin/gcc
```

### Building

To build OAP package, use
```shell script
To build OAP package, run command below then you can find a tarball named `oap-$VERSION-bin-spark-$VERSION.tar.gz` under directory `$OAP_HOME/dev/release-package `.
```
$ sh $OAP_HOME/dev/compile-oap.sh
#or
$ mvn clean -DskipTests package
```

### Building Specified Module
```shell script
Building Specified OAP Module, such as `oap-cache`, run:
```
$ sh $OAP_HOME/dev/compile-oap.sh --oap-cache
#or
$ mvn clean -pl com.intel.oap:oap-cache -am package
```

### Running Test

To run all the tests, use
```shell script
### Running OAP Unit Tests

Setup building environment manually for intel MLlib, and if your default GCC version is before 7.0 also need export `CC` & `CXX` before using `mvn`, run

```
$ export CXX=$OAP_HOME/dev/thirdparty/gcc7/bin/g++
$ export CC=$OAP_HOME/dev/thirdparty/gcc7/bin/gcc
$ export ONEAPI_ROOT=/opt/intel/inteloneapi
$ source /opt/intel/inteloneapi/daal/2021.1-beta07/env/vars.sh
$ source /opt/intel/inteloneapi/tbb/2021.1-beta07/env/vars.sh
$ source /tmp/oneCCL/build/_install/env/setvars.sh
```

Run all the tests:

```
$ mvn clean test
```

### Running Specified Module Test
Run Specified OAP Module Unit Test, such as `oap-cache`:

```shell script
```
$ mvn clean -pl com.intel.oap:oap-cache -am test
```
Expand All @@ -89,31 +93,19 @@ $ mvn clean -pl com.intel.oap:oap-cache -am test

#### Prerequisites for building with PMem support

When use SQL Index and Data Source Cache with PMem, finish steps of [Prerequisites for building](#Prerequisites-for-building) to ensure needed dependencies have been installed.
When using SQL Index and Data Source Cache with PMem, finish steps of [Prerequisites for building](#prerequisites-for-building) to ensure needed dependencies have been installed.

#### Building package

Add `-Ppersistent-memory` to build OAP with PMem support.

```shell script
$ mvn clean -q -Ppersistent-memory -DskipTests package
```
For `vmemcache` strategy, build OAP with command :
```shell script
$ mvn clean -q -Pvmemcache -DskipTests package
You can build OAP with PMem support with command below:

```
You can build OAP with command below to use all of them:
```shell script
$ mvn clean -q -Ppersistent-memory -Pvmemcache -DskipTests package
$ sh $OAP_HOME/dev/compile-oap.sh
```
Or run:


### OAP Packaging

If you want to generate a release package after you mvn package all modules, use the following command, then you can find a tarball named `oap-$VERSION-bin-spark-3.0.0.tar.gz` under directory `OAP/dev/release-package `.

```shell script
$ sh $OAP_HOME/dev/compile-oap.sh
```
$ mvn clean -q -Ppersistent-memory -Pvmemcache -DskipTests package
```

## Contributing
Expand Down
23 changes: 10 additions & 13 deletions docs/OAP-Installation-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,32 @@ For changes to take effect, close and re-open your current shell. To test your i

Dependencies below are required by OAP and all of them are included in OAP Conda package, they will be automatically installed in your cluster when you Conda install OAP. Ensure you have activated environment which you created in the previous steps.

- [Arrow](https://github.com/Intel-bigdata/arrow)
- [Plasma](http://arrow.apache.org/blog/2017/08/08/plasma-in-memory-object-store/)
- [Memkind](https://anaconda.org/intel/memkind)
- [Vmemcache](https://anaconda.org/intel/vmemcache)
- [HPNL](https://anaconda.org/intel/hpnl)
- [PMDK](https://github.com/pmem/pmdk)
- [OneAPI](https://software.intel.com/content/www/us/en/develop/tools/oneapi.html)


Create a conda environment and install OAP Conda package.
```bash
$ conda create -n oapenv -y python=3.7
$ conda activate oapenv
$ conda install -c conda-forge -c intel -y oap=0.9.0
$ conda install -c conda-forge -c intel -y oap=1.0.0
```

Once finished steps above, you have completed OAP dependencies installation and OAP building, and will find built OAP jars under `$HOME/miniconda2/envs/oapenv/oap_jars`

#### Extra Steps for Shuffle Remote PMem Extension

If you use one of OAP features -- [Shuffle Remote PMem Extension](../oap-shuffle/RPMem-shuffle/README.md), there are 2 points to note.

1. Shuffle Remote PMem Extension needs to install library [PMDK](https://github.com/pmem/pmdk) which we haven't provided in OAP Conda package, so you can run commands below to enable PMDK (Certain libraries need to be compiled and installed on your system using ***root*** account, so you need change to `root` account to run the following commands).

```
# git clone -b <tag-version> https://github.com/Intel-bigdata/OAP.git
# cd OAP/
# sh dev/install-runtime-dependencies.sh
```
2. If you also want to use Shuffle Remote PMem Extension with **RDMA**, you need to configure and validate RDMA, please refer to [Shuffle Remote PMem Extension Guide](../oap-shuffle/RPMem-shuffle/README.md#4-configure-and-validate-rdma) for the details.
If you use one of OAP features -- [PMmem Shuffle](https://github.com/oap-project/pmem-shuffle) with **RDMA**, you need to configure and validate RDMA, please refer to [PMem Shuffle](https://github.com/oap-project/pmem-shuffle#4-configure-and-validate-rdma) for the details.


## Configuration
Once finished steps above, make sure libraries installed by Conda can be linked by Spark, please add the following configuration settings to `$SPARK_HOME/conf/spark-defaults` on the working node.

Once finished steps above, make sure libraries installed by Conda can be linked by Spark, please add the following configuration settings to `$SPARK_HOME/conf/spark-defaults.conf`.

```
spark.executorEnv.LD_LIBRARY_PATH $HOME/miniconda2/envs/oapenv/lib
Expand All @@ -65,7 +62,7 @@ spark.driver.extraClassPath $HOME/miniconda2/envs/oapenv/oap_jars/$OAP_F

And then you can follow the corresponding feature documents for more details to use them.

* [OAP User Guide](../README.md#user-guide)




Expand Down
17 changes: 17 additions & 0 deletions docs/User-Guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# PMem Common

PMem common package includes native libraries and JNI interface for Intel Optane PMem.

## Prerequisites

Below libraries need to be installed in the machine

- [Memkind](http://memkind.github.io/memkind/)

- [Vmemcache](https://github.com/pmem/vmemcache)

## Building

```
mvn clean package -Ppersistent-memory,vmemcache
```
17 changes: 17 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# PMem Common

PMem common package includes native libraries and JNI interface for Intel Optane PMem.

## Prerequisites

Below libraries need to be installed in the machine

- [Memkind](http://memkind.github.io/memkind/)

- [Vmemcache](https://github.com/pmem/vmemcache)

## Building

```
mvn clean package -Ppersistent-memory,vmemcache
```
23 changes: 23 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
site_name: PMem Common

repo_name: 'Fork on GitHub '
repo_url: "https://github.com/oap-project/pmem-common.git"
edit_uri: ""


nav:
- User Guide: User-Guide.md
- OAP Installation Guide: OAP-Installation-Guide.md
- OAP Developer Guide: OAP-Developer-Guide.md
- Version Selector: "../"



theme: readthedocs


plugins:
- search
- mkdocs-versioning:
version: master
exclude_from_nav: ["image", "js", "css", "fonts", "img"]

0 comments on commit 022e9ac

Please sign in to comment.