Skip to content

Commit

Permalink
Merge branch 'hugegraph:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jadepeng committed May 26, 2021
2 parents 717cd56 + 718daa6 commit 8edd3cf
Show file tree
Hide file tree
Showing 267 changed files with 7,021 additions and 2,971 deletions.
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Bug report (反馈 Bug)
about: Create a bug report to help HugeGraph improve
title: '[Bug] Briefly describe the main problem here'
labels: 'bug'
assignees: ''

---

### Note ( 特别注意 ) :

> 1. 请先**搜索**, 并**确认**现有的 [Issues](https://github.com/hugegraph/hugegraph/issues)[FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有与您相同 / 相关的问题, 请勿重复提交
> 2. 我们需要尽可能**详细**的信息来**复现**问题, 越详细的信息 (包括**日志 / 截图 / 配置**等) 会**越快**被响应和处理
> 3. 请关注提交的 issue, 缺乏信息 / 长时间 ( > 14 天) 没有回复, issue 可能会被 **关闭** (需要时可再开启)

## Environment ( 环境信息 - 必填 )
- **Server Version**: v0.11.x (refer [here](https://hugegraph.github.io/hugegraph-doc/clients/restful-api/other.html))
- **Backend**: Cassandra 3.x, x nodes, HDD or SSD
- **OS**: xx CPUs, xx G RAM, Centos 7.x
- **Data Size**: xx vertices, xx edges (like 1000W 点, 9000W 边)

## Expected behavior ( 期望表现 )

xxx

## Actual behavior ( 实际表现 / 报错)

xxx

```java
// Error info ⬇ (尽可能详细的日志 + 完整异常栈)

```

## How to reproduce ( 复现步骤 )
1. step 1
2. step 2
3. step 3

**Refer:** [How to create a minimal reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example)

### Vertex/Edge example ( 问题点 / 边数据举例 )

```javascript
// JSON of Vertex / Edge ⬇

```

### Schema [VertexLabel, EdgeLabel, IndexLabel] ( 元数据结构 )

```javascript
// JSON of GraphSchema ⬇

```
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blank_issues_enabled: true

# 设置提 issue 前的参考文档
contact_links:
- name: HugeGraph Server Doc
url: https://hugegraph.github.io/hugegraph-doc/quickstart/hugegraph-server.html
about: Please search question here before opening a new issue
- name: HugeGraph API Doc
url: https://hugegraph.github.io/hugegraph-doc/clients/hugegraph-api.html
about: Please search usage here before opening a new issue
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Feature request (新需求 / 功能)
about: Give an idea for HugeGraph
title: '[Feature] Briefly describe the new features'
labels: 'feature'
assignees: ''
---

## Feature Description:

xxx
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/question_ask.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Ask question (提问)
about: Question about usage or configs in HugeGraph
title: '[Question] Briefly describe your problems here'
labels: ''
assignees: ''

---

### Note ( 特别注意 ) :

> 1. 请先**搜索**, 并**确认**现有的 [Issues](https://github.com/hugegraph/hugegraph/issues)[FAQ](https://hugegraph.github.io/hugegraph-doc/guides/faq.html) 中没有与您相同 / 相关的问题, 请勿重复提交
> 2. 我们需要尽可能**详细**的信息来**分析**问题, 越详细的信息 (包括**日志 / 截图 / 配置**等) 会**越快**被响应和处理
> 3. 请关注提交的 issue, 缺乏信息 / 长时间 ( > 14 天) 没有回复, issue 可能会被 **关闭** (需要时可再开启)

## Environment ( 环境信息 - 必填 )
- **Server Version**: v0.11.x (refer [here](https://hugegraph.github.io/hugegraph-doc/clients/restful-api/other.html))
- **Backend**: Cassandra 3.x, x nodes, HDD or SSD
- **OS**: xx CPUs, xx G RAM, Centos 7.x
- **Data Size**: xx vertices, xx edges (like 1000W 点, 9000W 边)

## Your Question ( 问题描述 )

xxx

> 注: 图使用 / 配置相关问题, 请优先参考 [REST-API 文档](https://hugegraph.github.io/hugegraph-doc/clients/hugegraph-api.html), 以及 [Server 配置文档](https://hugegraph.github.io/hugegraph-doc/config/config-option.html)
### Related information ( 补充相关信息 ) :
<details>
<summary> Provide related "Data & Schema" info (Click to expand) </summary>

### Vertex/Edge example ( 问题点 / 边数据举例 )

```javascript
// JSON of Vertex / Edge ⬇

```

### Schema [VertexLabel, EdgeLabel, IndexLabel] ( 元数据结构 )

```javascript
// JSON of GraphSchema ⬇

```
</details>
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: java

jdk:
- oraclejdk8
- openjdk8

dist: trusty
dist: xenial

sudo: required

Expand Down
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM ubuntu:xenial

LABEL maintainer="HugeGraph Docker Maintainers <[email protected]>"

ENV PKG_URL https://github.com/hugegraph

# 1. Install needed dependencies of GraphServer & RocksDB
RUN set -x \
&& apt-get -q update \
&& apt-get -q install -y --no-install-recommends --no-install-suggests \
curl \
lsof \
g++ \
gcc \
openjdk-8-jdk \
&& apt-get clean
# && rm -rf /var/lib/apt/lists/*

# 2. Init HugeGraph Sever
# (Optional) You can set the ip of github to speed up the local build
# && echo "192.30.253.112 github.com\n151.101.44.249 github.global.ssl.fastly.net" >> /etc/hosts \
ENV SERVER_VERSION 0.10.4
RUN set -e \
&& mkdir -p /root/hugegraph-server \
&& curl -L -S ${PKG_URL}/hugegraph/releases/download/v${SERVER_VERSION}/hugegraph-${SERVER_VERSION}.tar.gz -o /root/server.tar.gz \
&& tar xzf /root/server.tar.gz --strip-components 1 -C /root/hugegraph-server \
&& rm /root/server.tar.gz \
&& cd /root/hugegraph-server/ \
&& sed -i "s/^restserver.url.*$/restserver.url=http:\/\/0.0.0.0:8080/g" ./conf/rest-server.properties \
&& sed -n '63p' ./bin/start-hugegraph.sh | grep "&" > /dev/null && sed -i 63{s/\&$/#/g} ./bin/start-hugegraph.sh \
&& sed -n '74p' ./bin/start-hugegraph.sh | grep "exit" > /dev/null && sed -i 74{s/^/#/g} ./bin/start-hugegraph.sh \
&& ./bin/init-store.sh

# 3. Prepare for HugeGraph Studio
ENV STUDIO_VERSION 0.10.0
# (Optional) You can set the ip of github to speed up the local build
# && echo "192.30.253.112 github.com\n151.101.44.249 github.global.ssl.fastly.net" >> /etc/hosts \
RUN set -e \
&& mkdir -p /root/hugegraph-studio \
&& curl -L -S ${PKG_URL}/hugegraph-studio/releases/download/v${STUDIO_VERSION}/hugegraph-studio-${STUDIO_VERSION}.tar.gz -o /root/studio.tar.gz \
&& tar xzf /root/studio.tar.gz --strip-components 1 -C /root/hugegraph-studio \
&& rm /root/studio.tar.gz \
&& cd /root/hugegraph-studio/ \
&& sed -i "s/^studio.server.host.*$/studio.server.host=0.0.0.0/g" ./conf/hugegraph-studio.properties \
&& sed -i "s/^graph.server.host.*$/graph.server.host=0.0.0.0/g" ./conf/hugegraph-studio.properties

EXPOSE 8080 8088
WORKDIR /root
VOLUME /root

ENTRYPOINT ["./hugegraph-server/bin/start-hugegraph.sh"]
42 changes: 35 additions & 7 deletions hugegraph-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hugegraph</artifactId>
<groupId>com.baidu.hugegraph</groupId>
<version>0.11.2</version>
<version>0.12.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -17,6 +17,33 @@
<artifactId>hugegraph-core</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.baidu.hugegraph</groupId>
<artifactId>hugegraph-rpc</artifactId>
<version>1.0.0</version>
<exclusions>
<!-- conflict with jraft -->
<exclusion>
<groupId>com.alipay.sofa</groupId>
<artifactId>bolt</artifactId>
</exclusion>
<exclusion>
<groupId>com.alipay.sofa.common</groupId>
<artifactId>sofa-common-tools</artifactId>
</exclusion>
<exclusion>
<groupId>com.alipay.sofa</groupId>
<artifactId>hessian</artifactId>
</exclusion>
<!-- conflict with cassandra-netty/tinkerpop-server -->
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-server</artifactId>
Expand All @@ -27,6 +54,7 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
Expand Down Expand Up @@ -62,11 +90,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jersey2</artifactId>
</dependency>

<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-http</artifactId>
Expand All @@ -87,6 +110,11 @@
<artifactId>grizzly-http-servlet</artifactId>
<version>2.4.4</version>
</dependency>

<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jersey2</artifactId>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -125,7 +153,7 @@
</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Implementation-Version>0.58.0.0</Implementation-Version>
<Implementation-Version>0.61.0.0</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public String create(@Context GraphManager manager,

HugeGraph g = graph(manager, graph);
HugeAccess access = jsonAccess.build();
access.id(manager.userManager().createAccess(access));
return manager.serializer(g).writeUserElement(access);
access.id(manager.authManager().createAccess(access));
return manager.serializer(g).writeAuthElement(access);
}

@PUT
Expand All @@ -90,13 +90,13 @@ public String update(@Context GraphManager manager,
HugeGraph g = graph(manager, graph);
HugeAccess access;
try {
access = manager.userManager().getAccess(UserAPI.parseId(id));
access = manager.authManager().getAccess(UserAPI.parseId(id));
} catch (NotFoundException e) {
throw new IllegalArgumentException("Invalid access id: " + id);
}
access = jsonAccess.build(access);
manager.userManager().updateAccess(access);
return manager.serializer(g).writeUserElement(access);
manager.authManager().updateAccess(access);
return manager.serializer(g).writeAuthElement(access);
}

@GET
Expand All @@ -116,14 +116,14 @@ public String list(@Context GraphManager manager,
List<HugeAccess> belongs;
if (group != null) {
Id id = UserAPI.parseId(group);
belongs = manager.userManager().listAccessByGroup(id, limit);
belongs = manager.authManager().listAccessByGroup(id, limit);
} else if (target != null) {
Id id = UserAPI.parseId(target);
belongs = manager.userManager().listAccessByTarget(id, limit);
belongs = manager.authManager().listAccessByTarget(id, limit);
} else {
belongs = manager.userManager().listAllAccess(limit);
belongs = manager.authManager().listAllAccess(limit);
}
return manager.serializer(g).writeUserElements("accesses", belongs);
return manager.serializer(g).writeAuthElements("accesses", belongs);
}

@GET
Expand All @@ -136,8 +136,8 @@ public String get(@Context GraphManager manager,
LOG.debug("Graph [{}] get access: {}", graph, id);

HugeGraph g = graph(manager, graph);
HugeAccess access = manager.userManager().getAccess(UserAPI.parseId(id));
return manager.serializer(g).writeUserElement(access);
HugeAccess access = manager.authManager().getAccess(UserAPI.parseId(id));
return manager.serializer(g).writeAuthElement(access);
}

@DELETE
Expand All @@ -149,8 +149,10 @@ public void delete(@Context GraphManager manager,
@PathParam("id") String id) {
LOG.debug("Graph [{}] delete access: {}", graph, id);

@SuppressWarnings("unused") // just check if the graph exists
HugeGraph g = graph(manager, graph);
try {
manager.userManager().deleteAccess(UserAPI.parseId(id));
manager.authManager().deleteAccess(UserAPI.parseId(id));
} catch (NotFoundException e) {
throw new IllegalArgumentException("Invalid access id: " + id);
}
Expand Down
Loading

0 comments on commit 8edd3cf

Please sign in to comment.