Skip to content

Commit 773469c

Browse files
authored
doc: adjust docker related desc in readme (#559)
* doc: add asf docker policy * doc: adjust quick start order and others * Update hugegraph-loader/README.md * change desc * change desc
1 parent a63d182 commit 773469c

File tree

3 files changed

+134
-109
lines changed

3 files changed

+134
-109
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ it includes 5+ main modules.
2020

2121
## Usage
2222

23-
- [hugegraph-loader](./hugegraph-loader): We can use `docker run -itd --name loader hugegraph/loader` to quickly start [loader,](https://hub.docker.com/r/hugegraph/loader) or we can follow [this](./hugegraph-loader/README.md#212-docker-compose) to use docker-compose to start `loader` with `server`. And we can find more details in the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/).
24-
- [hugegraph-hubble](./hugegraph-hubble): We can use `docker run -itd --name=hubble -p 8088:8088 hugegraph/hubble` to quickly start [hubble,](https://hub.docker.com/r/hugegraph/hubble) or we can follow [this](hugegraph-hubble/README.md#quick-start) to use docker-compose to start `hubble` with `server`. And we can find more details in the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-hubble/).
23+
- [hugegraph-loader](./hugegraph-loader): We can follow the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/) to learn how to quickly start with `loader`.
24+
- [hugegraph-hubble](./hugegraph-hubble): We can follow the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-hubble/) to learn how to quickly start with `hubble`.
2525
- [hugegraph-client](./hugegraph-client): We can follow the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-client/) to learn how to quickly start with `client`.
2626

2727
## Maven Dependencies

hugegraph-hubble/README.md

Lines changed: 82 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,88 @@ graph data load, schema management, graph relationship analysis, and graphical d
1616

1717
## Quick Start
1818

