Skip to content

Commit 4ff6549

Browse files
authored
Merge branch 'apache:master' into master
2 parents 03bdd3e + b9a3dd9 commit 4ff6549

77 files changed

Lines changed: 5259 additions & 2902 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# IMPORTANT: .dockerignore does NOT inherit .gitignore — patterns must be restated.
19+
20+
# Build output
21+
**/target/
22+
23+
# Pre-extracted release dirs / archives
24+
apache-hugegraph-*/
25+
**/*.tar
26+
**/*.tar.gz
27+
**/*.zip
28+
**/*.war
29+
30+
# IDE / OS
31+
.idea/
32+
.vscode/
33+
**/*.iml
34+
**/*.iws
35+
**/.DS_Store
36+
37+
# Build / runtime artifacts
38+
**/logs/
39+
**/*.log
40+
**/*.class
41+
**/gen-java/
42+
**/upload-files/
43+
**/build/
44+
**/node_modules/
45+
46+
# Env files
47+
.env.local
48+
.env.*.local
49+
50+
# Git internals
51+
.git
52+
.gitignore
53+
.gitattributes
54+
.github
55+
56+
# Compose / docs not needed in build context
57+
**/docker-compose*.yml
58+
**/docker-compose*.yaml
59+
**/*.md
60+
docs/
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
name: "Docker Build CI"
19+
20+
on:
21+
push:
22+
branches:
23+
- master
24+
- 'release-*'
25+
pull_request:
26+
paths:
27+
- '**/Dockerfile*'
28+
- '.dockerignore'
29+
30+
jobs:
31+
docker-build:
32+
runs-on: ubuntu-24.04
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
dockerfile:
37+
- hugegraph-pd/Dockerfile
38+
- hugegraph-store/Dockerfile
39+
- hugegraph-server/Dockerfile
40+
- hugegraph-server/Dockerfile-hstore
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Build ${{ matrix.dockerfile }}
47+
run: |
48+
docker build -f ${{ matrix.dockerfile }} .

.github/workflows/pd-store-ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ jobs:
5252
mvn -U -ntp dependency:get -Dartifact=org.apache.hugegraph:hugegraph-struct:$REVISION
5353
fi
5454
55+
- name: Run hugegraph-struct test
56+
if: ${{ hashFiles('hugegraph-struct/pom.xml') != '' }}
57+
run: |
58+
mvn -U -ntp -pl hugegraph-struct test
59+
5560
pd:
5661
needs: struct
5762
runs-on: ubuntu-latest

.github/workflows/rerun-ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818

1919
jobs:
2020
decide-rerun-action:
21+
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
2122
runs-on: ubuntu-latest
2223
outputs:
2324
action: ${{ steps.decision.outputs.action }}
@@ -28,19 +29,16 @@ jobs:
2829
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
2930
RUN_ID: ${{ github.event.workflow_run.id }}
3031
RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
31-
CONCLUSION: ${{ github.event.workflow_run.conclusion }}
3232
EVENT_NAME: ${{ github.event.workflow_run.event }}
3333
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
3434
run: |
3535
set -euo pipefail
3636
3737
action="skip"
38-
reason="non-failure"
38+
reason="unsupported event: $EVENT_NAME"
3939
40-
if [[ "$CONCLUSION" == "failure" ]]; then
41-
if [[ "$EVENT_NAME" != "push" && "$EVENT_NAME" != "pull_request" ]]; then
42-
reason="unsupported event: $EVENT_NAME"
43-
elif (( RUN_ATTEMPT > MAX_RERUNS )); then
40+
if [[ "$EVENT_NAME" == "push" || "$EVENT_NAME" == "pull_request" ]]; then
41+
if (( RUN_ATTEMPT > MAX_RERUNS )); then
4442
reason="retry limit reached"
4543
else
4644
action="rerun"

