-
Notifications
You must be signed in to change notification settings - Fork 590
feat(clustertest): add basic MiniCluster module for distributed system #2615
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
Merged
Merged
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
1c3794f
fix(server): Random generate default jwt secret key
HJ-Young 1460469
fix(server): random generate default jwt secret key
HJ-Young 9840c7c
Merge branch 'apache:master' into master
HJ-Young 85c2b6d
Apply suggestions from code review
imbajin f3199fa
Merge branch 'apache:master' into master
HJ-Young d43da0b
Merge branch 'apache:master' into master
HJ-Young 0d50758
feat(it): add basic miniCluster supports SimpleEnv
HJ-Young d7d3fc7
feat(it): add dist to generate configuration files
HJ-Young c21c936
chore(it): move the path in Env Object to ClusterConstant
HJ-Young ab08c68
chore(it): move the path in Env Object to ClusterConstant
HJ-Young 1c44444
Merge branch 'apache:master' into master
HJ-Young efa6c9c
chore(it): move the path in Env Object to ClusterConstant
HJ-Young 92a8001
Merge remote-tracking branch 'origin/master'
HJ-Young 1ef2cd0
feat(it): add the config and implement of multiEnv
HJ-Young 530f3ea
feat(it): amend the implement of reading configuration files
HJ-Young ce20f44
fix(it): fix the bug of coping wrong node dir
HJ-Young 31c58f4
fix(it): add configuration files in dist
HJ-Young 3476109
Merge branch 'apache:master' into master
HJ-Young 9f02e27
fix(it): get hugegraph.properties through template file
HJ-Young 1714213
fix(it): add 5s intervals between generation of pd nodes
HJ-Young 16a4347
Merge branch 'apache:master' into master
HJ-Young 7c57f67
Merge branch 'apache:master' into master
HJ-Young a23ab6f
feat(ct): add test and ci to CT module
HJ-Young deedb7d
feat(ct): add CI yml file
HJ-Young 7275b67
fix(ct): add dependency to ct-test pom
HJ-Young 4dfea30
fix(ct): delete unused pom dependencies
HJ-Young 2d1896a
fix(ct): fix ci file
HJ-Young 17f96a4
fix(ct): fix ci file
HJ-Young 94a60ba
fix(ct): fix ci file
HJ-Young 956226e
fix(ct): update dependency file
HJ-Young 4fa78c2
fix(ct): add Multi cluster test
HJ-Young 48cfc6e
chore(ct): reformat code & update config files
HJ-Young 80835a3
chore(ct): reformat code style based on code review comment
HJ-Young 1f593d8
fix(ct): resolve dependency problems & add exegesis in BaseTest class
HJ-Young 2f769d7
Merge branch 'apache:master' into master
HJ-Young dd0bbd6
fix(ct): use different Logger to record log
HJ-Young 6d391f6
Merge branch 'apache:master' into master
HJ-Young 57d39ad
fix(ct): sync new commit
HJ-Young 7ca4c8a
Apply suggestions from code review
HJ-Young 69b7623
fix(ct): update code based on comments
HJ-Young 359b832
fix(ct): fix pom file problem
HJ-Young 82d3dd3
fix(ct): update pom.xml
HJ-Young 981d572
fix code
imbajin ab3d76c
Apply suggestions from code review
HJ-Young 436c2ac
fix(ct): fix code style problems
HJ-Young d916ad8
Merge branch 'apache:master' into master
HJ-Young 2896c07
fix(ct): update hg-client version
HJ-Young 584c79b
fix(ct): simplify the dist
HJ-Young cf6994d
fix(ct): simplify the dist
HJ-Young e677136
fix(ct): simplify the dist
HJ-Young b4f451d
fix(ct): fix server config file path
HJ-Young File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: "Cluster Test CI" | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - 'release-*' | ||
| - 'test-*' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| cluster-test: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| USE_STAGE: 'true' # Whether to include the stage repository. | ||
|
|
||
| steps: | ||
| - name: Install JDK 11 | ||
| uses: actions/setup-java@v3 | ||
| with: | ||
| java-version: '11' | ||
| distribution: 'zulu' | ||
|
|
||
| - name: Cache Maven packages | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: ~/.m2 | ||
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: ${{ runner.os }}-m2 | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 5 | ||
|
|
||
| - name: use staged maven repo settings | ||
| if: ${{ env.USE_STAGE == 'true' }} | ||
| run: | | ||
| cp $HOME/.m2/settings.xml /tmp/settings.xml | ||
| mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml | ||
|
|
||
| - name: Package | ||
| run: | | ||
| mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp | ||
|
|
||
| - name: Run simple cluster test | ||
| run: | | ||
| mvn test -pl hugegraph-cluster-test/hugegraph-clustertest-test -am -P simple-cluster-test -DskipCommonsTests=true | ||
|
|
||
| - name: Run multi cluster test | ||
| run: | | ||
| mvn test -pl hugegraph-cluster-test/hugegraph-clustertest-test -am -P multi-cluster-test -DskipCommonsTests=true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
| ~ contributor license agreements. See the NOTICE file distributed with | ||
| ~ this work for additional information regarding copyright ownership. | ||
| ~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| ~ (the "License"); you may not use this file except in compliance with | ||
| ~ the License. You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
|
|
||
| <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <parent> | ||
| <groupId>org.apache.hugegraph</groupId> | ||
| <artifactId>hugegraph-cluster-test</artifactId> | ||
| <version>${revision}</version> | ||
| <relativePath>../pom.xml</relativePath> | ||
| </parent> | ||
|
|
||
| <artifactId>hugegraph-clustertest-dist</artifactId> | ||
|
|
||
| <properties> | ||
| <dist.dir>${project.parent.basedir}</dist.dir> | ||
| <shell-executable>bash</shell-executable> | ||
| <assembly.dir>${project.basedir}/src/assembly</assembly.dir> | ||
| <assembly.descriptor.dir>${assembly.dir}/descriptor</assembly.descriptor.dir> | ||
| <assembly.static.dir>${assembly.dir}/static</assembly.static.dir> | ||
| <executable.jar.name>hg-ct</executable.jar.name> | ||
| </properties> | ||
|
|
||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <artifactId>maven-assembly-plugin</artifactId> | ||
| <version>2.4</version> | ||
| <executions> | ||
| <execution> | ||
| <id>assembly-hugegraph-ct</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>single</goal> | ||
| </goals> | ||
| <configuration> | ||
| <attach>false</attach> | ||
| <appendAssemblyId>false</appendAssemblyId> | ||
| <outputDirectory>${dist.dir}</outputDirectory> | ||
| <descriptors> | ||
| <descriptor> | ||
| ${assembly.descriptor.dir}/assembly.xml | ||
| </descriptor> | ||
| </descriptors> | ||
| <finalName>${final.name}</finalName> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.apache.hugegraph</groupId> | ||
| <artifactId>hugegraph-clustertest-minicluster</artifactId> | ||
| <version>${revision}</version> | ||
| </dependency> | ||
| </dependencies> | ||
|
|
||
| </project> |
50 changes: 50 additions & 0 deletions
50
hugegraph-cluster-test/hugegraph-clustertest-dist/src/assembly/descriptor/assembly.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| <!-- | ||
| ~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
| ~ contributor license agreements. See the NOTICE file distributed with | ||
| ~ this work for additional information regarding copyright ownership. | ||
| ~ The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| ~ (the "License"); you may not use this file except in compliance with | ||
| ~ the License. You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
|
|
||
| <assembly> | ||
| <id>distribution</id> | ||
| <includeBaseDirectory>false</includeBaseDirectory> | ||
|
|
||
| <formats> | ||
| <format>dir</format> | ||
| </formats> | ||
|
|
||
| <fileSets> | ||
| <fileSet> | ||
| <directory>${assembly.static.dir}</directory> | ||
| <outputDirectory>/</outputDirectory> | ||
| <includes> | ||
| <include>**/*</include> | ||
| </includes> | ||
| </fileSet> | ||
|
|
||
| </fileSets> | ||
|
|
||
| <dependencySets> | ||
| <!-- code jars --> | ||
| <dependencySet> | ||
| <outputDirectory>/lib</outputDirectory> | ||
| <unpack>false</unpack> | ||
| <scope>runtime</scope> | ||
| <useProjectArtifact>false</useProjectArtifact> | ||
| <includes> | ||
| <include>org.apache.hugegraph:${executable.jar.name}:jar:*</include> | ||
| </includes> | ||
| </dependencySet> | ||
| </dependencySets> | ||
|
|
||
| </assembly> |
126 changes: 126 additions & 0 deletions
126
...er-test/hugegraph-clustertest-dist/src/assembly/static/conf/hugegraph.properties.template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| # gremlin entrance to create graph | ||
| # auth config: org.apache.hugegraph.auth.HugeFactoryAuthProxy | ||
| gremlin.graph=org.apache.hugegraph.HugeFactory | ||
|
|
||
| # cache config | ||
| #schema.cache_capacity=100000 | ||
| # vertex-cache default is 1000w, 10min expired | ||
| vertex.cache_type=l2 | ||
| #vertex.cache_capacity=10000000 | ||
| #vertex.cache_expire=600 | ||
| # edge-cache default is 100w, 10min expired | ||
| edge.cache_type=l2 | ||
| #edge.cache_capacity=1000000 | ||
| #edge.cache_expire=600 | ||
|
|
||
|
|
||
| # schema illegal name template | ||
| #schema.illegal_name_regex=\s+|~.* | ||
|
|
||
| #vertex.default_label=vertex | ||
|
|
||
| backend=hstore | ||
| serializer=binary | ||
|
|
||
| store=hugegraph | ||
|
|
||
| # pd config | ||
| pd.peers=$PD_PEERS_LIST$ | ||
|
|
||
| # task config | ||
| task.scheduler_type=local | ||
| task.schedule_period=10 | ||
| task.retry=0 | ||
| task.wait_timeout=10 | ||
|
|
||
| # raft config | ||
| raft.mode=false | ||
| raft.path=./raft-log | ||
| raft.safe_read=true | ||
| raft.use_replicator_pipeline=true | ||
| raft.election_timeout=10000 | ||
| raft.snapshot_interval=3600 | ||
| raft.backend_threads=48 | ||
| raft.read_index_threads=8 | ||
| raft.snapshot_threads=4 | ||
| raft.snapshot_parallel_compress=false | ||
| raft.snapshot_compress_threads=4 | ||
| raft.snapshot_decompress_threads=4 | ||
| raft.read_strategy=ReadOnlyLeaseBased | ||
| raft.queue_size=16384 | ||
| raft.queue_publish_timeout=60 | ||
| raft.apply_batch=1 | ||
| raft.rpc_threads=80 | ||
| raft.rpc_connect_timeout=5000 | ||
| raft.rpc_timeout=60 | ||
| raft.install_snapshot_rpc_timeout=36000 | ||
|
|
||
| # search config | ||
| search.text_analyzer=jieba | ||
| search.text_analyzer_mode=INDEX | ||
|
|
||
| # rocksdb backend config | ||
| #rocksdb.data_path=/path/to/disk | ||
| #rocksdb.wal_path=/path/to/disk | ||
|
|
||
|
|
||
| # cassandra backend config | ||
| cassandra.host=localhost | ||
| cassandra.port=9042 | ||
| cassandra.username= | ||
| cassandra.password= | ||
| #cassandra.connect_timeout=5 | ||
| #cassandra.read_timeout=20 | ||
| #cassandra.keyspace.strategy=SimpleStrategy | ||
| #cassandra.keyspace.replication=3 | ||
|
|
||
| # hbase backend config | ||
| #hbase.hosts=localhost | ||
| #hbase.port=2181 | ||
| #hbase.znode_parent=/hbase | ||
| #hbase.threads_max=64 | ||
| # IMPORTANT: recommend to modify the HBase partition number | ||
| # by the actual/env data amount & RS amount before init store | ||
| # It will influence the load speed a lot | ||
| #hbase.enable_partition=true | ||
| #hbase.vertex_partitions=10 | ||
| #hbase.edge_partitions=30 | ||
|
|
||
| # mysql backend config | ||
| #jdbc.driver=com.mysql.jdbc.Driver | ||
| #jdbc.url=jdbc:mysql://127.0.0.1:3306 | ||
| #jdbc.username=root | ||
| #jdbc.password= | ||
| #jdbc.reconnect_max_times=3 | ||
| #jdbc.reconnect_interval=3 | ||
| #jdbc.ssl_mode=false | ||
|
|
||
| # postgresql & cockroachdb backend config | ||
| #jdbc.driver=org.postgresql.Driver | ||
| #jdbc.url=jdbc:postgresql://localhost:5432/ | ||
| #jdbc.username=postgres | ||
| #jdbc.password= | ||
| #jdbc.postgresql.connect_database=template1 | ||
|
|
||
| # palo backend config | ||
| #palo.host=127.0.0.1 | ||
| #palo.poll_interval=10 | ||
| #palo.temp_dir=./palo-data | ||
| #palo.file_limit_size=32 |
80 changes: 80 additions & 0 deletions
80
...ster-test/hugegraph-clustertest-dist/src/assembly/static/conf/pd-application.yml.template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| spring: | ||
| application: | ||
| name: hugegraph-pd | ||
|
|
||
| management: | ||
| metrics: | ||
| export: | ||
| prometheus: | ||
| enabled: true | ||
| endpoints: | ||
| web: | ||
| exposure: | ||
| include: "*" | ||
|
|
||
| logging: | ||
| config: 'file:./conf/log4j2.xml' | ||
| license: | ||
| verify-path: ./conf/verify-license.json | ||
| license-path: ./conf/hugegraph.license | ||
| grpc: | ||
| port: $GRPC_PORT$ | ||
| # The service address of grpc needs to be changed to the actual local IPv4 address when deploying. | ||
| host: 127.0.0.1 | ||
|
|
||
| server: | ||
| # REST service port number | ||
| port : $REST_PORT$ | ||
|
|
||
| pd: | ||
| # Storage path | ||
| data-path: ./pd_data | ||
| # The check cycle of automatic expansion regularly checks the number of partitions in each store and automatically balances the number of partitions | ||
| patrol-interval: 1800 | ||
| # The minimum number of surviving store nodes, less than which the entire cluster is unavailable | ||
| initial-store-count: $STORE_COUNT$ | ||
| # The initial store list, grpc IP: grpc port, the store in the list is automatically activated | ||
| initial-store-list: $STORE_GRPC_LIST$ | ||
|
|
||
|
|
||
| raft: | ||
| # The address of the local raft service | ||
| address: $RAFT_ADDRESS$ | ||
| # The service address of the PD cluster | ||
| peers-list: $RAFT_PEERS_LIST$ | ||
|
|
||
| store: | ||
| # The time when the store went offline. After that time, the store is considered permanently unavailable, and the replica is allocated to another machine, in seconds | ||
| max-down-time: 172800 | ||
| # Specifies whether to enable store monitoring data storage | ||
| monitor_data_enabled: true | ||
| # The interval between monitoring data, minute, hour, second | ||
| # default: 1 min * 1 day = 1440 | ||
| monitor_data_interval: 1 minute | ||
| # Retention time of monitoring data is 1 day; day, month, year | ||
| monitor_data_retention: 1 day | ||
| initial-store-count: 1 | ||
|
|
||
| partition: | ||
| # Default number of replicas per partition | ||
| default-shard-count: 1 | ||
| # The default maximum number of replicas per machine | ||
| # the initial number of partitions= store-max-shard-count * store-number / default-shard-count | ||
| store-max-shard-count: 12 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.