19-
We can quickly start `hubble` in two ways:
20-
21-
1. We can use `docker run -itd --name=hubble -p 8088:8088 hugegraph/hubble` to quickly start [hubble](https://hub.docker.com/r/hugegraph/hubble).
22-
2. Or we can use the `docker-compose.yml` to start `hubble` with `hugegraph-server`. If we set `PRELOAD=true`, we can preload the example graph when starting `hugegraph-server`:
23-
24-
```yaml
25-
version: '3'
26-
services:
27-
server:
28-
image: hugegraph/hugegraph
29-
container_name: graph
30-
#environment:
31-
# - PRELOAD=true
32-
ports:
33-
- 8080:8080
34-
35-
hubble:
36-
image: hugegraph/hubble
37-
container_name: hubble
38-
ports:
39-
- 8088:8088
40-
```
41-
42-
Then we should follow the [hubble doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-hubble/#3platform-workflow) to create the graph.
19+
There are three ways to get HugeGraph-Loader:
20+
21+
- Download the Toolchain binary package
22+
- Source code compilation
23+
- Use Docker image (Convenient for Test/Dev)
24+
25+
And you can find more details in the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/#2-get-hugegraph-loader)
26+
27+
### 1. Download the Toolchain binary package
28+
29+
`hubble` is in the `toolchain` project. First, download the binary tar tarball
30+
31+
```bash
32+
wget https://downloads.apache.org/incubator/hugegraph/{version}/apache-hugegraph-toolchain-incubating-{version}.tar.gz
33+
tar -xvf apache-hugegraph-toolchain-incubating-{version}.tar.gz
34+
cd apache-hugegraph-toolchain-incubating-{version}.tar.gz/apache-hugegraph-hubble-incubating-{version}
35+
```
36+
37+
Run `hubble`:
38+
39+
```
40+
bin/start-hubble.sh
41+
```
42+
43+
Then use a web browser to access `ip:8088` and you can see the `Hubble` page. You can stop the service using bin/stop-hubble.sh.
44+
45+
### 2. Clone source code then compile and install
46+
47+
> Note: Compiling Hubble requires the user’s local environment to have Node.js V16.x and yarn installed.
48+
49+
```bash
50+
apt install curl build-essential
51+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
52+
source ~/.bashrc
53+
nvm install 16
54+
```
55+
56+
Then, verify that the installed Node.js version is 16.x (please note that higher Node version may cause conflicts).
57+
58+
```bash
59+
node -v
60+
```
61+
62+
install `yarn` by the command below:
63+
64+
```bash
65+
npm install -g yarn
66+
```
67+
68+
Download the toolchain source code.
69+
70+
```bash
71+
git clone https://github.com/apache/hugegraph-toolchain.git
72+
```
73+
74+
Compile `hubble`. It depends on the loader and client, so you need to build these dependencies in advance during the compilation process (you can skip this step later).
75+
76+
```bash
77+
cd incubator-hugegraph-toolchain
78+
sudo pip install -r hugegraph-hubble/hubble-dist/assembly/travis/requirements.txt
79+
mvn install -pl hugegraph-client,hugegraph-loader -am -Dmaven.javadoc.skip=true -DskipTests -ntp
80+
cd hugegraph-hubble
81+
mvn -e compile package -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp
82+
cd apache-hugegraph-hubble-incubating*
83+
```
84+
85+
Run `hubble`
86+
87+
```bash
88+
bin/start-hubble.sh -d
89+
```
90+
91+
### 3. User docker image (Convenient for Test/Dev)
92+
93+
We can use `docker run -itd --name=hubble -p 8088:8088 hugegraph/hubble` to quickly start [hubble](https://hub.docker.com/r/hugegraph/hubble). An you can visit [hubble deploy doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-hubble/#2-deploy) for more details.
94+
95+
Then we should follow the [hubble workflow doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-hubble/#3platform-workflow) to create the graph.
96+
97+
> Note:
98+
> 1. The docker image of hugegraph-hubble is a convenience release, but not **official distribution** artifacts. You can find more details from [ASF Release Distribution Policy](https://infra.apache.org/release-distribution.html#dockerhub).
99+
>
100+
> 2. Recommand to use `release tag`(like `1.0.0`) for the stable version. Use `latest` tag to experience the newest functions in development.
43101
44102
## Doc
45103

hugegraph-loader/README.md

Lines changed: 50 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -15,102 +15,77 @@ hugegraph-loader is a customizable command line utility for loading small to med
1515
- Detecting schema from data automatically, reduce the complex work of schema management.
1616
- Advanced customized operations with groovy script, users can configure how to construct vertices and edges by themselves.
1717

18-
## 2. Usage for Docker(Recommand)
18+
## 2. Quick start
1919

20-
- Run `loader` with Docker
21-
- Docker run
22-
- Docker-compose
23-
- Load data in docker container `loader`
20+
There are three ways to get HugeGraph-Loader:
2421

25-
### 2.1 Start with Docker
22+
- Download the compiled tarball
23+
- Clone source code then compile and install
24+
- Use docker image (Convenient for Test/Dev)
2625

27-
#### 2.1.1 Docker run
26+
And you can find more details in the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/#2-get-hugegraph-loader)
2827

29-
Use the command `docker run -itd --name loader hugegraph/loader` to start loader.
28+
### 2.1 Download the compiled tarball
3029

31-
If you want to load your data, you can mount the data folder like `-v /path/to/data/file:/loader/file`
30+
Download the latest version of the HugeGraph-Toolchain release package:
3231

32+
``` bash
33+
wget https://downloads.apache.org/incubator/hugegraph/{version}/apache-hugegraph-toolchain-incubating-{version}.tar.gz
34+
tar zxf *hugegraph*.tar.gz
35+
```
3336

34-
#### 2.1.2 Docker-compose
37+
### 2.2 Clone source code then compile and install
3538

36-
The example `docker-compose.yml` is [here](./docker/example/docker-compose.yml)
39+
Clone the latest version of HugeGraph-Loader source package:
3740

38-
If you want to load your data, you can mount the data folder like:
39-
```yaml
40-
volumes:
41-
- /path/to/data/file:/loader/file
41+
```bash
42+
# 1. get from github
43+
git clone https://github.com/apache/hugegraph-toolchain.git
44+
45+
# 2. get from direct (e.g. here is 1.0.0, please choose the latest version)
46+
wget https://downloads.apache.org/incubator/hugegraph/{version}/apache-hugegraph-toolchain-incubating-{version}-src.tar.gz
4247
```
4348

44-
Use the command `docker-compose up -d` to deploy `loader` with `server` and `hubble`.
49+
Due to the license limitation of the `Oracle OJDBC`, you need to manually install ojdbc to the local maven repository. Visit the [Oracle jdbc downloads page](https://www.oracle.com/database/technologies/appdev/jdbc-drivers-archive.html). Select Oracle Database 12c Release 2 (12.2.0.1) drivers, as shown in the following figure.
4550

46-
### 2.2 Load data with docker container
51+
After opening the link, select “ojdbc8.jar”.
4752

48-
#### 2.2.1 load data with docker
49-
50-
> If the `loader` and `server` is in the same docker network (for example, you deploy `loader` and `server` with `docker-compose`), we can set `-h {server_container_name}`. In our example, the container name of `server` is `graph`
51-
>
52-
> If `loader` is deployed alone, the `-h` should be set to the ip of the host of `server`. Other parameter description is [here](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/#341-parameter-description)
53+
Install ojdbc8 to the local maven repository, enter the directory where ojdbc8.jar is located, and execute the following command.
5354

5455
```bash
55-
docker exec -it loader bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h graph -p 8080
56+
mvn install:install-file -Dfile=./ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar
5657
```
5758

58-
Then we can see the result.
59+
Compile and generate tar package:
5960

60-
```bash
61-
HugeGraphLoader worked in NORMAL MODE
62-
vertices/edges loaded this time : 8/6
63-
--------------------------------------------------
64-
count metrics
65-
input read success : 14
66-
input read failure : 0
67-
vertex parse success : 8
68-
vertex parse failure : 0
69-
vertex insert success : 8
70-
vertex insert failure : 0
71-
edge parse success : 6
72-
edge parse failure : 0
73-
edge insert success : 6
74-
edge insert failure : 0
75-
--------------------------------------------------
76-
meter metrics
77-
total time : 0.199s
78-
read time : 0.046s
79-
load time : 0.153s
80-
vertex load time : 0.077s
81-
vertex load rate(vertices/s) : 103
82-
edge load time : 0.112s
83-
edge load rate(edges/s) : 53
61+
```
62+
cd hugegraph-loader
63+
mvn clean package -DskipTests
8464
```
8565

86-
Then you can use `curl` or `hubble` to see the result.
66+
### 2.3 Use docker image (Convenient for Test/Dev)
8767

88-
```bash
89-
> curl "http://localhost:8080/graphs/hugegraph/graph/vertices" | gunzip
90-
{"vertices":[{"id":1,"label":"software","type":"vertex","properties":{"name":"lop","lang":"java","price":328.0}},{"id":2,"label":"software","type":"vertex","properties":{"name":"ripple","lang":"java","price":199.0}},{"id":"1:tom","label":"person","type":"vertex","properties":{"name":"tom"}},{"id":"1:josh","label":"person","type":"vertex","properties":{"name":"josh","age":32,"city":"Beijing"}},{"id":"1:marko","label":"person","type":"vertex","properties":{"name":"marko","age":29,"city":"Beijing"}},{"id":"1:peter","label":"person","type":"vertex","properties":{"name":"peter","age":35,"city":"Shanghai"}},{"id":"1:vadas","label":"person","type":"vertex","properties":{"name":"vadas","age":27,"city":"Hongkong"}},{"id":"1:li,nary","label":"person","type":"vertex","properties":{"name":"li,nary","age":26,"city":"Wu,han"}}]}
91-
```
68+
#### 2.3.1 Docker run
9269

93-
If you want to check the edges, use `curl "http://localhost:8080/graphs/hugegraph/graph/edges" | gunzip`
70+
Use the command `docker run -itd --name loader hugegraph/loader` to start loader.
9471

95-
#### 2.2.2 enter the docker container to load data
72+
If you want to load your data, you can mount the data folder like `-v /path/to/data/file:/loader/file`
9673

97-
If you want to do some additional operation in the container, you can enter the container as follows:
9874

99-
```bash
100-
docker exec -it loader bash
101-
```
75+
#### 2.3.2 Docker-compose
10276

103-
Then, you can load data as follows:
77+
The example `docker-compose.yml` is [here](./docker/example/docker-compose.yml). Use the command `docker-compose up -d` to deploy `loader` with `server` and `hubble`.
10478

105-
```bash
106-
sh bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h graph -p 8080
107-
```
79+
> Note:
80+
> 1. The docker image of hugegraph-loader is a convenience release, not **official distribution** artifacts. You can find more details from [ASF Release Distribution Policy](https://infra.apache.org/release-distribution.html#dockerhub).
81+
>
82+
> 2. Recommand to use `release tag`(like `1.0.0`) for the stable version. Use `latest` tag to experience the newest functions in development.
10883
109-
The result is as same as above.
84+
## 3 Load data
11085

111-
## 3. Use loader directly
86+
### 3.1 Use loader directly
11287

113-
> notice: currently, version is `1.0.0`
88+
> notice: currently, version is `1.2.0`
11489
11590
Download and unzip the compiled archive
11691

@@ -129,31 +104,23 @@ sh bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/f
129104

130105
More details is in the [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/)
131106

132-
## 4. Building
133-
134-
You can also build the `loader` by yourself.
135-
136-
Required:
107+
### 3.2 Load data with docker
137108

138-
- Java 8
139-
- Maven 3.6+
140-
141-
To build without executing tests:
109+
> If the `loader` and `server` is in the same docker network (for example, you deploy `loader` and `server` with `docker-compose`), we can set `-h {server_container_name}`. In our example, the container name of `server` is `graph`
110+
>
111+
> If `loader` is deployed alone, the `-h` should be set to the ip of the host of `server`. Other parameter description is [here](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/#341-parameter-description)
142112
113+
Visit [doc](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/#45-use-docker-to-load-data) for more details.
114+
143115
```bash
144-
mvn clean install -DskipTests=true
116+
docker exec -it loader bin/hugegraph-loader.sh -g hugegraph -f example/file/struct.json -s example/file/schema.groovy -h graph -p 8080
145117
```
146118

147-
To build with default tests:
148-
149-
```bash
150-
mvn clean install
151-
```
152119

153-
## 5. Doc
120+
## 4. Doc
154121

155122
The [loader homepage](https://hugegraph.apache.org/docs/quickstart/hugegraph-loader/) contains more information about it.
156123

157-
## 6. License
124+
## 5. License
158125

159126
hugegraph-loader is licensed under Apache 2.0 License.

0 commit comments

Comments
 (0)