.github/workflows/server-ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,76 @@ jobs:
100100
with:
101101
token: ${{ secrets.CODECOV_TOKEN }}
102102
file: ${{ env.REPORT_DIR }}/*.xml
103+
104+
build-server-macos-rocksdb:
105+
runs-on: ${{ matrix.os }}
106+
strategy:
107+
fail-fast: false
108+
matrix:
109+
include:
110+
- os: macos-15-intel
111+
server_java_options: ''
112+
- os: macos-15
113+
server_java_options: '-Xms512m -Xmx2g'
114+
env:
115+
USE_STAGE: 'false' # Whether to include the stage repository.
116+
TRAVIS_DIR: hugegraph-server/hugegraph-dist/src/assembly/travis
117+
REPORT_DIR: target/site/jacoco
118+
BACKEND: rocksdb
119+
JAVA_VERSION: '11'
120+
SERVER_JAVA_OPTIONS: ${{ matrix.server_java_options }}
121+
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v4
125+
with:
126+
fetch-depth: 5
127+
128+
- name: Install Java ${{ env.JAVA_VERSION }}
129+
uses: actions/setup-java@v4
130+
with:
131+
java-version: ${{ env.JAVA_VERSION }}
132+
distribution: 'zulu'
133+
134+
- name: Cache Maven packages
135+
uses: actions/cache@v4
136+
with:
137+
path: ~/.m2
138+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
139+
restore-keys: ${{ runner.os }}-m2
140+
141+
- name: Use staged maven repo settings
142+
if: ${{ env.USE_STAGE == 'true' }}
143+
run: |
144+
cp $HOME/.m2/settings.xml /tmp/settings.xml
145+
cp -vf .github/configs/settings.xml $HOME/.m2/settings.xml && cat $HOME/.m2/settings.xml
146+
147+
- name: Compile
148+
run: |
149+
mvn clean compile -pl hugegraph-server/hugegraph-test -am -U -Dmaven.javadoc.skip=true -ntp
150+
151+
- name: Run RocksDB core test
152+
run: |
153+
$TRAVIS_DIR/run-core-test.sh $BACKEND
154+
155+
- name: Run RocksDB API test
156+
run: |
157+
$TRAVIS_DIR/run-api-test.sh $BACKEND $REPORT_DIR
158+
159+
- name: Show server log on failure
160+
if: failure()
161+
run: |
162+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
163+
SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/
164+
if [ -f "$SERVER_DIR/logs/hugegraph-server.log" ]; then
165+
tail -n 200 "$SERVER_DIR/logs/hugegraph-server.log"
166+
fi
167+
168+
- name: Stop RocksDB server
169+
if: always()
170+
run: |
171+
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
172+
SERVER_DIR=hugegraph-server/apache-hugegraph-server-$VERSION/
173+
if [ -f "$SERVER_DIR/bin/pid" ]; then
174+
$TRAVIS_DIR/stop-server.sh $SERVER_DIR || true
175+
fi

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ hugegraph-server/hugegraph-dist/docker/data/
9292

9393
# AI-IDE prompt files (We only keep AGENTS.md, other files could soft-linked it when needed)
9494
# Serena MCP memories
95-
.serena/
95+
.serena/*
96+
!.serena/project.yml
97+
!.serena/memories/
98+
.mcp.json
9699
# Claude Projects
97100
CLAUDE.md
98101
CLAUDE_*.md
@@ -114,3 +117,4 @@ codeium-instructions.md
114117
.ai-instructions.md
115118
*.ai-prompt.md
116119
WARP.md
120+
.mcp.json

.serena/memories/architecture_and_modules.md

Lines changed: 21 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -3,97 +3,33 @@
33
## Three-Tier Architecture
44

55
### 1. Client Layer
6-
- Gremlin/Cypher query interfaces
7-
- REST API endpoints
8-
- Multiple client language bindings
6+
- Gremlin/Cypher queries, REST APIs, Swagger UI
97

10-
### 2. Server Layer (hugegraph-server)
11-
- **REST API Layer** (hugegraph-api): GraphAPI, SchemaAPI, GremlinAPI, CypherAPI, AuthAPI
12-
- **Graph Engine Layer** (hugegraph-core): Schema management, traversal optimization, task scheduling
13-
- **Backend Interface**: Abstraction over storage backends
8+
### 2. Server Layer (hugegraph-server, 13 submodules)
9+
- **REST API** (hugegraph-api): GraphAPI, SchemaAPI, GremlinAPI, CypherAPI, AuthAPI, GraphSpaceAPI (distributed only), ManagerAPI (distributed only)
10+
- **Graph Engine** (hugegraph-core): Schema (with TTL update), traversal, task scheduling, GraphSpace multi-tenancy
11+
- **Backend Interface**: Pluggable via `BackendStore`
1412

1513
### 3. Storage Layer
16-
- Pluggable backend implementations
17-
- Each backend extends `hugegraph-core` abstractions
18-
- Implements `BackendStore` interface
14+
- RocksDB (default/embedded), HStore (distributed/production)
15+
- Legacy (≤1.5.0, deprecated, excluded from context): MySQL, PostgreSQL, Cassandra, ScyllaDB, HBase, Palo
1916

20-
## Multi-Module Structure
17+
## Module Structure (7 top-level modules)
2118

22-
The project consists of 7 main modules:
19+
### hugegraph-server (13 submodules)
20+
`hugegraph-core`, `hugegraph-api` (includes `opencypher/`, `space/`), `hugegraph-dist`, `hugegraph-test`, `hugegraph-example`, plus backends: `hugegraph-rocksdb`, `hugegraph-hstore`, `hugegraph-hbase`, `hugegraph-mysql`, `hugegraph-postgresql`, `hugegraph-cassandra`, `hugegraph-scylladb`, `hugegraph-palo`
2321

24-
### 1. hugegraph-server (13 submodules)
25-
Core graph engine, REST APIs, and backend implementations:
26-
- `hugegraph-core` - Core graph engine and abstractions
27-
- `hugegraph-api` - REST API implementations (includes OpenCypher in `opencypher/`)
28-
- `hugegraph-dist` - Distribution packaging and scripts
29-
- `hugegraph-test` - Test suites (unit, core, API, TinkerPop)
30-
- `hugegraph-example` - Example code
31-
- Backend implementations:
32-
- `hugegraph-rocksdb` (default)
33-
- `hugegraph-hstore` (distributed)
34-
- `hugegraph-hbase`
35-
- `hugegraph-mysql`
36-
- `hugegraph-postgresql`
37-
- `hugegraph-cassandra`
38-
- `hugegraph-scylladb`
39-
- `hugegraph-palo`
22+
### hugegraph-pd (8 submodules)
23+
Placement Driver: `hg-pd-core`, `hg-pd-service`, `hg-pd-client`, `hg-pd-common`, `hg-pd-grpc`, `hg-pd-cli`, `hg-pd-dist`, `hg-pd-test`
4024

41-
### 2. hugegraph-pd (8 submodules)
42-
Placement Driver for distributed deployments (meta server):
43-
- `hg-pd-core` - Core PD logic
44-
- `hg-pd-service` - PD service implementation
45-
- `hg-pd-client` - Client library
46-
- `hg-pd-common` - Shared utilities
47-
- `hg-pd-grpc` - gRPC protocol definitions (auto-generated)
48-
- `hg-pd-cli` - Command line interface
49-
- `hg-pd-dist` - Distribution packaging
50-
- `hg-pd-test` - Test suite
25+
### hugegraph-store (9 submodules)
26+
Distributed storage + Raft: `hg-store-core`, `hg-store-node`, `hg-store-client`, `hg-store-common`, `hg-store-grpc`, `hg-store-rocksdb`, `hg-store-cli`, `hg-store-dist`, `hg-store-test`
5127

52-
### 3. hugegraph-store (9 submodules)
53-
Distributed storage backend with RocksDB and Raft:
54-
- `hg-store-core` - Core storage logic
55-
- `hg-store-node` - Storage node implementation
56-
- `hg-store-client` - Client library
57-
- `hg-store-common` - Shared utilities
58-
- `hg-store-grpc` - gRPC protocol definitions (auto-generated)
59-
- `hg-store-rocksdb` - RocksDB integration
60-
- `hg-store-cli` - Command line interface
61-
- `hg-store-dist` - Distribution packaging
62-
- `hg-store-test` - Test suite
28+
### Others
29+
- **hugegraph-commons**: Shared utilities, RPC framework
30+
- **hugegraph-struct**: Data structures (must build before PD/Store)
31+
- **install-dist**: Distribution packaging, license files
32+
- **hugegraph-cluster-test**: Cluster integration tests
6333

64-
### 4. hugegraph-commons
65-
Shared utilities across modules:
66-
- Locks and concurrency utilities
67-
- Configuration management
68-
- RPC framework components
69-
70-
### 5. hugegraph-struct
71-
Data structure definitions shared between modules.
72-
**Important**: Must be built before PD and Store modules.
73-
74-
### 6. install-dist
75-
Distribution packaging and release management:
76-
- License and NOTICE files
77-
- Dependency management scripts
78-
- Release documentation
79-
80-
### 7. hugegraph-cluster-test
81-
Cluster integration tests for distributed deployments
82-
83-
## Cross-Module Dependencies
84-
85-
```
86-
hugegraph-commons → (shared by all modules)
87-
hugegraph-struct → hugegraph-pd + hugegraph-store
88-
hugegraph-core → (extended by all backend implementations)
89-
```
90-
91-
## Distributed Architecture (Optional)
92-
93-
For production distributed deployments:
94-
- **hugegraph-pd**: Service discovery, partition management, metadata
95-
- **hugegraph-store**: Distributed storage with Raft (3+ nodes)
96-
- **hugegraph-server**: Multiple server instances (3+)
97-
- Communication: All use gRPC with Protocol Buffers
98-
99-
**Status**: Distributed components (PD + Store) are in BETA
34+
## Distributed Deployment (BETA)
35+
PD + Store + Server (3+ nodes each), all gRPC. Docker compose configs in `docker/` directory, using bridge networking (migrated from host mode).

0 commit comments

Comments
 (0)