Compare commits

..

12 Commits

Author SHA1 Message Date
baijiaruo 8495841fe8 curvefs/client: fix client release read data cache core dump 2022-02-18 13:56:51 +08:00
Hanqing Wu 84c65094eb metaserver: fix deadlock and remove related tasks when copyset stop
after restarting metaserver, all previous copysets will be created
and recover from raft snapshot, during recovery, it will also restart
partition clean tasks, and each task needs corresponding copyset node.

deadlock happens because creating and recovering a copyset is
protected by CopysetNodeManager's lock, but partition clean tasks
also acquire this lock to get corresponding copyset node.

another problem is when copyset needs purge, we forget to stop related
tasks like partition cleaning task, s3 compact tasks. so, when these
tasks start to execution, metaserver will end up with segment fault.

this patch passes CopysetNode when creating MetaStore, so partition
clean task no need to acquire the lock, and, also call
`MetaStore::Clear` when copyset stop.
2022-02-10 14:28:42 +08:00
Hanqing Wu eefc435872 Revert "metaserver: fix deadlock after restart"
This reverts commit c4535eb96e.
2022-02-10 14:28:42 +08:00
Hanqing Wu c4535eb96e metaserver: fix deadlock after restart
after restarting metaserver, all previous copysets will be created
and recover from raft snapshot, during recovery, it will also restart
partition clean tasks, and each task needs corresponding copyset node.

deadlock happens because creating and recovering a copyset is
protected by CopysetNodeManager's lock, but partition clean tasks
also acquire this lock to get corresponding copyset node.

this patch moves copyset creating and recovering out of lock.
2022-01-24 12:33:19 +08:00
wanghai01 7ab3071537 curvefs: The curvefs cluster has some internal service which support cluster communicate itself and some external services support for client and management tools.
If all the services start on the same ip+port will affect the communication within the cluster when the heavy stress from client.
Start the services needed by outsied on another ip+port as a external server.
2022-01-23 20:05:15 -06:00
wanghai01 bf5cb013d0 curvefs mds heartbeat doesn't delete copyset creating.
The empty conf will send to metaserver to delete copysets which don't exist in mds, but when the copyset just created in metaserver and have not add to topology, the metaserver heartbeat will contain these copysets' infomation.
2022-01-23 20:05:15 -06:00
wanghai01 904a582afb curvefs: fix create copyset when exist already. If peers are all the same will success, otherwise return exist. 2022-01-23 20:05:15 -06:00
wanghai01 73ed8065a2 curvefs: support replace a servev which donen't works anymore.
If a server with some metaservers on it, and it crashed. Then will need
add a new server into the cluster.
2022-01-23 20:05:15 -06:00
YunhuiChen 29177dea60
Update deploy.py 2022-01-24 10:04:02 +08:00
chenwei 158357633a fix insert inode fail when load deleting partition 2022-01-19 10:12:16 +08:00
Cyber-SiKu 69fd7b26b6 curvefs_tool: fix s3 conf
1. set s3.blocksize 4194304
2. set s3.chunksize 67108863
2022-01-13 19:35:28 +08:00
hzwuhongsong@corp.netease.com 68176570ef curvefs/client: optimize trim strategy 2022-01-13 05:28:42 -06:00
1684 changed files with 54255 additions and 187615 deletions

View File

@ -1,10 +0,0 @@
build --verbose_failures
build --define=with_glog=true --define=libunwind=true
build --copt -DHAVE_ZLIB=1 --copt -DGFLAGS_NS=google --copt -DUSE_BTHREAD_MUTEX
build --cxxopt -Wno-error=format-security
build:gcc7-later --cxxopt -faligned-new
build --incompatible_blacklisted_protos_requires_proto_info=false
build --copt=-fdiagnostics-color=always
run --copt=-fdiagnostics-color=always

View File

@ -1 +0,0 @@
4.2.2

View File

@ -1,147 +0,0 @@
---
Language: Cpp
AccessModifierOffset: -3
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
...

12
.clangd
View File

@ -1,12 +0,0 @@
Diagnostics:
ClangTidy:
Add: [performance-*, modernize-*, readability-*,bugprone-*,]
Remove: [modernize-use-trailing-return-type]
CheckOptions:
readability-identifier-naming.VariableCase: camelBack
UnusedIncludes: Strict
InlayHints:
Enabled: No
ParameterNames: No
DeducedTypes: No

View File

@ -19,7 +19,11 @@ assignees: ''
**Versions (各种版本)**
OS:
Compiler:
branch:
commit id:
curve-mds:
curve-chunkserver:
curve-snapshotcloneserver:
curve-sdk:
nebd:
curve-nbd:
**Additional context/screenshots (更多上下文/截图)**

View File

@ -2,7 +2,7 @@
### What problem does this PR solve?
Issue Number: #xxx <!-- replace xxx with issue number -->
Issue Number: close #xxx <!-- REMOVE this line if no issue to close -->
Problem Summary:
@ -12,7 +12,7 @@ What's Changed:
How it Works:
Side effects(Breaking backward compatibility? Performance regression?):
Side effects(Breaking backward compatibility? Performance regression?):
### Check List

View File

@ -1,16 +0,0 @@
name: Issue assignment
on:
issues:
types: [opened]
jobs:
auto-assign:
runs-on: ubuntu-latest
steps:
- name: 'Auto-assign issue'
uses: pozil/auto-assign-issue@v1.10.1
with:
assignees: cw123,ilixiaocui,wuhongsong,Cyber-SiKu,jolly-sy
numOfAssignee: 1
allowSelfAssign: true

72
.gitignore vendored
View File

@ -35,7 +35,6 @@ CMakeLists.txt
bin
*.temp
.clwb
*.swp
# cscope
cscope.out
@ -74,27 +73,13 @@ bazel-testlogs
*.log
runlog/
# history
.gdb_history
.clang-format
.clangd
!curve-snapshotcloneserver-nginx/app/lib
!nebd/nebd-package/usr/bin
# mac
.DS_Store
test/client/configs/*
!test/client/configs/.gitkeep
projects/*
docker/curvebs
docker/base/*
docker/debian*/*so*
!docker/base/Dockerfile
!docker/base/Makefile
# curvefs
curvefs/devops/projects/
curvefs/devops/ssh/
@ -103,66 +88,9 @@ curvefs/BUILD_MODE
*.pyc
.facts/
*retry
# monitor
curvefs/monitor/prometheus/target.json
curvefs/docker/*/curvefs
curvefs/docker/curvefs
curvefs/docker/base/*
curvefs/docker/debian*/*so*
!curvefs/docker/base/Dockerfile
!curvefs/docker/base/Makefile
curvefs/BUILD_MODE
.BUILD_MODE
__not_found__
# thirdparties
thirdparties/rocksdb/lib/
thirdparties/rocksdb/include/
thirdparties/rocksdb/rocksdb/
thirdparties/rocksdb/*log
thirdparties/rocksdb/*.tar.gz
thirdparties/aws/*.tar.gz
thirdparties/etcdclient/tmp/
thirdparties/etcdclient/*.h
thirdparties/memcache/*.tar.gz
thirdparties/memcache/libmemcached-*/
/external
/bazel-*
/compile_commands.json
/.cache/
docker/curvebs
docker/*/curvebs
curvefs/docker/curvefs
curvefs/docker/*/curvefs
storage_*
tools-v2/sbin/*
tools-v2/proto/proto/*
tools-v2/proto/curvefs/*
tools-v2/*/*.test
tools-v2/__debug_bin
tools-v2/vendor/
.test
.note
.playground
.dumpfile
metastore_test.dat
GPATH
GRTAGS
GTAGS
core.*
test/integration/*.conf
test/integration/client/config/client.conf*
test/integration/snapshotcloneserver/config/*.conf
.pre-commit-config.yaml
*.deb
*.whl

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "nbd"]
path = nbd
url = https://github.com/opencurve/curve-nbd

View File

@ -1,2 +0,0 @@
container_name: curve-build-playground-master
container_image: opencurvedocker/curve-base:build-debian9

View File

@ -1,5 +1,5 @@
See [code changes](https://github.com/opencurve/curve/compare/v0.1.4...release1.0).
# CHANGELOG of v1.0.0
## The new features:
- Support external ip for ChunkServer to divide inter-cluster communication and communication with clients.
- The Curve_ops_tool supports printing space-info for each logical pool.
@ -16,30 +16,3 @@ See [code changes](https://github.com/opencurve/curve/compare/v0.1.4...release1.
- Fixed curvefs_tool (curve) missing support for password.
- Fixed the bug that data from Etcd would not placed in LRU cache.
- Fixed ChunkServer not aborting when read returns an internal error.
<hr/>
# CHANGELOG of v1.0.3-rc0
## New Feature
- [change max file length from 4TB to 20TB](https://github.com/opencurve/curve/pull/321)
<hr/>
# CHANGELOG of v1.0.4
## New Feature
- [support nbd auto map at boot](https://github.com/opencurve/curve/pull/347)
<hr/>
# CHANGELOG of v1.0.5
## Optimization
- [Change auto map service to systemd standard](https://github.com/opencurve/curve/pull/695)

View File

@ -22,35 +22,6 @@ Previous change logs can be found at [CHANGELOG-1.1](https://github.com/opencurv
- [Support to list the volume on copyset where majority copy is failed.](https://github.com/opencurve/curve/pull/233)
- [Clean up the unit test temporary folder.](https://github.com/opencurve/curve/pull/206/)
Hardware: 6 nodes, each with:
- 20x SATA SSD Intel® SSD DC S3500 Series 800G
- 2x Intel(R) Xeon(R) CPU E5-2660 v4 @ 2.00GHz
- 2x Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection, bond mode is 802.3ad with layer2+3 hash policy
- 251G RAM
Performance test is based on curve-nbd, the size of each block device is 200GB, all configurations are default, and each Chunkserver is deployed on one SSD.
1 NBD block device:
| item | iops/bandwidth | avg-latency | 99th-latency | striped volume<br>iops/bandwidth | striped volume<br>avg-latency | striped volume<br>99th-latency |
| :----: | :----: | :----: | :----: | :----: |:----: |:----: |
| 4K randwrite, 128 depth | 97,700 iops | 1.3 ms | 2.0 ms | 97,100 iops | 1.3 ms | 3.0 ms |
| 4K randread, 128 depth | 119,000 iops | 1.07 ms | 1.8 ms | 98,000 iops | 1.3 ms | 2.2 ms |
| 512K write, 128 depth | 208 MB/s | 307 ms | 347 ms | 462 MB/s | 138 ms | 228 ms |
| 512K read, 128 depth | 311 MB/s | 206 ms | 264 ms | 843 MB/s | 75 ms | 102 ms |
10 NBD block device:
| item | iops/bandwidth | avg-latency | 99th-latency | striped volume<br>iops/bandwidth | striped volume<br>avg-latency | striped volume<br>99th-latency |
| :----: | :----: | :----: | :----: | :----: |:----: |:----: |
| 4K randwrite, 128 depth | 231,000 iops | 5.6 ms | 50 ms | 227,000 iops | 5.9 ms | 53 ms |
| 4K randread, 128 depth | 350,000 iops | 3.7 ms | 8.2 ms | 345,000 iops | 3.8 ms | 8.2 ms |
| 512K write, 128 depth | 805 MB/s | 415 ms | 600 ms | 1,077 MB/s | 400 ms | 593 ms |
| 512K read, 128 depth | 2,402 MB/s | 267 ms | 275 ms | 3,313 MB/s | 201 ms | 245 ms |
## bug fix
- [Fix clone delete bug.](https://github.com/opencurve/curve/pull/176)
@ -60,39 +31,3 @@ Performance test is based on curve-nbd, the size of each block device is 200GB,
- [Fixed the direct_fd leak problem when wal write disk.](https://github.com/opencurve/curve/pull/113)
- [Fixed the atomicity problem of GetFile when not using the file pool.](https://github.com/opencurve/curve/pull/195)
- [Fixed in cluster_basic_test mds start error on InitEtcdClient() which produced coredump](https://github.com/opencurve/curve/pull/205)
<hr/>
# CHANGELOG of v1.2.1-rc0
## New Feature
- [curve-nbd: support simulate 512-byte logical/physical block device](https://github.com/opencurve/curve/pull/444)
- [curve-nbd: prevent mounted device to unmap](https://github.com/opencurve/curve/pull/453)
- [curve-nbd: add auto mount options](https://github.com/opencurve/curve/pull/473)
- [nebd: support multi-instances for different user](https://github.com/opencurve/curve/pull/444)
- [client: retry allocate segment until success](https://github.com/opencurve/curve/pull/452)
- [mds: schedule pending online chunkserver](https://github.com/opencurve/curve/pull/462)
## Bug Fix
- [ansible: backup and recover curvetab](https://github.com/opencurve/curve/pull/484)
- [debian package: backup and recover curvetab](https://github.com/opencurve/curve/pull/491)
- [scripts: fix potential overflow when cnovert ip to value](https://github.com/opencurve/curve/pull/474)
- [client: fix segment in SourceReader](https://github.com/opencurve/curve/pull/474)
- [client: explicit stop LeaseExecutor in FileInstance::UnInitialize](https://github.com/opencurve/curve/pull/474)
- [curve-nbd: fix concurrent nbd map](https://github.com/opencurve/curve/pull/447)
- [snapshotclone: fix cancel task lost](https://github.com/opencurve/curve/pull/463)
- [tools: remove copyset data after remove peer](https://github.com/opencurve/curve/pull/458)
- [mds: modify stale heartbeat update error with warning](https://github.com/opencurve/curve/pull/480)
- [chunkserver: fix config change epoch update error](https://github.com/opencurve/curve/pull/487)
<hr/>
# CHANGELOG of v1.2.2
## Optimization
- [Change auto map service to systemd standard](https://github.com/opencurve/curve/pull/699)

View File

@ -1,61 +0,0 @@
# CHANGELOG of v1.3
Previous change logs can be found at [CHANGELOG-1.2](https://github.com/opencurve/curve/blob/master/CHANGELOG-1.2.md)
## new features
- [Support discard to garbage collection.](https://github.com/opencurve/curve/pull/189)
- [QoS of client.](https://github.com/opencurve/curve/pull/268)
- [QoS of SnapshotCloneServer.](https://github.com/opencurve/curve/pull/303)
- [Recover file in recycleBin.](https://github.com/opencurve/curve/pull/259)
- [Fill chunks in chunkfile pool with 0 in the background.](https://github.com/opencurve/curve/pull/322)
- [Silent data CRC verification in the background.](https://github.com/opencurve/curve/pull/377)
- [Periodic automatic cleaning of recyclebin.](https://github.com/opencurve/curve/pull/310)
## optimization
- Optimize optimize build script, optimize log printing.
- Translate some document and code comment from Chinese to English.
- [Mark a online chunkserver to pendding status to migrate it's data.](https://github.com/opencurve/curve/pull/252)
- [Clean up the remaining copyset after remove peer.](https://github.com/opencurve/curve/pull/373)
- [Nbd auto map at reboot.](https://github.com/opencurve/curve/pull/347)
- ansible script improve:
- [Improve bool type var and some issues.](https://github.com/opencurve/curve/pull/331)
- [Improve daemon restart.](https://github.com/opencurve/curve/pull/315)
- [Incorporate some scripts in debain package and ansible template.](https://github.com/opencurve/curve/pull/380)
## bug fix
- [Fix recyclebin space statistics error bug.](https://github.com/opencurve/curve/pull/294)
- [Fix a metric bug when not use walpool.](https://github.com/opencurve/curve/pull/291)
- [Fix a nbd map concurrently bug.](https://github.com/opencurve/curve/pull/302)
- [Fix discard and flatten concurrency issues.](https://github.com/opencurve/curve/pull/312)
- [Fix max chunk id calculation error when use chunkfile poo as wal pool.](https://github.com/opencurve/curve/pull/341)
- [Fix client retry when allocate segment failed as cluster space is pool.](https://github.com/opencurve/curve/pull/338)
- [Add protection for unmap operation when io is not stopped.](https://github.com/opencurve/curve/pull/348)
- [Fix a segment fault when client read from clone source.](https://github.com/opencurve/curve/pull/358)
<hr>
# CHANGELOG of v1.3-beta1
## bug fix
- [Fix duplicate delete segment in mds on discard feature.](https://github.com/opencurve/curve/pull/421)
- [Fix trash metirc statistic bug.](https://github.com/opencurve/curve/pull/417)
- [Fix copyset status judgment after set pendding on online statue.](https://github.com/opencurve/curve/pull/416)
- [Add mount options in auto map nbd volume script.](https://github.com/opencurve/curve/pull/407)
- [Fix add qos for clone volume.](https://github.com/opencurve/curve/pull/421)
- [Fix crc issues in chunkserver.](https://github.com/opencurve/curve/pull/405)
- [Fix crc issues in mds and add scan-status support in curve_ops_tool.](https://github.com/opencurve/curve/pull/420)
- [Fix core dump when chunkserver SIGINT exit sometimes.](https://github.com/opencurve/curve/pull/429)
<hr>
# CHANGELOG of v1.3-beta2
## new feature
- [Support 512 bytes aligned IO requests.](https://github.com/opencurve/curve/pull/435)

View File

@ -1,26 +0,0 @@
# CHANGELOG of v2.0
The content of Curve v2.0 includes CurveBS v1.3, CurveFS v0.2.0 and some other content listed below.
Previous change logs can be found at [CHANGELOG-1.3](https://github.com/opencurve/curve/blob/master/CHANGELOG-1.3.md)
## new features
- [CurveFS: support replace a server which doesn't work anymore.](https://github.com/opencurve/curve/pull/954)
- [CurveFS: support internal and external services.](https://github.com/opencurve/curve/issues/973)
## optimization
- [CurveFS client: update inode asynchronously.](https://github.com/opencurve/curve/pull/1020)
- [Turn off batch delete object in the config file.](https://github.com/opencurve/curve/pull/997)
- [Remove create filesystem at mount process and use curvefs-tool instead.](https://github.com/opencurve/curve/pull/899)
- [Optimizing delete filesystem confirmation of curvefs-tool.](https://github.com/opencurve/curve/issues/843)
- [Optimizing leaky bucket algorithm of quality of service.](https://github.com/opencurve/curve/pull/1045)
## bug fix
- [Fix insert inode fail when load deleting partition.](https://github.com/opencurve/curve/pull/997)
- [Fix read fail when write cache of diskcache is enabled, because metadata maybe newer than data in S3.](https://github.com/opencurve/curve/pull/1006)
- [Fix CurveFS mds heartbeat doesn't delete copyset creating.](https://github.com/opencurve/curve/pull/1011)
- [Fix CurveFS create copyset when exist already.](https://github.com/opencurve/curve/pull/1002)

View File

@ -1,41 +0,0 @@
# CHANGELOG of v2.1
## new features
- [CurveFS: a curve filesystem can be mounted by multi fuse clients.](https://github.com/opencurve/curve/pull/1101)
- [CurveFS: support summary info in dir xattr.](https://github.com/opencurve/curve/pull/1150)
- [CurveFS: support Multiple s3.](https://github.com/opencurve/curve/pull/1132)
## optimization
- [CurveFS client: adapter lru list for disk cache.](https://github.com/opencurve/curve/pull/1088)
- [CurveFS: meta balance.](https://github.com/opencurve/curve/pull/1105)
- [CurveFS metaserver: let s3 compact task store a shared copyset node.](https://github.com/opencurve/curve/pull/1165)
- [CurveFS: add metric for mds topology to update metaserver metric.](https://github.com/opencurve/curve/pull/1177)
## bug fix
- [CurveFS client: fix bug of getleader always fails causes stack overflow.](https://github.com/opencurve/curve/pull/1070)
- [CurveFS tool: fix copyset health check error.](https://github.com/opencurve/curve/pull/1024)
- [CurveFS client: fix client release read data cache core dump.](https://github.com/opencurve/curve/pull/1090)
- [CurveBS nbd: fix misspell in log.](https://github.com/opencurve/curve/pull/1073)
- [CurveFS mds: update copyset condidate.](https://github.com/opencurve/curve/pull/1085)
- [CurveFS client: fix bug of rpc overtime time not backoff.](https://github.com/opencurve/curve/pull/1139)
- [CurveFS client: fix bug when upload failed.](https://github.com/opencurve/curve/pull/1130)
- [CurveFS client: fix the problem that chunkCacheManager has been releaed.](https://github.com/opencurve/curve/pull/1179)
- [CurveFS: fix partition num in topology metric.](https://github.com/opencurve/curve/pull/1187)
- [CurveFS client: fix core dump of DataCache::Flush & fix rpc timeout not backoff.](https://github.com/opencurve/curve/pull/1193)

View File

@ -1,23 +0,0 @@
# CHANGELOG of v2.2
## Feature
- [curvefs: support curvebs as data backend](https://github.com/opencurve/curve/pull/1207)
- [curvefs/metaserver: now we support rocksdb storage](https://github.com/opencurve/curve/pull/1214)
## Optimization
- [optimize copyset creation](https://github.com/opencurve/curve/pull/1211)
- [curvefs/client: s3 adaptor unit test optimization](https://github.com/opencurve/curve/pull/1227)
- [curvefs: xattr summary info support hard link](https://github.com/opencurve/curve/pull/1185)
## Bugfix
- [curvefs/client: fix waitIntervalSec_ is not init](https://github.com/opencurve/curve/pull/1248)
- [metaserver: fix empty configuration after load snapshot](https://github.com/opencurve/curve/pull/1260)
- [curvefs-mds: fix an uninitialized that spawn infinite threads](https://github.com/opencurve/curve/pull/1272)

View File

@ -1,126 +0,0 @@
# CHANGELOG of v2.3
Previous change logs can be found at [CHANGELOG-2.2](https://github.com/opencurve/curve/blob/master/CHANGELOG-2.2.md)
## Notable Changes
- [CurveFS : adapt to curveadm to support curvebs as data backend](https://github.com/opencurve/curve/pull/1349)
- [CurveFS monitor: promethus](https://github.com/opencurve/curve/pull/1237)
- [CurveFS client: perf optimize](https://github.com/opencurve/curve/pull/1194)
- [CurveFS metaserver: fixed rocksdb storage memory leak caused by unreleasing iterator and transaction.](https://github.com/opencurve/curve/pull/1388)
## new features
- [CurveFS : adapt to curveadm to support curvebs as data backend](https://github.com/opencurve/curve/pull/1349)
- [CurveFS monitor: promethus](https://github.com/opencurve/curve/pull/1237)
- [CurveFS client: add s3.useVirtualAddressing config, default value: false](https://github.com/opencurve/curve/pull/1253)
## optimization
- [CurveFS metaserver: speed up getting inode by padding inode's s3chunk](https://github.com/opencurve/curve/pull/1344)
- [CurveFS client: perf optimize](https://github.com/opencurve/curve/pull/1194)
## Data Performance
Hardware: 3 nodes (3*mds, 9*metaserver), each with:
- Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
- 256G RAM
- disk cache: INTEL SSDSC2BB80 800G(iops is about 30000+,bw is about 300MB)
- performance is as follows:
s3 backend is minio and the cto is disable([what is cto](https://github.com/opencurve/curve/blob/master/docs/cn/CurveFS%E6%94%AF%E6%8C%81%E5%A4%9A%E6%8C%82%E8%BD%BD.pdf)). and as you know, the performance of read may associated with read cache hit.
| minio + diskcache(free)| iops/bandwidth | avg-latency(ms) | clat 99.00th (ms) | clat 99.99th (ms) |
| :----: | :----: | :----: | :----: | :----: |
| (numjobs 1) (50G filesize) 4k randwrite | 3539 | 0.281 | 1.5 | 16 |
| (numjobs 1) (50G filesize) 4k randread | 2785 | 0.357 | 0.9 | 5.8|
| (numjobs 1) (50G filesize) 512k write | 290 MB/s | 1 | 600 ms | 248|
| (numjobs 1) (50G filesize) 512k read | 216 MB/s | 4.3 | 275 ms | 7.6 |
| minio + diskcache(near full)| iops/bandwidth | avg-latency(ms) | clat 99.00th (ms) | clat 99.99th (ms) |
| :----: | :----: | :----: | :----: | :----: |
| (numjobs 1) (50G filesize) 4k randwrite | 2988 | 0.3 | 1.2 | 18 |
| (numjobs 1) (50G filesize) 4k randread | 1559 | 0.6 | 1.9 | 346|
| (numjobs 1) (50G filesize) 512k write | 266 MB/s | 0.9| 600 ms | 396|
| (numjobs 1) (50G filesize) 512k read | 82 MB/s | 86 | 275 ms | 901|
| minio + diskcache(full)| iops/bandwidth | avg-latency(ms) | clat 99.00th (ms) | clat 99.99th (ms) |
| :----: | :----: | :----: | :----: | :----: |
| (numjobs 1) (20G filesize * 5) 4k randwrite | 2860 | 1.7| 14 | 41 |
| (numjobs 1) (20G filesize * 5) 4k randread | 76 | 65 | 278 | 725|
| (numjobs 1) (20G filesize * 5) 512k write | 240 MB/s | 10| 278 | 513|
| (numjobs 1) (20G filesize * 5) 512k read | 192 MB/s | 12 | 40 | 1955 |
## Metadata Performance
Cluster Topology: 3 nodes (3mds, 6metaserver), each metaserver is deployed on a separate SATA SSD
Configuration: use default configuration
Test tool: mdtest v3.4.0
Test cases:
- case 1: the directory structure is relatively flat and total 130,000 dirs and files.
mdtest -z 2 -b 3 -I 10000 -d /mountpoint
- case 2: the directory structure is relatively deep and total 204,700 dirs and files.
mdtest -z 10 -b 2 -I 100 -d /mountpoint
| Case | Dir creation | Dir stat | Dir rename | Dir removal | File creation | File stat | File read | File removal | Tree creation | Tree removal |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| case 1 | 1320 | 5853 | 149 | 670 | 1103 | 5858 | 1669 | 1419 | 851 | 64 |
| case 2 | 1283 | 5205 | 147 | 924 | 1081 | 5316 | 1634 | 1260 | 1302 | 887 |
You can set configuration item fuseClient.enableMultiMountPointRename to false in client.conf if you don't need concurrent renames on multiple mountpoints on the same filesystem. It will improve the performance of metadata.
fuseClient.enableMultiMountPointRename=false
| Case | Dir creation | Dir stat | Dir rename | Dir removal | File creation | File stat | File read | File removal | Tree creation | Tree removal |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| case 1 | 1537 | 7885 | 530 | 611 | 1256 | 7998 | 1861 | 1614 | 1050 | 72 |
| case 2 | 1471 | 6328 | 509 | 1055 | 1237 | 6874 | 1818 | 1454 | 1489 | 1034 |
## bug fix
- [CurveFS mds: fix an uninitialized that spawn infinite threads](https://github.com/opencurve/curve/pull/1270)
- [CurveFS client: fix missing update extent cache](https://github.com/opencurve/curve/pull/1279)
- [CurveFS: fix a compatible issue which caused by modify FsFileType ](https://github.com/opencurve/curve/pull/1359)
- [CurveFS client: fix bug cachedisk never trim](https://github.com/opencurve/curve/pull/1378)
- [CurveFS client: fix bug of io hang](https://github.com/opencurve/curve/pull/1377)
- [CurveFS metaserver: fixed rocksdb storage memory leak caused by unreleasing iterator and transaction.](https://github.com/opencurve/curve/pull/1388)
- [CurveFS client: Adjust the number of retries to the maximum to avoid an error when the number of retries is reached](https://github.com/opencurve/curve/pull/1410)
- [CurveFS : fix clear copyset creating flag when create copyset success](https://github.com/opencurve/curve/pull/1417)
- [CurveFS mds: fix miss set txid when create partition and fix inodeId type](https://github.com/opencurve/curve/pull/1479)
- [CurveFS client: fix the data iteration error when rpc retry.](https://github.com/opencurve/curve/pull/1474)
- [CurveFS metaserver: skip find dentry when loading from snapshot](https://github.com/opencurve/curve/pull/1460)
- [CurveFS : fix compile error which was caused by LatencyUpdater success](https://github.com/opencurve/curve/pull/1508)
- [CurveFS mds: fix create partition error at parallel case](https://github.com/opencurve/curve/pull/1511)
- [CurveFS metaserver: fix the data iteration error when rpc retry.metaserver: recover s3ChunkInfoRemove field for GetOrModify](https://github.com/opencurve/curve/pull/1404)
- [CurveFS metaserver: fixed s3chunkinfo was padding into inode when it wasnt needed](https://github.com/opencurve/curve/pull/1510)
- [Curve common: fix timer bug](https://github.com/opencurve/curve/pull/1492)
- [CurveFS client: fix statfs problem](https://github.com/opencurve/curve/pull/1620)

View File

@ -1,47 +0,0 @@
# CHANGELOG of v2.4
Previous change logs can be found at [CHANGELOG-2.3](https://github.com/opencurve/curve/blob/master/CHANGELOG-2.3.md)
## Notable Changes
- [Update aws-sdk-cpp version to 1.9](https://github.com/opencurve/curve/pull/1780)
- [add feature of warmup](https://github.com/opencurve/curve/pull/1793)
## new features
- [CurveFS: implement setxattr interface](https://github.com/opencurve/curve/pull/1935)
- [update aws-sdk-cpp: add ip and custom port support](https://github.com/opencurve/curve/pull/1795)
- [CurveFS client: add s3.useVirtualAddressing config, default value: false](https://github.com/opencurve/curve/pull/1253)
- [Update aws-sdk-cpp version to 1.9](https://github.com/opencurve/curve/pull/1780)
- [add feature of warmup](https://github.com/opencurve/curve/pull/1793)
## optimization
- [CurveFS: update attr and extent in single rpc](https://github.com/opencurve/curve/pull/1784)
- [copyset schedule select copyset random](https://github.com/opencurve/curve/pull/1811)
- [CurveFS: only update dirty inode metadata](https://github.com/opencurve/curve/pull/1853)
## bug fix
- [CurveFS: fix RefreshInode do not refresh when inode exist](https://github.com/opencurve/curve/pull/1800)
- [fix misuse Locked & Unlocked calling contract](https://github.com/opencurve/curve/pull/1279)
- [make callback of s3async request async to avoid deadlock](https://github.com/opencurve/curve/pull/1854)
- [CurveFS :fix update nlink error ](https://github.com/opencurve/curve/pull/1901)
- [CurveFS client: fix umount bug](https://github.com/opencurve/curve/pull/1923)
- [CurveFS client: fix refresh inode will overwrite data in cache when enabel cto.](https://github.com/opencurve/curve/pull/1993)

View File

@ -1,49 +0,0 @@
# CHANGELOG of v2.5
Previous change logs can be found at [CHANGELOG-2.4](https://github.com/opencurve/curve/blob/master/CHANGELOG-2.4.md)
## New Features
- Memcache support
- [curvefs/client: support memcached cluster](https://github.com/opencurve/curve/pull/2096) @ilixiaocui
- [curvefs/mds: support memcache cluster](https://github.com/opencurve/curve/pull/2108) @Cyber-SiKu
- [curvefs/client: add global cache client like memcached](https://github.com/opencurve/curve/pull/2102) @fansehep
- [curvefs/client: fix client core dump error](https://github.com/opencurve/curve/pull/2157) @ilixiaocui
- [add ut](https://github.com/opencurve/curve/pull/2164) @Cyber-SiKu
- curvefs new tools
- [add delete impl](https://github.com/opencurve/curve/pull/2088) @shentupenghui
- [feat: [tools-v2] bs list dir](https://github.com/opencurve/curve/pull/2082) @Sindweller
- [fix missing docs links](https://github.com/opencurve/curve/pull/2082) @zyb521
- [curve/toos-v2: add list client #2037](https://github.com/opencurve/curve/pull/2076) @tsonglew
- [support create volume directory by curve_ops_tool](https://github.com/opencurve/curve/pull/2078) @aspirer
- [install: added playground.](https://github.com/opencurve/curve/pull/2053) @Wine93
## Optimization
- [update the braft to vesion v1.1.2](https://github.com/opencurve/curve/pull/2091) @tangwz
- [curvefs/client: local cache policy optimization](https://github.com/opencurve/curve/pull/2064) @Tangruilin
- [sync by threadpool](https://github.com/opencurve/curve/pull/1912) @fansehep
- Merge block storage and file storage compilation scripts
- [Merge block storage and file storage compilation scripts
](https://github.com/opencurve/curve/pull/2089) @linshiyx
- [Add help_msg in Makefile](https://github.com/opencurve/curve/pull/2133) @linshiyx
- [fix image.sh](https://github.com/opencurve/curve/pull/2124) @SeanHai
- [fix bs list zone typo](https://github.com/opencurve/curve/pull/2066) @tsonglew
- [spell optimize](https://github.com/opencurve/curve/pull/2059) @shentupenghui
## Bug Fix
- aws s3 sdk revert
- [revert new s3 sdk due to critical bug](https://github.com/opencurve/curve/pull/2149) @h0hmj
- [curvefs/client: change the default value of s3](https://github.com/opencurve/curve/pull/2158) @wuhongsong

298
LICENSE
View File

@ -1,202 +1,152 @@
Files: *
Copyright: Copyright (c) 2020, NetEase Inc.
License: Apache 2.0 (see LICENSE_APACHE)
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Files: curve-snapshotcloneserver-nginx/docker/Dockerfile
Copyright: Copyright (c) 2017-2020, Evan Wies evan@neomantra.net.
License:
================================================================================
docker-openresty is licensed under the 2-clause BSD license.
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Copyright (c) 2017-2020, Evan Wies evan@neomantra.net.
1. Definitions.
This module is licensed under the terms of the BSD license.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
Files: curve-snapshotcloneserver-nginx/app/etc/config.lua
curve-snapshotcloneserver-nginx/app/lib/resty/argutils.lua
curve-snapshotcloneserver-nginx/app/lib/resty/checkups.lua
curve-snapshotcloneserver-nginx/app/lib/resty/checkups/*
curve-snapshotcloneserver-nginx/app/src/modules/httpipe.lua
curve-snapshotcloneserver-nginx/app/src/modules/httproxy.lua
curve-snapshotcloneserver-nginx/app/src/modules/reqlimit.lua
Copyright: Copyright (C) 2014-2016 UPYUN, Inc.
License:
================================================================================
The bundle itself is licensed under the 2-clause BSD license.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
Copyright (c) 2016, UPYUN(又拍云) Inc.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
This module is licensed under the terms of the BSD license.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
Files: curve-snapshotcloneserver-nginx/app/lib/resty/uuid.lua
Copyright: Copyright (c) 2016-2019 Thibault Charbonnier
License:
================================================================================
The MIT License (MIT)
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
Copyright (c) 2016-2019 Thibault Charbonnier
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================================================
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
Files: monitor/*
Copyright: Copyright (c) 2020, NetEase Inc.
License: GPL 2.0 (see LICENSE_GPL)
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
Files: src/chunkserver/raftsnapshot/curve_file_service.cpp
src/chunkserver/raftsnapshot/curve_file_service.h
src/chunkserver/raftsnapshot/curve_snapshot.cpp
src/chunkserver/raftsnapshot/curve_snapshot.h
src/chunkserver/raftsnapshot/curve_snapshot_copier.cpp
src/chunkserver/raftsnapshot/curve_snapshot_copier.h
src/chunkserver/raftsnapshot/curve_snapshot_file_reader.cpp
src/chunkserver/raftsnapshot/curve_snapshot_file_reader.h
src/chunkserver/raftsnapshot/curve_snapshot_reader.cpp
src/chunkserver/raftsnapshot/curve_snapshot_reader.h
src/chunkserver/raftsnapshot/curve_snapshot_storage.cpp
src/chunkserver/raftsnapshot/curve_snapshot_storage.h
src/chunkserver/raftsnapshot/curve_snapshot_writer.cpp
src/chunkserver/raftsnapshot/curve_snapshot_writer.h
Copyright: Copyright (c) 2020, NetEase Inc.
Copyright (c) 2015 Baidu.com, Inc.
License: Apache 2.0 (see LICENSE_APACHE)
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
Files: src/common/authenticator.cpp
Copyright: Copyright (c) 2020, NetEase Inc.
Copyright (c) 2016 Baidu, Inc.
License: Apache 2.0 (see LICENSE_APACHE)
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
Files: src/common/hash.h
Copyright: Copyright (c) 2020, NetEase Inc.
Copyright (c) 2015, Baidu.com
Copyright (c) 2011 The LevelDB Authors
License: Apache 2.0 (see LICENSE_APACHE)
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
Files: src/common/string_util.h
Copyright: Copyright (c) 2020, NetEase Inc.
Copyright (c) 2015, Baidu.com
License: Apache 2.0 (see LICENSE_APACHE)
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
Files: src/mds/nameserver2/file_lock.cpp
src/mds/nameserver2/file_lock.h
Copyright: Copyright (c) 2020, NetEase Inc.
Copyright (c) 2016, Baidu.com, Inc.
License: Apache 2.0 (see LICENSE_APACHE)
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
Files: src/tools/nbd/*
Copyright: Copyright (c) 2020, NetEase Inc.
License: GPL 2.0 (see LICENSE_GPL)
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
Files: src/tools/nbd/nbd-netlink.h
Copyright: Copyright (C) 2017 Facebook
License: GPL 2.0 (see LICENSE_GPL)
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
Files: src/tools/nbd/define.h
src/tools/nbd/NBDController.cpp
src/tools/nbd/NBDController.h
src/tools/nbd/NBDServer.cpp
src/tools/nbd/NBDServer.h
src/tools/nbd/util.cpp
Copyright: Copyright (c) 2020, NetEase Inc.
Copyright (C) 2015 - 2016 Kylin Corporation
License: LGPL 2.1 (see LICENSE_LGPL)
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
Files: src/tools/nbd/texttable.cpp
src/tools/nbd/texttable.h
Copyright: Copyright (c) 2020, NetEase Inc.
Copyright (C) 2012 Inktank Storage, Inc.
License: LGPL 2.1 (see LICENSE_LGPL)
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
Files: test/chunkserver/raftsnapshot/curve_snapshot_storage_test.cpp
Copyright: Copyright (c) 2020, NetEase Inc.
Copyright (c) 2015 Baidu.com, Inc.
License: Apache 2.0 (see LICENSE_APACHE)
END OF TERMS AND CONDITIONS
Files: test/tools/nbd/*
Copyright: Copyright (c) 2020, NetEase Inc.
License: GPL 2.0 (see LICENSE_GPL)
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed 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.
Files: thirdparties/aws/*
common.bzl
Copyright: Copyright 2019 The TensorFlow Authors
License: Apache 2.0 (see LICENSE_APACHE)

202
LICENSE_APACHE Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed 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.

339
LICENSE_GPL Normal file
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

502
LICENSE_LGPL Normal file
View File

@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

13
MAINTAINERS Normal file
View File

@ -0,0 +1,13 @@
# The list of current Curve maintainers and reviewers:
# Names should be added to this file like so:
# Name, <email address>, @GITHUB_HANDLE
Wang Pan, <hzwangpan@corp.netease.com>, @aspirer
Li Xiaocui, <lixiaocui1@corp.netease.com>, @ilixiaocui
Chen Wei, <hzchenwei7@corp.netease.com>, @cw123
Xu Chaojie, <xuchaojie@corp.netease.com>, @xu-chaojie
Wu Hanqing, <wuhanqing@corp.netease.com>, @wu-hanqing
Chen Yunhui, <chenyunhui@corp.netease.com>, @YunhuiChen
Wang Hai, <wanghai01@corp.netease.com>, @SeanHai
Hu Yao, <huyao@corp.netease.com>, @baijiaruo

View File

@ -1,7 +0,0 @@
# Maintainers
The current maintainers of the Curve project are:
* Pan WANG, [aspirer](https://github.com/aspirer), <aspirer2004@gmail.com>, core maintainer
* XiaoCui Li, [ilixiaocui](https://github.com/ilixiaocui), <ilixiaocui@163.com>, core maintainer
* opencurveadmin, [opencurveadmin](https://github.com/opencurveadmin), <hzchenwei7@corp.netease.com>, project management

View File

@ -1,81 +0,0 @@
# Copyright (C) 2021 Jingli Chen (Wine93), NetEase Inc.
.PHONY: list build dep install image playground check test
stor?=""
prefix?= "$(PWD)/projects"
release?= 0
dep?= 0
only?= "*"
tag?= "curvebs:unknown"
case?= "*"
os?= "debian9"
ci?=0
define help_msg
## list
Usage:
make list stor=bs/fs
Examples:
make list stor=bs
## build
Usage:
make build stor=bs/fs only=TARGET dep=0/1 release=0/1 os=OS
Examples:
make build stor=bs only=//src/chunkserver:chunkserver
make build stor=bs only=src/* dep=0
make build stor=fs only=test/* os=debian9
make build stor=fs release=1
## dep
Usage:
make dep stor=bs/fs
Examples:
make dep stor=bs
## install
Usage:
make install stor=bs/fs prefix=PREFIX only=TARGET
Examples:
make install stor=bs prefix=/usr/local/curvebs only=*
make install stor=bs prefix=/usr/local/curvebs only=chunkserver
make install stor=fs prefix=/usr/local/curvefs only=etcd
## image
Usage:
make image stor=bs/fs tag=TAG os=OS
Examples:
make image stor=bs tag=opencurvedocker/curvebs:v1.2 os=debian9
endef
export help_msg
help:
@echo "$$help_msg"
list:
@bash util/build.sh --stor=$(stor) --list
build:
@bash util/build.sh --stor=${stor} --only=$(only) --dep=$(dep) --release=$(release) --ci=$(ci) --os=$(os)
dep:
@bash util/build.sh --stor=$(stor) --only="" --dep=1
install:
@bash util/install.sh --stor=$(stor) --prefix=$(prefix) --only=$(only)
image:
@bash util/image.sh $(stor) $(tag) $(os)
playground:
@bash util/playground.sh
check:
@bash util/check.sh $(stor)
test:
@bash util/test.sh $(stor) $(only)

286
README.md
View File

@ -1,180 +1,51 @@
[中文版](README_cn.md)
<div align=center> <img src="docs/images/curve-logo1-nobg.png" width = 45%>
<img src="docs/images/curve-logo1.png"/>
<div align=center> <image src="docs/images/cncf-icon-color.png" width = 8%>
# CURVE
**A cloud-native distributed storage system**
[![Jenkins Coverage](https://img.shields.io/jenkins/coverage/cobertura?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fcurve_untest_job%2F)](http://59.111.91.248:8080/job/curve_untest_job/HTML_20Report/)
[![Robot failover](https://img.shields.io/jenkins/build?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fcurve_failover_testjob%2F&label=failover)](http://59.111.91.248:8080/job/curve_failover_testjob/)
[![Robot interface](https://img.shields.io/jenkins/tests?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fcurve_robot_job%2F)](http://59.111.91.248:8080/job/curve_robot_job/)
[![Curve_choas](https://img.shields.io/jenkins/build?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fcurve_choas_test%2F&label=choas)](http://59.111.91.248:8080/job/curve_choas_test/)
[![BUILD Status](https://img.shields.io/jenkins/build?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fopencurve_multijob%2F)](http://59.111.91.248:8080/job/opencurve_multijob/lastBuild)
[![Docs](https://img.shields.io/badge/docs-latest-green.svg)](https://github.com/opencurve/curve/tree/master/docs)
[![Releases](https://img.shields.io/github/v/release/opencurve/curve?include_prereleases)](https://github.com/opencurve/curve/releases)
[![LICENSE](https://img.shields.io/badge/licence-Apache--2.0%2FGPL-blue)](https://github.com/opencurve/curve/blob/master/LICENSE)
**A sandbox project hosted by the CNCF Foundation**
CURVE is a distributed storage system designed and developed independently by NetEase, featured with high performance, high availability, high reliability and well expansibility, and it can serve as the basis for storage systems designed for different scenario (e.g. block storage, object storage and cloud database).
#### English | [简体中文](README_cn.md)
### 📄 [Documents](https://github.com/opencurve/curve/tree/master/docs) || 🌐 [Official Website](https://www.opencurve.io/Curve/HOME) || 🏠 [Forum](https://ask.opencurve.io/t/topic/7)
<div align=left>
## Curve Block Service vs Ceph Block Device
<div class="column" align="middle">
</a>
<a href="https://github.com/opencurve/curve/blob/master/LICENSE">
<img src=https://img.shields.io/aur/license/android-studio?style=plastic alt="license"/>
</a>
<a href="https://github.com/opencurve/curve/releases">
<img src="https://img.shields.io/github/v/release/opencurve/curve?include_prereleases" alt="release"/>
</a>
<a href="https://bestpractices.coreinfrastructure.org/projects/6136">
<img src="https://bestpractices.coreinfrastructure.org/projects/6136/badge">
</a>
<a href="https://github.com/opencurve/curve/tree/master/docs">
<img src="https://img.shields.io/badge/docs-latest-green.svg">
</div>
Curve: v1.2.0
✨ Contents
========
Ceph: L/N
### Performance
Curve random read and write performance far exceeds Ceph in the block storage scenario.
- [About Curve](#about-curve)
- [Curve Architecture](#curve-architecture)
- [Design Documentation](#design-documentation)
- [CurveBS quick start](#curvebs-quick-start)
- [Deploy an All-in-one experience environment](#deploy-an-all-in-one-experience-environment)
- [FIO curve block storage engine](#fio-curve-block-storage-engine)
- [CurveFS quick start](#curvefs-quick-start)
- [Test environment configuration](#test-environment-configuration)
- [Governance](#governance)
- [Contribute us](#contribute-us)
- [Code of Conduct](#code-of-conduct)
- [LICENSE](#license)
- [Release Cycle](#release-cycle)
- [Branch](#branch)
- [Contributors](#contributors)
- [Star History](#star-history)
- [Feedback & Contact](#feedback--contact)
Environment3 replicas on a 6-node cluster, each node has 20xSATA SSD, 2xE5-2660 v4 and 256GB memory.
## About Curve
Single Vol
<image src="docs/images/1-nbd-en.png">
**Curve** is a modern storage system developed by netease, currently supporting file storage(CurveFS) and block storage(CurveBS). Now it's hosted at [CNCF](https://www.cncf.io/) as a sandbox project.
Multi Vols
<image src="docs/images/10-nbd-en.png">
The core application scenarios of CurveBS mainly include:
- the performance, mixed, capacity cloud disk or persistent volume of virtual machine/container, and remote disks of physical machines
- high-performance separation of storage and computation architecture: high-performance and low latency architecture based on RDMA+SPDK, supporting the separation deployment structure of various databases such as MySQL and Kafka
### Stability
The stability of the common abnormal Curve is better than that of Ceph in the block storage scenario.
| Fault Case | One Disk Failure | Slow Disk Detect | One Server Failure | Server Suspend Animation |
| :----: | :----: | :----: | :----: | :----: |
| Ceph | jitter 7s | Continuous io jitter | jitter 7s | unrecoverable |
| Curve | jitter 4s | no effect | jitter 4s | jitter 4s |
### Ops
Curve ops is more friendly than Curve in the block storage scenario.
| Ops scenarios | Upgrade clients | Balance |
| :----: | :----: | :----: |
| Ceph | do not support live upgrade | via plug-in with IO influence |
| Curve | support live upgrade with second jitter | auto with no influence on IO |
The core application scenarios of CurveFS mainly include:
- the cost-effective storage in AI training scene
- the hot and cold data automation layered storage in big data scenarios
- the cost-effective shared file storage on the public cloud: It can be used for business scenarios such as AI, big data, file sharing
- Hybrid storage: Hot data is stored in the local IDC, cold data is stored in public cloud
<details>
<summary><b><font=5>High Performance | More stable | Easy Operation | Cloud Native</b></font></summary>
- High Performance : CurveBS vs CephBS
CurveBS: v1.2.0
CephBS: L/N
Performance:
CurveBS random read and write performance far exceeds CephBS in the block storage scenario.
Environment3 replicas on a 6-node cluster, each node has 20xSATA SSD, 2xE5-2660 v4 and 256GB memory.
Single Vol
<image src="docs/images/1-nbd-en.png">
Multi Vols
<image src="docs/images/10-nbd-en.png">
- More stable
- The stability of the common abnormal Curve is better than that of Ceph in the block storage scenario.
| Fault Case | One Disk Failure | Slow Disk Detect | One Server Failure | Server Suspend Animation |
| :----: | :----: | :----: | :----: | :----: |
| CephBS | jitter 7s | Continuous io jitter | jitter 7s | unrecoverable |
| CurveBS | jitter 4s | no effect | jitter 4s | jitter 4s |
- Easy Operation
- We have developed [CurveAdm](https://github.com/opencurve/curveadm/wiki) to help O&M staff.
| tools |CephAdm | CurveAdm|
| :--: | :--: |:--: |
| easy Installation | ✔️ | ✔️ |
| easy Deployment| ❌(slightly more steps) | ✔️ |
| playground | ❌| ✔️|
| Multi-Cluster Management | ❌ | ✔️ |
| easy Expansion | ❌(slightly more steps)| ✔️|
|easy Upgrade | ✔️ | ✔️|
|easy to stop service | ❌ | ✔️|
|easy Cleaning | ❌ | ✔️ |
|Deployment environment testing| ❌ | ✔️ |
|Operational audit| ❌ | ✔️|
|Peripheral component deployment| ❌ | ✔️|
|easy log reporting| ❌ | ✔️|
|Cluster status statistics reporting| ❌| ✔️|
|Error code classification and solutions| ❌ | ✔️|
- Ops
CurveBS ops is more friendly than CephBS in the block storage scenario.
| Ops scenarios | Upgrade clients | Balance |
| :----: | :----: | :----: |
| CephBS | do not support live upgrade | via plug-in with IO influence |
| CurveBS | support live upgrade with second jitter | auto with no influence on IO |
- Cloud Native
- Please see [Our understanding of cloud native](https://github.com/opencurve/curve/wiki/Roadmap).
</details>
<details>
<summary><b><font=5>Docking OpenStack</b></font></summary>
- Please see [Curve-cinder](https://github.com/opencurve/curve-cinder).
</details>
<details>
<summary><b><font=5>Docking Kubernetes</b></font></summary>
- Use [Curve CSI Driver](https://github.com/opencurve/curve-csi), The plugin implements the Container Storage Interface(CSI) between Container Orchestrator(CO) and Curve cluster. It allows dynamically provisioning curve volumes and attaching them to workloads.
- For details of the documentation, see [CSI Curve Driver Doc](https://github.com/opencurve/curve-csi/blob/master/docs/README.md).
</details>
<details>
<summary><b><font=5>Docking PolarDB | PG </b></font></summary>
- It serves as the underlying storage base for [polardb for postgresql](https://github.com/ApsaraDB/PolarDB-for-PostgreSQL) in the form of storage and computation separation, providing data consistency assurance for upper layer database applications, extreme elasticity scaling, and high performance HTAP.
- Deployment details can be found at [PolarDB | PG Advanced Deployment(CurveBS)](https://apsaradb.github.io/PolarDB-for-PostgreSQL/zh/deploying/storage-curvebs.html).
</details>
<details>
<summary><b><font=5> More...</b></font></summary>
- Curve can also be used as cloud storage middleware using S3-compatible object storage as the data storage engine, providing cost-effective shared file storage for public cloud users.
</details>
## Curve Architecture
<div align=center> <image src="docs/images/Curve-arch.png" width=60%>
<div align=left>
<details>
<summary><b><font=4>Curve on Hybrid Cloud</b></font></summary>
Curve supports deployment in private and public cloud environments, and can also be used in a hybrid cloud:
<div align=center> <image src="docs/images/Curve-deploy-on-premises-idc.png" width=60%>
<div align=left>
One of them, CurveFS shared file storage system, can be elastically scaled to public cloud storage, which can provide users with greater capacity elasticity, lower cost, and better performance experience.
</details>
<div align=left>
<details>
<summary><b><font=4>Curve on Public Cloud</b></font></summary>
In a public cloud environment, users can deploy CurveFS clusters to replace the shared file storage system provided by cloud vendors and use cloud disks for acceleration, which can greatly reduce business costs, with the following deployment architecture:
<div align=center>
<image src="docs/images/Curve-deploy-on-public-cloud.png" width=55%>
</details>
<div align=left>
## Design Documentation
## Design Documentation
- Wanna have a glance at Curve? Click here for [Intro to Curve](https://www.opencurve.io/)!
- Want more details about CurveBS? Our documentation for every component:
@ -188,84 +59,71 @@ In a public cloud environment, users can deploy CurveFS clusters to replace the
- [Client Python API](docs/en/curve-client-python-api_en.md)
- Application based on CurveBS
- [Work with k8s](docs/en/k8s_csi_interface_en.md)
- CurveFS documentations
- [Architecture design](docs/cn/curvefs_architecture.md)
- [Client design](docs/cn/curvefs-client-design.md)
- [Metadata management](docs/cn/curvefs-metaserver-overview.md)
- Want more details about CurveFS? Our documentation for every component:
- [Architecture design](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/CurveFS%E6%96%B9%E6%A1%88%E8%AE%BE%E8%AE%A1%EF%BC%88%E6%80%BB%E4%BD%93%E8%AE%BE%E8%AE%A1%EF%BC%8C%E5%8F%AA%E5%AE%9E%E7%8E%B0%E4%BA%86%E9%83%A8%E5%88%86%EF%BC%89.pdf)
- [Client design](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/CurveFS%20Client%20%E6%A6%82%E8%A6%81%E8%AE%BE%E8%AE%A1.pdf)
- [Metadata management](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/Curve%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E5%85%83%E6%95%B0%E6%8D%AE%E7%AE%A1%E7%90%86.pdf)
- [Data caching](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/Curve%E6%94%AF%E6%8C%81S3%20%E6%95%B0%E6%8D%AE%E7%BC%93%E5%AD%98%E6%96%B9%E6%A1%88.pdf)
- [Space allocation](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/Curve%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E7%A9%BA%E9%97%B4%E5%88%86%E9%85%8D%E6%96%B9%E6%A1%88.pdf)
- [more details](https://github.com/opencurve/curve-meetup-slides/tree/main/CurveFS)
- CurveAdm
- [CurveAdm Doc](https://github.com/opencurve/curveadm/wiki)
## Quick Start of CurveBS
## CurveBS quick start
In order to improve the operation and maintenance convenience of Curve, we designed and developed the [CurveAdm](https://github.com/opencurve/curveadm) project, which is mainly used for deploying and managing Curve clusters. Currently, it supports the deployment of CurveBS & CurveFS (scaleout, upgrade and other functions are under development), please refer to the [CurveAdm User Manual](https://github.com/opencurve/curveadm/wiki) for related documentation, and install the CurveAdm tool according to the manual before deploying the Curve cluster.
Want to try on it? Take it easy! We'll help you step by step, but make sure you've read this [Tips](docs/en/deploy_en.md#Tips) before you start.
### Deploy an all-in-one environment (to try how CURVE works)
### Deploy an All-in-one experience environment
[Deploy on single machine](docs/en/deploy_en.md#deploy-on-single-machine)
Please refer to the [CurveBS cluster deployment steps](https://github.com/opencurve/curveadm/wiki/curvebs-cluster-deployment) in the CurveAdm user manual. For standalone experience, please use the "Cluster Topology File - Standalone Deployment" template.
### Deploy multi-machine cluster (try it in production environment)
[The command tools' instructions](docs/cn/curve_ops_tool.md)
### FIO Curve block storage engine
Fio Curve engine is added, you can clone https://github.com/opencurve/fio and compile the fio tool with our engine(depend on nebd lib), fio command line example:
```bash
$ ./fio --thread --rw=randwrite --bs=4k --ioengine=nebd --nebd=cbd:pool//pfstest_test_ --iodepth=10 --runtime=120 --numjobs=10 --time_based --group_reporting --name=curve-fio-test
```
[Deploy on multiple machines](docs/en/deploy_en.md#deploy-on-multiple-machines)
If you have any questions during performance testing, please check the [Curve block storage performance tuning guide](docs/cn/Curve%E5%9D%97%E5%AD%98%E5%82%A8%E6%80%A7%E8%83%BD%E8%B0%83%E4%BC%98%E6%8C%87%E5%8D%97.md).
### curve_ops_tool introduction
## CurveFS quick start
Please use [CurveAdm](https://github.com/opencurve/curveadm/wiki) tool to deploy CurveFSsee [CurveFS Deployment Process](https://github.com/opencurve/curveadm/wiki/curvefs-cluster-deployment), and the [CurveFS Command Instructions](curvefs/src/tools#readme).
[curve_ops_tool introduction](docs/en/curve_ops_tool_en.md)
## Test environment configuration
## Quick Start of CurveFS
In order to improve the convenience of Curve operation and maintenance, we have designed and developed the [CurveAdm](https://github.com/opencurve/curveadm) project, which is mainly used to deploy and manage Curve clusters. Currently, it supports the deployment of CurveFS (CurveBS support is under development).
Please refer to the [Test environment configuration](docs/cn/测试环境配置信息.md)
Detail for CurveFS deploy: [CurveFS deployment](https://github.com/opencurve/curveadm#deploy-cluster)
## Practical
- [CurveBS+NFS Build NFS Server](docs/practical/curvebs_nfs.md)
- [CurveFS+MinIO S3 Gateway](https://github.com/opencurve/curve-meetup-slides/blob/main/PrePaper/2023/%E6%94%AF%E6%8C%81POSIX%E5%92%8CS3%E7%BB%9F%E4%B8%80%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4%E2%80%94%E2%80%94Curve%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9FS3%E7%BD%91%E5%85%B3%E9%83%A8%E7%BD%B2%E5%AE%9E%E8%B7%B5.md)
## For Developers
## Governance
See [Governance](https://github.com/opencurve/community/blob/master/GOVERNANCE.md).
### Deploy build and development environment
## Contribute us
Participation in the Curve project is described in the [Curve Developers Guidelines](developers_guide.md) and is subject to a [contributor contract](https://github.com/opencurve/curve/blob/master/CODE_OF_CONDUCT.md).
We welcome your contribution!
[development environment deployment](docs/en/build_and_run_en.md)
## Code of Conduct
Curve follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md).
### Compile test cases and run
[test cases compiling and running](docs/en/build_and_run_en.md#test-case-compilation-and-execution)
## LICENSE
Curve is distributed under the [**Apache 2.0 LICENSE**](LICENSE).
### Coding style guides
CURVE is coded following [Google C++ Style Guide strictly](https://google.github.io/styleguide/cppguide.html). Please follow this guideline if you're trying to contribute your codes.
## Release Cycle
### Code coverage requirement
1. Unit tests: Incremental line coverage ≥ 80%, incremental branch coverage ≥ 70%
2. Integration tests: Measure together with unit tests, and should fulfill the same requirement
3. Exception tests: Not required yet
### Other processes
After finishing the development of your code, you should submit a pull request to master branch of CURVE and fill out a pull request template. The pull request will trigger the CI automatically, and the code will only be merged after passing the CI and being reviewed.
For more detail, please refer to [CONTRIBUTING](https://github.com/opencurve/curve/blob/master/CONTRIBUTING.md).
## Release Cycle
- CURVE release cycleHalf a year for major version, 1~2 months for minor version
- Versioning format: We use a sequence of three digits and a suffix (x.y.z{-suffix}), x is the major version, y is the minor version, and z is for bugfix. The suffix is for distinguishing beta (-beta), RC (-rc) and GA version (without any suffix). Major version x will increase 1 every half year, and y will increase every 1~2 months. After a version is released, number z will increase if there's any bugfix.
## Branch
All the developments will be done under master branch. If there's any new version to establish, a new branch release-x.y will be pulled from the master, and the new version will be released from this branch.
## Contributors
This project exists thanks to all the people who contribute.
<a href="https://github.com/opencurve/curve/graphs/contributors">
<img src="https://contrib.rocks/image?repo=opencurve/curve" />
</a>
Made with [contrib.rocks](https://contrib.rocks).
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=opencurve/curve&type=Date)](https://star-history.com/#opencurve/curve&Date)
## Feedback & Contact
- [Github Issues](https://github.com/openCURVE/CURVE/issues)You are sincerely welcomed to issue any bugs you came across or any suggestions through Github issues. If you have any question you can refer to our FAQ or join our user group for more details.
- [FAQ](https://github.com/openCURVE/CURVE/wiki/CURVE-FAQ)Frequently asked question in our user group, and we'll keep working on it.
- User groupWe use Wechat group currently.
- [Double Week Meetings](https://github.com/opencurve/curve-meetup-slides/tree/main/2022): We have an online community meeting every two weeks which talk about what Curve is doing and planning to do. The time and links of the meeting are public in the user group and [Double Week Meetings](https://github.com/opencurve/curve-meetup-slides/tree/main/2022).
<img src="docs/images/curve-wechat.jpeg" style="zoom: 65%;" />
<img src="docs/images/curve-wechat.jpeg" style="zoom: 75%;" />

View File

@ -1,181 +1,52 @@
[English version](README.md)
<div align=center> <img src="docs/images/curve-logo1-nobg.png" width = 45%>
<img src="docs/images/curve-logo1.png"/>
<div align=center> <image src="docs/images/cncf-icon-color.png" width = 8%>
# CURVE
**云原生高性能分布式存储系统**
**CNCF基金会的沙箱托管项目**
#### [English](README.md) | 简体中文
### 📄 [文档](https://github.com/opencurve/curve/tree/master/docs) || 🌐 [官网](https://www.opencurve.io/Curve/HOME) || 🏠 [论坛](https://ask.opencurve.io/t/topic/7)
<div align=left>
<div class="column" align="middle">
</a>
<a href="https://github.com/opencurve/curve/blob/master/LICENSE">
<img src=https://img.shields.io/aur/license/android-studio?style=plastic alt="license"/>
</a>
<a href="https://github.com/opencurve/curve/releases">
<img src="https://img.shields.io/github/v/release/opencurve/curve?include_prereleases" alt="release"/>
</a>
<a href="https://bestpractices.coreinfrastructure.org/projects/6136">
<img src="https://bestpractices.coreinfrastructure.org/projects/6136/badge">
</a>
<a href="https://github.com/opencurve/curve/tree/master/docs">
<img src="https://img.shields.io/badge/docs-latest-green.svg">
</div>
✨ 目录
========
- [关于 Curve](#关于-curve)
- [Curve 架构](#curve-架构)
- [设计文档](#设计文档)
- [CurveBS 快速体验](#curvebs-快速体验)
- [部署All-in-one体验环境](#部署all-in-one体验环境)
- [FIO curve块存储引擎](#fio-curve块存储引擎)
- [CurveFS 快速体验](#curvefs-快速体验)
- [测试环境配置](#测试环境配置)
- [社区治理](#社区治理)
- [贡献我们](#贡献我们)
- [行为守则](#行为守则)
- [LICENSE](#license)
- [版本发布周期](#版本发布周期)
- [分支规则](#分支规则)
- [反馈及交流](#反馈及交流)
[![Jenkins Coverage](https://img.shields.io/jenkins/coverage/cobertura?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fcurve_untest_job%2F)](http://59.111.91.248:8080/job/curve_untest_job/HTML_20Report/)
[![Robot failover](https://img.shields.io/jenkins/build?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fcurve_failover_testjob%2F&label=failover)](http://59.111.91.248:8080/job/curve_failover_testjob/)
[![Robot interface](https://img.shields.io/jenkins/tests?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fcurve_robot_job%2F)](http://59.111.91.248:8080/job/curve_robot_job/)
[![BUILD Status](https://img.shields.io/jenkins/build?jobUrl=http%3A%2F%2F59.111.91.248%3A8080%2Fjob%2Fopencurve_multijob%2F)](http://59.111.91.248:8080/job/opencurve_multijob/lastBuild)
[![Docs](https://img.shields.io/badge/docs-latest-green.svg)](https://github.com/opencurve/curve/tree/master/docs)
[![Releases](https://img.shields.io/github/v/release/opencurve/curve?include_prereleases)](https://github.com/opencurve/curve/releases)
[![LICENSE](https://img.shields.io/badge/licence-Apache--2.0%2FGPL-blue)](https://github.com/opencurve/curve/blob/master/LICENSE)
## 关于 Curve
**Curve** 是网易主导自研的现代化存储系统, 目前支持文件存储(CurveFS)和块存储(CurveBS)。现作为沙箱项目托管于[CNCF](https://www.cncf.io/)。
Curve是网易自主设计研发的高性能、易运维、云原生的分布式存储系统目前提供块(CurveBS)和文件(CurveFS)两种存储方式。CurveBS支持快照克隆和恢复,支持QEMU虚拟机和物理机NBD设备两种挂载方式。CurveFS基于Fuse支持POSIX文件系统接口。
CurveBS的核心应用场景主要包括
- 虚拟机/容器的性能型、混合型、容量型云盘或持久化卷,以及物理机的远程存储盘
- 高性能存算分离架构基于RDMA+SPDK的高性能低时延架构支撑MySQL、kafka等各类数据库、中间件的存算分离部署架构提升实例交付效率和资源利用率
## Curve Block Service vs Ceph Block Device
Curve: v1.2.0
CurveFS的核心应用场景主要包括
- AI训练含机器学习等场景下的高性价比存储
- 大数据场景下的冷热数据自动化分层存储
- 公有云上高性价比的共享文件存储可用于AI、大数据、文件共享等业务场景
- 混合云存储热数据存储在本地IDC冷数据存储在公有云
Ceph: L/N
### 性能
块存储场景下Curve随机读写性能远优于Ceph。
测试环境6台服务器*20块SATA SSDE5-2660 v4256G3副本使用nbd场景。
单卷场景:
<image src="docs/images/1-nbd.jpg">
<details>
<summary><b><font=5>高性能 | 更稳定 | 易运维 | 云原生</b></font></summary>
- 高性能 : CurveBS vs CephBS
CurveBS: v1.2.0
CephBS: L/N
性能:
块存储场景下CurveBS随机读写性能远优于CephBS。
测试环境6台服务器*20块SATA SSDE5-2660 v4256G3副本使用nbd场景。
单卷场景:
<image src="docs/images/1-nbd.jpg">
多卷场景:
<image src="docs/images/10-nbd.jpg">
- 更稳定
- 块存储场景下常见异常CurveBS的稳定性优于CephBS。
| 异常场景 | 单盘故障 | 慢盘 | 机器宕机 | 机器卡住 |
| :----: | :----: | :----: | :----: | :----: |
| CephBS | 抖动7s | 持续io抖动 | 抖动7s | 不可恢复 |
| CurveBS | 抖动4s | 无影响 | 抖动4s | 抖动4s |
- 易运维
- 我们开发了 [CurveAdm](https://github.com/opencurve/curveadm/wiki)来帮助运维人员。
| 工具 |CephAdm | CurveAdm|
| :--: | :--: |:--: |
| 一键安装 | ✔️ | ✔️ |
| 一键部署 | ❌(步骤稍多) | ✔️ |
| playground | ❌| ✔️|
| 多集群管理 | ❌ | ✔️ |
| 一键扩容 | ❌(步骤稍多)| ✔️|
|一键升级 | ✔️ | ✔️|
|一键停服 | ❌ | ✔️|
|一键清理 | ❌ | ✔️ |
|部署环境检测| ❌ | ✔️ |
|操作审计| ❌ | ✔️|
|周边组件部署| ❌ | ✔️|
|一键日志上报| ❌ | ✔️|
|集群状态统计上报| ❌| ✔️|
|错误码分类及解决方案| ❌ | ✔️|
- 运维
块存储场景下CurveBS常见运维更友好。
| 运维场景 | 客户端升级 | 均衡 |
| :----: | :----: | :----: |
| CephBS | 不支持热升级 | 外部插件调整影响业务IO |
| CurveBS | 支持热升级,秒级抖动 | 自动均衡对业务IO无影响 |
- 云原生
- 详见[我们对云原生的理解](https://github.com/opencurve/curve/wiki/Roadmap_CN)。
</details>
<details>
<summary><b><font=5>对接 OpenStack</b></font></summary>
- 详见 [Curve-cinder](https://github.com/opencurve/curve-cinder)。
</details>
<details>
<summary><b><font=5>对接 Kubernetes</b></font></summary>
- 使用 [Curve CSI Driver](https://github.com/opencurve/curve-csi) 插件在 Container Orchestrator (CO) 与 Curve 集群中实现了 Container Storage Interface(CSI)。
- 文档详见[CSI Curve Driver Doc](https://github.com/opencurve/curve-csi/blob/master/docs/README.md)。
</details>
<details>
<summary><b><font=5>对接 PolarDB | PG </b></font></summary>
- 作为存算分离形态分布式数据库 [PolarDB | PG](https://github.com/ApsaraDB/PolarDB-for-PostgreSQL) 底层存储底座, 为上层数据库应用提供数据一致性保证, 极致弹性, 高性能HTAP。部署详见[PolarDB | PG 进阶部署(CurveBS)](https://apsaradb.github.io/PolarDB-for-PostgreSQL/zh/deploying/storage-curvebs.html)。
</details>
<details>
<summary><b><font=5> 更多...</b></font></summary>
- Curve 亦可作为云存储中间件使用 S3 兼容的对象存储作为数据存储引擎,为公有云用户提供高性价比的共享文件存储。
</details>
## Curve 架构
<div align=center> <image src="docs/images/Curve-arch.png" width=60%>
<div align=left>
<details>
<summary><b><font=4>Curve混合云支持</b></font></summary>
Curve支持部署在私有云和公有云环境也可以以混合云方式使用私有云环境下的部署架构如下
<div align=center> <image src="docs/images/Curve-deploy-on-premises-idc.png" width=60%>
<div align=left>
其中CurveFS共享文件存储系统可以弹性伸缩到公有云存储可以为用户提供更大的容量弹性、更低的成本、更好的性能体验。
</details>
<div align=left>
<details>
<summary><b><font=4>Curve公有云支持</b></font></summary>
公有云环境下用户可以部署CurveFS集群用来替换云厂商提供的共享文件存储系统并利用云盘进行加速可极大的降低业务成本其部署架构如下
<div align=center>
<image src="docs/images/Curve-deploy-on-public-cloud.png" width=55%>
</details>
<div align=left>
多卷场景:
<image src="docs/images/10-nbd.jpg">
### 稳定性
块存储场景下常见异常Curve的稳定性优于Ceph。
| 异常场景 | 单盘故障 | 慢盘 | 机器宕机 | 机器卡住 |
| :----: | :----: | :----: | :----: | :----: |
| Ceph | 抖动7s | 持续io抖动 | 抖动7s | 不可恢复 |
| Curve | 抖动4s | 无影响 | 抖动4s | 抖动4s |
### 运维
块存储场景下Curve常见运维更友好。
| 运维场景 | 客户端升级 | 均衡 |
| :----: | :----: | :----: |
| Ceph | 不支持热升级 | 外部插件调整影响业务IO |
| Curve | 支持热升级,秒级抖动 | 自动均衡对业务IO无影响 |
## 设计文档
- 通过 [Curve概述](https://opencurve.github.io/) 可以了解 Curve 架构。
- 通过 [Curve概述](https://opencurve.github.io/) 可以了解 Curve 架构
- CurveBS相关文档
- [NEBD](docs/cn/nebd.md)
- [MDS](docs/cn/mds.md)
@ -188,64 +59,66 @@ Curve支持部署在私有云和公有云环境也可以以混合云方式使
- CurveBS上层应用
- [对接k8s文档](docs/cn/k8s_csi_interface.md)
- CurveFS相关文档
- [架构设计](docs/cn/curvefs_architecture.md)
- [Client概要设计](docs/cn/curvefs-client-design.md)
- [元数据管理](docs/cn/curvefs-metaserver-overview.md)
- [架构设计](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/CurveFS%E6%96%B9%E6%A1%88%E8%AE%BE%E8%AE%A1%EF%BC%88%E6%80%BB%E4%BD%93%E8%AE%BE%E8%AE%A1%EF%BC%8C%E5%8F%AA%E5%AE%9E%E7%8E%B0%E4%BA%86%E9%83%A8%E5%88%86%EF%BC%89.pdf)
- [Client概要设计](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/CurveFS%20Client%20%E6%A6%82%E8%A6%81%E8%AE%BE%E8%AE%A1.pdf)
- [元数据管理](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/Curve%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E5%85%83%E6%95%B0%E6%8D%AE%E7%AE%A1%E7%90%86.pdf)
- [数据缓存方案](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/Curve%E6%94%AF%E6%8C%81S3%20%E6%95%B0%E6%8D%AE%E7%BC%93%E5%AD%98%E6%96%B9%E6%A1%88.pdf)
- [空间分配方案](https://github.com/opencurve/curve-meetup-slides/blob/main/CurveFS/Curve%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E7%A9%BA%E9%97%B4%E5%88%86%E9%85%8D%E6%96%B9%E6%A1%88.pdf)
- [更多](https://github.com/opencurve/curve-meetup-slides/tree/main/CurveFS)
- CurveAdm相关文档
- [Wiki](https://github.com/opencurve/curveadm/wiki)
## CurveBS 快速体验
为了提升 Curve 的运维便利性,我们设计开发了 [CurveAdm](https://github.com/opencurve/curveadm) 项目,其主要用于部署和管理 Curve 集群目前已支持部署CurveBS & CurveFS扩容、版本升级等更多功能正在开发中相关使用文档请参考 [CurveAdm用户手册](https://github.com/opencurve/curveadm/wiki)并根据手册首先安装CurveAdm工具之后再进行Curve集群的部署。
## CurveBS快速开始
### 部署All-in-one体验环境
请参考CurveAdm用户手册中[CurveBS集群部署步骤](https://github.com/opencurve/curveadm/wiki/curvebs-cluster-deployment),单机体验环境请使用“集群拓扑文件-单机部署”模板。
在您开始动手部署前请先仔细阅读特别说明部分:[特别说明](docs/cn/deploy.md#%E7%89%B9%E5%88%AB%E8%AF%B4%E6%98%8E)
curve 提供了命令行工具以查看集群状态和进行基本集群操作:[命令行工具说明](docs/cn/curve_ops_tool.md)
### FIO Curve块存储引擎
fio的Curve块存储引擎代码已经上传到 https://github.com/opencurve/fio 请自行编译测试依赖nebd库fio命令行示例
```bash
$ ./fio --thread --rw=randwrite --bs=4k --ioengine=nebd --nebd=cbd:pool//pfstest_test_ --iodepth=10 --runtime=120 --numjobs=10 --time_based --group_reporting --name=curve-fio-test
```
### 部署All-in-one体验环境
在性能测试过程中有任何问题,请查看[Curve块存储性能调优指南](docs/cn/Curve%E5%9D%97%E5%AD%98%E5%82%A8%E6%80%A7%E8%83%BD%E8%B0%83%E4%BC%98%E6%8C%87%E5%8D%97.md)
[单机部署](docs/cn/deploy.md#%E5%8D%95%E6%9C%BA%E9%83%A8%E7%BD%B2)
## CurveFS 快速体验
请使用 [CurveAdm](https://github.com/opencurve/curveadm/wiki) 工具进行 CurveFS 的部署,具体流程见:[CurveFS部署流程](https://github.com/opencurve/curveadm/wiki/curvefs-cluster-deployment), 以及[CurveFS命令行工具说明](curvefs/src/tools#readme)。
### 部署多机集群
## 测试环境配置
[多机部署](docs/cn/deploy.md#%E5%A4%9A%E6%9C%BA%E9%83%A8%E7%BD%B2)
请参考 [测试环境配置](docs/cn/测试环境配置信息.md)
## 社区治理
请参考[社区治理](https://github.com/opencurve/community/blob/master/GOVERNANCE.md)。
### 查询工具说明
## 贡献我们
[查询工具说明](docs/cn/curve_ops_tool.md)
参与 Curve 项目开发详见[Curve 开发者指南](developers_guide_cn.md)并且请遵循[贡献者准则](https://github.com/opencurve/curve/blob/master/CODE_OF_CONDUCT.md), 我们期待您的贡献!
## CurveFS快速开始
为了提升 Curve 的运维便利性,我们设计开发了 [CurveAdm](https://github.com/opencurve/curveadm) 项目,其主要用于部署和管理 Curve 集群,目前已支持部署 CurveFSCurveBS 的支持正在开发中)。
## 最佳实践
- [CurveBS+NFS搭建NFS存储](docs/practical/curvebs_nfs.md)
- [CurveFS+S3网关部署实践](https://github.com/opencurve/curve-meetup-slides/blob/main/PrePaper/2023/%E6%94%AF%E6%8C%81POSIX%E5%92%8CS3%E7%BB%9F%E4%B8%80%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4%E2%80%94%E2%80%94Curve%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9FS3%E7%BD%91%E5%85%B3%E9%83%A8%E7%BD%B2%E5%AE%9E%E8%B7%B5.md)
具体流程见:[CurveFS部署流程](https://github.com/opencurve/curveadm#deploy-cluster)
## 行为守则
Curve 的行为守则遵循[CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md)。
## 参与开发
## LICENSE
Curve 在 [Apache 2.0](LICENSE) 协议下进行分发。
### 部署编译开发环境
## 版本发布周期
[编译开发环境搭建](docs/cn/build_and_run.md)
### 测试用例编译及运行
[测试用例编译及运行](docs/cn/build_and_run.md#%E6%B5%8B%E8%AF%95%E7%94%A8%E4%BE%8B%E7%BC%96%E8%AF%91%E5%8F%8A%E6%89%A7%E8%A1%8C)
### 编码规范
CURVE编码规范严格按照[Google C++开源项目编码指南](https://zh-google-styleguide.readthedocs.io/en/latest/google-cpp-styleguide/contents/)来进行代码编写,请您也遵循这一指南来提交您的代码。
### 测试覆盖率要求
1. 单元测试增量行覆盖80%以上增量分支覆盖70%以上
2. 集成测试:与单元测试合并统计,满足上述覆盖率要求即可
3. 异常测试:暂不做要求
### 其他开发流程说明
代码开发完成之后,提[pr](https://github.com/opencurve/curve/compare)到curve的master分支。提交pr时请填写pr模板。pr提交之后会自动触发CICI通过并且经过review之后代码才可合入。
具体规则请见[CONTRIBUTING](https://github.com/opencurve/curve/blob/master/CONTRIBUTING.md).
## 版本发布周期
- CURVE版本发布周期大版本半年小版本1~2个月
- 版本号规则采用3段式版本号x.y.z{-后缀}x是大版本y是小版本z是bugfix后缀用来区beta版本(-beta)、rc版本(-rc)、和稳定版本(没有后缀)。每半年的大版本是指x增加1每1~2个月的小版本是y增加1。正式版本发布之后如果有bugfix是z增加1。
## 分支规则
## 分支规则
所有的开发都在master分支开发如果需要发布版本从master拉取新的分支**release-x.y**。版本发布从release-x.y分支发布。
## 反馈及交流
## 反馈及交流
- [Github Issues](https://github.com/openCURVE/CURVE/issues)欢迎提交BUG、建议使用中如遇到问题可参考FAQ或加入我们的User group进行咨询。
- [FAQ](https://github.com/openCURVE/CURVE/wiki/CURVE-FAQ)主要根据User group中常见问题整理还在逐步完善中。
- [Github Issues](https://github.com/openCURVE/CURVE/issues)欢迎提交BUG、建议使用中如遇到问题可参考FAQ或加入我们的User group进行咨询
- [FAQ](https://github.com/openCURVE/CURVE/wiki/CURVE-FAQ)主要根据User group中常见问题整理还在逐步完善中
- User group当前为微信群由于群人数过多需要先添加以下个人微信再邀请进群。
<img src="docs/images/curve-wechat.jpeg" style="zoom: 75%;" />
@ -254,3 +127,4 @@ Curve 在 [Apache 2.0](LICENSE) 协议下进行分发。

161
WORKSPACE
View File

@ -16,25 +16,12 @@
workspace(name = "curve")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# skylib
http_archive(
name = "bazel_skylib",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.0/bazel-skylib-1.2.0.tar.gz",
],
sha256 = "af87959afe497dc8dfd4c6cb66e1279cb98ccc84284619ebfec27d9c09a903de",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "com_github_baidu_braft",
remote = "https://github.com/baidu/braft",
commit = "d12de388c97998f5ccd5cb97ed0da728815ef438",
commit = "e255c0e4b18d1a8a5d484d4b647f41ff1385ef1e",
)
bind(
@ -45,28 +32,11 @@ bind(
# proto_library, cc_proto_library, and java_proto_library rules implicitly
# depend on @com_google_protobuf for protoc and proto runtimes.
# This statement defines the @com_google_protobuf repo.
# zlib
http_archive(
name = "net_zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
)
bind(
name = "zlib",
actual = "@net_zlib//:zlib",
)
http_archive(
name = "com_google_protobuf",
strip_prefix = "protobuf-3.6.1.3",
patch_args = ["-p1"],
patches = ["//:thirdparties/protobuf/protobuf.patch"],
sha256 = "9510dd2afc29e7245e9e884336f848c8a6600a14ae726adb6befdb4f786f0be2",
urls = ["https://github.com/google/protobuf/archive/v3.6.1.3.zip"],
sha256 = "cef7f1b5a7c5fba672bec2a319246e8feba471f04dcebfe362d55930ee7c1c30",
strip_prefix = "protobuf-3.5.0",
urls = ["https://github.com/google/protobuf/archive/v3.5.0.zip"],
)
bind(
@ -75,14 +45,11 @@ bind(
)
#import the gtest files.
http_archive(
new_git_repository(
name = "com_google_googletest",
urls = [
"https://curve-build.nos-eastchina1.126.net/googletest-release-1.12.1.tar.gz",
"https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz",
],
sha256 = "81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2",
strip_prefix = "googletest-release-1.12.1",
build_file = "bazel/gmock.BUILD",
remote = "https://github.com/google/googletest",
tag = "release-1.8.0",
)
bind(
@ -109,7 +76,10 @@ bind(
http_archive(
name = "com_github_gflags_gflags",
strip_prefix = "gflags-2.2.2",
urls = ["https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"],
urls = [
"https://mirror.bazel.build/github.com/gflags/gflags/archive/v2.2.2.tar.gz",
"https://github.com/gflags/gflags/archive/v2.2.2.tar.gz",
],
)
bind(
@ -117,11 +87,11 @@ bind(
actual = "@com_github_gflags_gflags//:gflags",
)
http_archive(
new_http_archive(
name = "com_github_google_leveldb",
build_file = "@com_github_brpc_brpc//:leveldb.BUILD",
build_file = "bazel/leveldb.BUILD",
strip_prefix = "leveldb-a53934a3ae1244679f812d998a4f16f2c7f309a6",
urls = ["https://github.com/google/leveldb/archive/a53934a3ae1244679f812d998a4f16f2c7f309a6.tar.gz"],
url = "https://github.com/google/leveldb/archive/a53934a3ae1244679f812d998a4f16f2c7f309a6.tar.gz",
)
bind(
@ -130,7 +100,7 @@ bind(
)
git_repository(
name = "com_github_brpc_brpc",
name = "com_github_apache_brpc",
remote = "https://github.com/apache/incubator-brpc",
commit = "1b9e00641cbec1c8803da6a1f7f555398c954cb0",
patches = ["//:thirdparties/brpc/brpc.patch"],
@ -139,28 +109,28 @@ git_repository(
bind(
name = "brpc",
actual = "@com_github_brpc_brpc//:brpc",
actual = "@com_github_apache_brpc//:brpc",
)
bind(
name = "butil",
actual = "@com_github_brpc_brpc//:butil",
actual = "@com_github_apache_brpc//:butil",
)
bind(
name = "bthread",
actual = "@com_github_brpc_brpc//:bthread",
actual = "@com_github_apache_brpc//:bthread",
)
bind(
name = "bvar",
actual = "@com_github_brpc_brpc//:bvar",
actual = "@com_github_apache_brpc//:bvar",
)
# jsoncpp
new_git_repository(
name = "jsoncpp",
build_file = "//:thirdparties/jsoncpp.BUILD",
build_file = "bazel/jsoncpp.BUILD",
remote = "https://github.com/open-source-parsers/jsoncpp.git",
tag = "1.8.4",
)
@ -172,44 +142,49 @@ bind(
new_local_repository(
name = "etcdclient",
build_file = "//:thirdparties/etcdclient.BUILD",
build_file = "bazel/etcdclient.BUILD",
path = "thirdparties/etcdclient",
)
new_local_repository(
name = "libmemcached",
build_file = "//:thirdparties/memcache/memcache.BUILD",
path = "thirdparties/memcache/libmemcached-1.1.2",
)
http_archive(
new_http_archive(
name = "aws",
urls = ["https://github.com/aws/aws-sdk-cpp/archive/1.7.340.tar.gz"],
urls = [
"https://github.com/aws/aws-sdk-cpp/archive/1.7.340.tar.gz",
"https://mirror.bazel.build/github.com/aws/aws-sdk-cpp/archive/1.7.340.tar.gz",
],
sha256 = "2e82517045efb55409cff1408c12829d9e8aea22c1e2888529cb769b7473b0bf",
strip_prefix = "aws-sdk-cpp-1.7.340",
build_file = "//:thirdparties/aws/aws.BUILD",
)
http_archive(
new_http_archive(
name = "aws_c_common",
urls = ["https://github.com/awslabs/aws-c-common/archive/v0.4.29.tar.gz"],
urls = [
"https://github.com/awslabs/aws-c-common/archive/v0.4.29.tar.gz",
"https://mirror.tensorflow.org/github.com/awslabs/aws-c-common/archive/v0.4.29.tar.gz",
],
sha256 = "01c2a58553a37b3aa5914d9e0bf7bf14507ff4937bc5872a678892ca20fcae1f",
strip_prefix = "aws-c-common-0.4.29",
build_file = "//:thirdparties/aws/aws-c-common.BUILD",
)
http_archive(
new_http_archive(
name = "aws_c_event_stream",
urls = ["https://github.com/awslabs/aws-c-event-stream/archive/v0.1.4.tar.gz"],
urls = [
"https://github.com/awslabs/aws-c-event-stream/archive/v0.1.4.tar.gz",
"https://mirror.tensorflow.org/github.com/awslabs/aws-c-event-stream/archive/v0.1.4.tar.gz",
],
sha256 = "31d880d1c868d3f3df1e1f4b45e56ac73724a4dc3449d04d47fc0746f6f077b6",
strip_prefix = "aws-c-event-stream-0.1.4",
build_file = "//:thirdparties/aws/aws-c-event-stream.BUILD",
)
http_archive(
new_http_archive(
name = "aws_checksums",
urls = ["https://github.com/awslabs/aws-checksums/archive/v0.1.5.tar.gz"],
urls = [
"https://github.com/awslabs/aws-checksums/archive/v0.1.5.tar.gz",
"https://mirror.tensorflow.org/github.com/awslabs/aws-checksums/archive/v0.1.5.tar.gz",
],
sha256 = "6e6bed6f75cf54006b6bafb01b3b96df19605572131a2260fddaf0e87949ced0",
strip_prefix = "aws-checksums-0.1.5",
build_file = "//:thirdparties/aws/aws-checksums.BUILD",
@ -230,53 +205,3 @@ http_archive(
strip_prefix = "abseil-cpp-20210324.2",
sha256 = "59b862f50e710277f8ede96f083a5bb8d7c9595376146838b9580be90374ee1f",
)
# fmt
http_archive(
name = "fmt",
url = "https://github.com/fmtlib/fmt/archive/9.1.0.tar.gz",
sha256 = "5dea48d1fcddc3ec571ce2058e13910a0d4a6bab4cc09a809d8b1dd1c88ae6f2",
strip_prefix = "fmt-9.1.0",
build_file = "//:thirdparties/fmt.BUILD",
)
# spdlog
http_archive(
name = "spdlog",
urls = ["https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz"],
strip_prefix = "spdlog-1.11.0",
sha256 = "ca5cae8d6cac15dae0ec63b21d6ad3530070650f68076f3a4a862ca293a858bb",
build_file = "//:thirdparties/spdlog.BUILD",
)
# Bazel platform rules.
http_archive(
name = "platforms",
sha256 = "b601beaf841244de5c5a50d2b2eddd34839788000fa1be4260ce6603ca0d8eb7",
strip_prefix = "platforms-98939346da932eef0b54cf808622f5bb0928f00b",
urls = ["https://github.com/bazelbuild/platforms/archive/98939346da932eef0b54cf808622f5bb0928f00b.zip"],
)
# RocksDB
new_local_repository(
name = "rocksdb",
build_file = "//:thirdparties/rocksdb.BUILD",
path = "thirdparties/rocksdb",
)
# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
http_archive(
name = "hedron_compile_commands",
# Replace the commit hash in both places (below) with the latest, rather than using the stale one here.
# Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README).
urls = [
"https://curve-build.nos-eastchina1.126.net/bazel-compile-commands-extractor-af9af15f7bc16fc3e407e2231abfcb62907d258f.tar.gz",
"https://github.com/hedronvision/bazel-compile-commands-extractor/archive/af9af15f7bc16fc3e407e2231abfcb62907d258f.tar.gz",
],
strip_prefix = "bazel-compile-commands-extractor-af9af15f7bc16fc3e407e2231abfcb62907d258f",
# When you first run this tool, it'll recommend a sha256 hash to put here with a message like: "DEBUG: Rule 'hedron_compile_commands' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = ..."
)
load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
hedron_compile_commands_setup()

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2023 NetEase Inc.
# Copyright (c) 2020 NetEase Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -14,21 +14,21 @@
# limitations under the License.
#
# Bazel (http://bazel.io/) BUILD file for gflags.
#
# See INSTALL.md for instructions for adding gflags to a Bazel workspace.
load("//:copts.bzl", "CURVE_TEST_COPTS")
licenses(["notice"])
cc_test(
name = "client_metric_test",
srcs = glob([
"*.cpp",
"*.h"],
),
copts = CURVE_TEST_COPTS,
deps = [
"//external:gtest",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"//curvefs/src/client/metric:client_metric",
],
visibility = ["//visibility:public"],
exports_files(["src/gflags_completions.sh", "COPYING.txt"])
config_setting(
name = "x64_windows",
values = {"cpu": "x64_windows"},
)
load(":bazel/gflags.bzl", "gflags_sources", "gflags_library")
(hdrs, srcs) = gflags_sources(namespace=["gflags", "google"])
gflags_library(hdrs=hdrs, srcs=srcs, threads=0)
gflags_library(hdrs=hdrs, srcs=srcs, threads=1)

98
bazel/glog.BUILD Normal file
View File

@ -0,0 +1,98 @@
#
# Copyright (c) 2020 NetEase Inc.
#
# Licensed 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.
#
cc_library(
name = "glog",
srcs = [
"config.h",
"src/base/commandlineflags.h",
"src/base/googleinit.h",
"src/base/mutex.h",
"src/demangle.cc",
"src/demangle.h",
"src/logging.cc",
"src/raw_logging.cc",
"src/signalhandler.cc",
"src/symbolize.cc",
"src/symbolize.h",
"src/utilities.cc",
"src/utilities.h",
"src/vlog_is_on.cc",
] + glob(["src/stacktrace*.h"]),
hdrs = [
"src/glog/log_severity.h",
"src/glog/logging.h",
"src/glog/raw_logging.h",
"src/glog/stl_logging.h",
"src/glog/vlog_is_on.h",
],
copts = [
"-Wno-sign-compare",
"-U_XOPEN_SOURCE",
],
includes = ["./src"],
linkopts = ["-lpthread"] + select({
":libunwind": ["-lunwind"],
"//conditions:default": [],
}),
visibility = ["//visibility:public"],
deps = [
"@com_github_gflags_gflags//:gflags",
],
)
config_setting(
name = "libunwind",
values = {
"define": "libunwind=true",
},
)
genrule(
name = "run_configure",
srcs = [
"README",
"Makefile.in",
"config.guess",
"config.sub",
"install-sh",
"ltmain.sh",
"missing",
"libglog.pc.in",
"src/config.h.in",
"src/glog/logging.h.in",
"src/glog/raw_logging.h.in",
"src/glog/stl_logging.h.in",
"src/glog/vlog_is_on.h.in",
],
outs = [
"config.h",
"src/glog/logging.h",
"src/glog/raw_logging.h",
"src/glog/stl_logging.h",
"src/glog/vlog_is_on.h",
],
tools = [
"configure",
],
cmd = "$(location :configure)" +
"&& cp -v src/config.h $(location config.h) " +
"&& cp -v src/glog/logging.h $(location src/glog/logging.h) " +
"&& cp -v src/glog/raw_logging.h $(location src/glog/raw_logging.h) " +
"&& cp -v src/glog/stl_logging.h $(location src/glog/stl_logging.h) " +
"&& cp -v src/glog/vlog_is_on.h $(location src/glog/vlog_is_on.h) "
,
)

44
bazel/gmock.BUILD Normal file
View File

@ -0,0 +1,44 @@
#
# Copyright (c) 2020 NetEase Inc.
#
# Licensed 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.
#
cc_library(
name = "gtest",
srcs = [
"googletest/src/gtest-all.cc",
"googlemock/src/gmock-all.cc",
],
hdrs = glob([
"**/*.h",
"googletest/src/*.cc",
"googlemock/src/*.cc",
]),
includes = [
"googlemock",
"googletest",
"googletest/include",
"googlemock/include",
],
linkopts = ["-pthread"],
visibility = ["//visibility:public"],
)
cc_library(
name = "gtest_main",
srcs = ["googlemock/src/gmock_main.cc"],
linkopts = ["-pthread"],
visibility = ["//visibility:public"],
deps = [":gtest"],
)

View File

@ -15,12 +15,16 @@
#
cc_library(
name = "spdlog",
name = "main",
srcs = glob(
["src/*.cc"],
exclude = ["src/gtest-all.cc"]
),
hdrs = glob([
"include/**/*.h",
"src/*.h"
]),
defines = ["SPDLOG_FMT_EXTERNAL"],
includes = ["include"],
copts = ["-Iexternal/gtest/include"],
linkopts = ["-pthread"],
visibility = ["//visibility:public"],
deps = ["@fmt//:fmt"],
)
)

98
bazel/leveldb.BUILD Normal file
View File

@ -0,0 +1,98 @@
#
# Copyright (c) 2020 NetEase Inc.
#
# Licensed 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.
#
package(default_visibility = ["//visibility:public"])
config_setting(
name = "darwin",
values = {"cpu": "darwin"},
visibility = ["//visibility:public"],
)
SOURCES = ["db/builder.cc",
"db/c.cc",
"db/dbformat.cc",
"db/db_impl.cc",
"db/db_iter.cc",
"db/dumpfile.cc",
"db/filename.cc",
"db/log_reader.cc",
"db/log_writer.cc",
"db/memtable.cc",
"db/repair.cc",
"db/table_cache.cc",
"db/version_edit.cc",
"db/version_set.cc",
"db/write_batch.cc",
"table/block_builder.cc",
"table/block.cc",
"table/filter_block.cc",
"table/format.cc",
"table/iterator.cc",
"table/merger.cc",
"table/table_builder.cc",
"table/table.cc",
"table/two_level_iterator.cc",
"util/arena.cc",
"util/bloom.cc",
"util/cache.cc",
"util/coding.cc",
"util/comparator.cc",
"util/crc32c.cc",
"util/env.cc",
"util/env_posix.cc",
"util/filter_policy.cc",
"util/hash.cc",
"util/histogram.cc",
"util/logging.cc",
"util/options.cc",
"util/status.cc",
"port/port_posix.cc",
"port/port_posix_sse.cc",
"helpers/memenv/memenv.cc",
]
cc_library(
name = "leveldb",
srcs = SOURCES,
hdrs = glob([
"helpers/memenv/*.h",
"util/*.h",
"port/*.h",
"port/win/*.h",
"table/*.h",
"db/*.h",
"include/leveldb/*.h"
],
exclude = [
"**/*test.*",
]),
includes = [
"include/",
],
copts = [
"-fno-builtin-memcmp",
"-DLEVELDB_PLATFORM_POSIX=1",
"-DLEVELDB_ATOMIC_PRESENT",
],
defines = [
"LEVELDB_PLATFORM_POSIX",
] + select({
":darwin": ["OS_MACOSX"],
"//conditions:default": [],
}),
)

View File

@ -51,16 +51,16 @@ curve_version=${tag_version}+${commit_id}${debug}
#step3 执行编译
# check bazel verion, bazel vesion must = 4.2.2
# check bazel verion, bazel vesion must = 0.17.2
bazel_version=`bazel version | grep "Build label" | awk '{print $3}'`
if [ -z ${bazel_version} ]
then
echo "please install bazel 4.2.2 first"
echo "please install bazel 0.17.2 first"
exit
fi
if [ ${bazel_version} != "4.2.2" ]
if [ ${bazel_version} != "0.17.2" ]
then
echo "bazel version must 4.2.2"
echo "bazel version must 0.17.2"
echo "now version is ${bazel_version}"
exit
fi

View File

@ -7,22 +7,12 @@ then
exit
fi
if [ `gcc -dumpversion | awk -F'.' '{print $1}'` -le 6 ]
then
bazelflags=''
else
bazelflags='--copt -faligned-new'
fi
if [ "$1" = "debug" ]
then
DEBUG_FLAG="--compilation_mode=dbg"
fi
bazel build curvefs/... --copt -DHAVE_ZLIB=1 ${DEBUG_FLAG} -s \
--define=with_glog=true --define=libunwind=true --copt -DGFLAGS_NS=google --copt -Wno-error=format-security --copt \
-DUSE_BTHREAD_MUTEX --copt -DCURVEVERSION=${curve_version} --linkopt -L/usr/local/lib ${bazelflags}
bazel build curvefs/... --copt -DHAVE_ZLIB=1 ${DEBUG_FLAG} -s --define=with_glog=true --define=libunwind=true --copt -DGFLAGS_NS=google --copt -Wno-error=format-security --copt -DUSE_BTHREAD_MUTEX --copt -DCURVEVERSION=${curve_version} --linkopt -L/usr/local/lib
if [ $? -ne 0 ]
then
echo "build curvefs failed"
@ -44,5 +34,4 @@ then
echo "mds_test failed"
exit
fi
fi
echo "end compile"
fi

View File

@ -1,242 +0,0 @@
#
# Global settings
#
# log等级INFO=0/WARNING=1/ERROR=2/FATAL=3
global.ip=127.0.0.1 # __CURVEADM_TEMPLATE__ ${service_addr} __CURVEADM_TEMPLATE__
global.port=8200 # __CURVEADM_TEMPLATE__ ${service_port} __CURVEADM_TEMPLATE__
global.subnet=127.0.0.0/24
global.enable_external_server=true
global.external_ip=127.0.0.1 # __CURVEADM_TEMPLATE__ ${service_external_addr} __CURVEADM_TEMPLATE__
global.external_subnet=127.0.0.0/24
# chunk大小一般16MB
# it will be overwritten from chunkfilepool.meta if `chunkfilepool.enable_get_chunk_from_pool` is true
global.chunk_size=16777216
# chunk 元数据页大小一般4KB
# it will be overwritten from chunkfilepool.meta if `chunkfilepool.enable_get_chunk_from_pool` is true
global.meta_page_size=4096
# chunk's block size, IO requests must align with it, supported value is |512| and |4096|
# it should consist with `block_size` in chunkfilepool.meta_path and `mds.volume.blockSize` in MDS's configurations
# for clone chunk and snapshot chunk, it's also the minimum granularity that each bit represents
# if set to |512|, we need 4096 bytes bitmap for each chunk, so meta_page_size should be 8192 or larger.
# it will be overwritten from chunkfilepool.meta if `chunkfilepool.enable_get_chunk_from_pool` is true
global.block_size=4096
# clone chunk允许的最长location长度
global.location_limit=3000
#
# MDS settings
#
#支持mds多地址以逗号分隔 127.0.0.1:6666,127.0.0.1:7777
mds.listen.addr=127.0.0.1:6666 # __CURVEADM_TEMPLATE__ ${cluster_mds_addr} __CURVEADM_TEMPLATE__
# 向mds注册的最大重试次数
mds.register_retries=100
# 向mds注册的rpc超时时间一般1000ms
mds.register_timeout=1000
# 向mds发送心跳的间隔一般10s
mds.heartbeat_interval=10
# 向mds发送心跳的rpc超时间一般1000ms
mds.heartbeat_timeout=5000
#
# Chunkserver settings
#
# chunkserver主目录
chunkserver.stor_uri=local://./0/ # __CURVEADM_TEMPLATE__ local://${prefix}/data __CURVEADM_TEMPLATE__
# chunkserver元数据文件
chunkserver.meta_uri=local://./0/chunkserver.dat # __CURVEADM_TEMPLATE__ local://${prefix}/data/chunkserver.dat __CURVEADM_TEMPLATE__
# disk类型
chunkserver.disk_type=nvme
# raft内部install snapshot带宽上限一般20MB
chunkserver.snapshot_throttle_throughput_bytes=20971520
# check cycles是为了更精细的进行带宽控制以snapshotThroughputBytes=100MB
# check cycles=10为例它可以保证每1/10秒的带宽是10MB且不累积例如第1个
# 1/10秒的带宽是10MB但是就过期了在第2个1/10秒依然只能用10MB的带宽
# 不是20MB的带宽
chunkserver.snapshot_throttle_check_cycles=4
# 限制inflight io数量一般是5000
chunkserver.max_inflight_requests=5000
#
# Testing purpose settings
#
test.create_testcopyset=false
test.testcopyset_poolid=666
test.testcopyset_copysetid=888888
test.testcopyset_conf=127.0.0.1:8200:0,127.0.0.1:8201:0,127.0.0.1:8202:0
#
# Copyset settings
#
# 是否检查任期,一般检查
copyset.check_term=true
# 是否关闭raft配置变更的服务一般不关闭
copyset.disable_cli=false
copyset.log_applied_task=false
# raft选举超时时间一般是5000ms
copyset.election_timeout_ms=1000
# raft打快照间隔一般是1800s也就是30分钟
copyset.snapshot_interval_s=1800
# add一个节点add的节点首先以类似learner的角色拷贝数据
# 在跟leader差距catchup_margin个entry的时候leader
# 会尝试将配置变更的entry进行提交(一般来说提交的entry肯定
# 会commit&applycatchup_margin较小可以大概率确保learner
# 后续很快可以加入复制组
copyset.catchup_margin=1000
# copyset chunk数据目录
copyset.chunk_data_uri=local://./0/copysets # __CURVEADM_TEMPLATE__ local://${prefix}/data/copysets __CURVEADM_TEMPLATE__
# raft wal log目录
copyset.raft_log_uri=curve://./0/copysets # __CURVEADM_TEMPLATE__ curve://${prefix}/data/copysets __CURVEADM_TEMPLATE__
# raft元数据目录
copyset.raft_meta_uri=local://./0/copysets # __CURVEADM_TEMPLATE__ local://${prefix}/data/copysets __CURVEADM_TEMPLATE__
# raft snapshot目录
copyset.raft_snapshot_uri=curve://./0/copysets # __CURVEADM_TEMPLATE__ curve://${prefix}/data/copysets __CURVEADM_TEMPLATE__
# copyset回收目录
copyset.recycler_uri=local://./0/recycler # __CURVEADM_TEMPLATE__ local://${prefix}/data/recycler __CURVEADM_TEMPLATE__
# chunkserver启动时copyset并发加载的阈值,为0则表示不做限制
copyset.load_concurrency=10
# chunkserver use how many threads to use copyset complete sync.
copyset.sync_concurrency=20
# 检查copyset是否加载完成出现异常时的最大重试次数
copyset.check_retrytimes=3
# 当前peer的applied_index与leader上的committed_index差距小于该值
# 则判定copyset已经加载完成
copyset.finishload_margin=2000
# 循环判定copyset是否加载完成的内部睡眠时间
copyset.check_loadmargin_interval_ms=1000
# scan copyset interval
copyset.scan_interval_sec=5
# the size each scan 4MB
copyset.scan_size_byte=4194304
# the follower send scanmap to leader rpc timeout
copyset.scan_rpc_timeout_ms=1000
# the follower send scanmap to leader rpc retry times
copyset.scan_rpc_retry_times=3
# the follower send scanmap to leader rpc retry interval
copyset.scan_rpc_retry_interval_us=100000
# enable O_DSYNC when open chunkfile
copyset.enable_odsync_when_open_chunkfile=true
# sync trigger seconds
copyset.sync_trigger_seconds=25
# sync chunk limit default = 2MB
copyset.sync_chunk_limits=2097152
# 30s if the sum of write > sync_threshold, let the sync_chunk_limits doubled.
copyset.sync_threshold=65536
# check syncing interval
copyset.check_syncing_interval_ms=500
#
# Clone settings
#
# 禁止使用curveclient
clone.disable_curve_client=false
# 禁止使用s3adapter
clone.disable_s3_adapter=false
# 克隆的分片大小一般1MB
clone.slice_size=1048576
# 读clone chunk时是否需要paste到本地
# 该配置对recover chunk请求类型无效
clone.enable_paste=false
# 克隆的线程数量
clone.thread_num=10
# 克隆的队列深度
clone.queue_depth=6000
# curve用户名
curve.root_username=root
# curve密码
curve.root_password=root_password
# client配置文件
curve.config_path=conf/cs_client.conf # __CURVEADM_TEMPLATE__ ${prefix}/conf/cs_client.conf __CURVEADM_TEMPLATE__
# s3配置文件
s3.config_path=conf/s3.conf # __CURVEADM_TEMPLATE__ ${prefix}/conf/s3.conf __CURVEADM_TEMPLATE__
# Curve File time to live
curve.curve_file_timeout_s=30
#
# Local FileSystem settings
#
# 是否开启使用renameat2ext4内核3.15以后开始支持
fs.enable_renameat2=true
#
# metrics settings
# true means on, false means off
#
metric.onoff=true
#
# Storage engine settings
#
storeng.sync_write=false
#
# QoS settings
#
#
# Concurrent apply module
# 并发模块写线程的并发度一般是10
wconcurrentapply.size=10
# 并发模块写线程的队列深度
wconcurrentapply.queuedepth=1
# 并发模块读线程的并发度一般是5
rconcurrentapply.size=5
# 并发模块读线程的队列深度
rconcurrentapply.queuedepth=1
#
# Chunkfile pool
#
# 是否开启从chunkfilepool获取chunk一般是true
chunkfilepool.enable_get_chunk_from_pool=true
# chunkfilepool目录
chunkfilepool.chunk_file_pool_dir=./0/ # __CURVEADM_TEMPLATE__ ${prefix}/data __CURVEADM_TEMPLATE__
# chunkfilepool meta文件路径
chunkfilepool.meta_path=./chunkfilepool.meta # __CURVEADM_TEMPLATE__ ${prefix}/data/chunkfilepool.meta __CURVEADM_TEMPLATE__
# chunkfilepool meta文件大小
chunkfilepool.cpmeta_file_size=4096
# chunkfilepool get chunk最大重试次数
chunkfilepool.retry_times=5
# Enable clean chunk
chunkfilepool.clean.enable=true
# The bytes per write for cleaning chunk (max: 1MB)
chunkfilepool.clean.bytes_per_write=4096
# The throttle iops for cleaning chunk (4KB/IO)
chunkfilepool.clean.throttle_iops=500
#
# WAL file pool
#
# walpool是否共用chunkfilepool如果为true从第三条开始配置无效
walfilepool.use_chunk_file_pool=true
# WALpool和ChunkFilePool共用时启用在容量分配时会预留walpool的空间
walfilepool.use_chunk_file_pool_reserve=15
# 是否开启从walfilepool获取chunk一般是true
walfilepool.enable_get_segment_from_pool=true
# walpool目录
walfilepool.file_pool_dir=./0/ # __CURVEADM_TEMPLATE__ ${prefix}/data/walfilepool.meta __CURVEADM_TEMPLATE__
# walpool meta文件路径
walfilepool.meta_path=./walfilepool.meta # __CURVEADM_TEMPLATE__ ${prefix}/data/walfilepool.meta __CURVEADM_TEMPLATE__
# walpool meta文件大小
walfilepool.segment_size=8388608
# WAL metapage大小
walfilepool.metapage_size=4096
# WAL filepool 元数据文件大小
walfilepool.meta_file_size=4096
# WAL filepool get chunk最大重试次数
walfilepool.retry_times=5
#
# trash settings
#
# chunkserver回收数据彻底删除的过期时间
trash.expire_afterSec=300
# chunkserver检查回收数据过期时间的周期
trash.scan_periodSec=120
# common option
#
# chunkserver 日志存放文件夹
chunkserver.common.logDir=./ # __CURVEADM_TEMPLATE__ ${prefix}/logs __CURVEADM_TEMPLATE__
# 单元测试情况下
# chunkserver.common.logDir=./runlog/

View File

@ -13,11 +13,6 @@ global.chunk_size=16777216
# chunk 元数据页大小一般4KB
global.meta_page_size=4096
# clone chunk允许的最长location长度
# chunk's block size, IO requests must align with it, supported value is |512| and |4096|
# it should consist with `block_size` in chunkfilepool.meta_path and `mds.volume.blockSize` in MDS's configurations
# for clone chunk and snapshot chunk, it's also the minimum granularity that each bit represents
# if set to |512|, we need 4096 bytes bitmap for each chunk, so meta_page_size should be 8192 or larger.
global.block_size=4096
global.location_limit=3000
#
@ -50,8 +45,6 @@ chunkserver.snapshot_throttle_throughput_bytes=20971520
# 1/10秒的带宽是10MB但是就过期了在第2个1/10秒依然只能用10MB的带宽
# 不是20MB的带宽
chunkserver.snapshot_throttle_check_cycles=4
# 限制inflight io数量一般是5000
chunkserver.max_inflight_requests=5000
#
# Testing purpose settings
@ -82,17 +75,16 @@ copyset.catchup_margin=1000
# copyset chunk数据目录
copyset.chunk_data_uri=local://./0/copysets
# raft wal log目录
copyset.raft_log_uri=curve://./0/copysets
copyset.raft_log_uri=local://./0/copysets
# raft元数据目录
copyset.raft_meta_uri=local://./0/copysets
# raft snapshot目录
copyset.raft_snapshot_uri=curve://./0/copysets
# copyset回收目录
copyset.recycler_uri=local://./0/recycler
copyset.max_inflight_requests=5000
# chunkserver启动时copyset并发加载的阈值,为0则表示不做限制
copyset.load_concurrency=10
# chunkserver use how many threads to use copyset complete sync.
copyset.sync_concurrency=20
# 检查copyset是否加载完成出现异常时的最大重试次数
copyset.check_retrytimes=3
# 当前peer的applied_index与leader上的committed_index差距小于该值
@ -100,26 +92,6 @@ copyset.check_retrytimes=3
copyset.finishload_margin=2000
# 循环判定copyset是否加载完成的内部睡眠时间
copyset.check_loadmargin_interval_ms=1000
# scan copyset interval
copyset.scan_interval_sec=5
# the size each scan 4MB
copyset.scan_size_byte=4194304
# the follower send scanmap to leader rpc timeout
copyset.scan_rpc_timeout_ms=1000
# the follower send scanmap to leader rpc retry times
copyset.scan_rpc_retry_times=3
# the follower send scanmap to leader rpc retry interval
copyset.scan_rpc_retry_interval_us=100000
# enable O_DSYNC when open chunkfile
copyset.enable_odsync_when_open_chunkfile=true
# sync trigger seconds
copyset.sync_trigger_seconds=25
# sync chunk limit default = 2MB
copyset.sync_chunk_limits=2097152
# 30s if the sum of write > sync_threshold, let the sync_chunk_limits doubled.
copyset.sync_threshold=65536
# check syncing interval
copyset.check_syncing_interval_ms=500
#
# Clone settings
@ -145,8 +117,6 @@ curve.root_password=root_password
curve.config_path=conf/cs_client.conf
# s3配置文件
s3.config_path=conf/s3.conf
# Curve File time to live
curve.curve_file_timeout_s=30
#
# Local FileSystem settings
@ -203,10 +173,8 @@ chunkfilepool.clean.throttle_iops=500
#
# WAL file pool
#
# walpool是否共用chunkfilepool如果为true从第三条开始配置无效
# walpool是否共用chunkfilepool如果为true则以下配置无效
walfilepool.use_chunk_file_pool=true
# WALpool和ChunkFilePool共用时启用在容量分配时会预留walpool的空间
walfilepool.use_chunk_file_pool_reserve=15
# 是否开启从walfilepool获取chunk一般是true
walfilepool.enable_get_segment_from_pool=true
# walpool目录

View File

@ -129,13 +129,10 @@ global.fileIOSplitMaxSizeKB=64
#
################# log相关配置 ###############
#
# enable logging or not
global.logging.enable=True
#
# log等级 INFO=0/WARNING=1/ERROR=2/FATAL=3
global.logLevel=0
# 设置log的路径
global.logPath=/data/log/curve/ # __CURVEADM_TEMPLATE__ /curvebs/client/logs __CURVEADM_TEMPLATE__
global.logPath=/data/log/curve/
# 单元测试情况下
# logpath=./runlog/
@ -167,17 +164,3 @@ discard.enable=true
discard.granularity=4096
# discard cleanup task delay times in millisecond
discard.taskDelayMs=60000
##### chunkserver client option #####
# chunkserver client rpc timeout time
csClientOpt.rpcTimeoutMs=500
# chunkserver client rpc max try
csClientOpt.rpcMaxTry=86400000
# chunkserver client rpc retry interval
csClientOpt.rpcIntervalUs=100000
# chunkserver client rpc max timeout time
csClientOpt.rpcMaxTimeoutMs=8000
##### chunkserver broadcaster option #####
# broad cast max machine num
csBroadCasterOpt.broadCastMaxNum=200

View File

@ -3,7 +3,7 @@
#
# mds的地址信息对于mds集群地址以逗号隔开
mds.listen.addr=127.0.0.1:6666 # __CURVEADM_TEMPLATE__ ${cluster_mds_addr} __CURVEADM_TEMPLATE__
mds.listen.addr=127.0.0.1:6666
# 初始化阶段向mds注册开关默认为开
mds.registerToMDS=false
@ -138,7 +138,7 @@ global.fileIOSplitMaxSizeKB=64
# log等级 INFO=0/WARNING=1/ERROR=2/FATAL=3
global.logLevel=0
# 设置log的路径
global.logPath=/data/log/curve/ # __CURVEADM_TEMPLATE__ ${prefix}/logs __CURVEADM_TEMPLATE__
global.logPath=/data/log/curve/
# 单元测试情况下
# logpath=./runlog/

View File

@ -1,113 +0,0 @@
# This is the configuration file for the etcd server.
# Human-readable name for this member.
name: # __CURVEADM_TEMPLATE__ etcd${service_host_sequence}${service_replica_sequence} __CURVEADM_TEMPLATE__
# Path to the data directory.
data-dir: # __CURVEADM_TEMPLATE__ ${prefix}/data __CURVEADM_TEMPLATE__
# Path to the dedicated wal directory.
wal-dir: # __CURVEADM_TEMPLATE__ ${prefix}/data/wal __CURVEADM_TEMPLATE__
# Number of committed transactions to trigger a snapshot to disk.
snapshot-count: 10000
# Time (in milliseconds) of a heartbeat interval.
heartbeat-interval: 100
# Time (in milliseconds) for an election to timeout.
election-timeout: 1000
quota-backend-bytes: 0
# List of comma separated URLs to listen on for peer traffic.
listen-peer-urls: # __CURVEADM_TEMPLATE__ http://${service_addr}:${service_port} __CURVEADM_TEMPLATE__
# List of comma separated URLs to listen on for client traffic.
listen-client-urls: # __CURVEADM_TEMPLATE__ http://${service_addr}:${service_client_port} __CURVEADM_TEMPLATE__
# Maximum number of snapshot files to retain (0 is unlimited).
max-snapshots: 5
# Maximum number of wal files to retain (0 is unlimited).
max-wals: 5
# Comma-separated white list of origins for CORS (cross-origin resource sharing).
cors:
# List of this member's peer URLs to advertise to the rest of the cluster.
# The URLs needed to be a comma-separated list.
initial-advertise-peer-urls: # __CURVEADM_TEMPLATE__ http://${service_addr}:${service_port} __CURVEADM_TEMPLATE__
# List of this member's client URLs to advertise to the public.
# The URLs needed to be a comma-separated list.
advertise-client-urls: # __CURVEADM_TEMPLATE__ http://${service_addr}:${service_client_port} __CURVEADM_TEMPLATE__
# Discovery URL used to bootstrap the cluster.
discovery:
# Valid values include 'exit', 'proxy'
discovery-fallback: proxy
# HTTP proxy to use for traffic to discovery service.
discovery-proxy:
# DNS domain used to bootstrap initial cluster.
discovery-srv:
# Initial cluster configuration for bootstrapping.
initial-cluster: # __CURVEADM_TEMPLATE__ ${cluster_etcd_http_addr} __CURVEADM_TEMPLATE__
# Initial cluster token for the etcd cluster during bootstrap.
initial-cluster-token: etcd-cluster
# Initial cluster state ('new' or 'existing').
initial-cluster-state: new
# Reject reconfiguration requests that would cause quorum loss.
strict-reconfig-check: False
# Accept etcd V2 client requests
enable-v2: True
# Enable runtime profiling data via HTTP server
enable-pprof: True
# Valid values include 'on', 'readonly', 'off'
proxy: 'off'
# Time (in milliseconds) an endpoint will be held in a failed state.
proxy-failure-wait: 5000
# Time (in milliseconds) of the endpoints refresh interval.
proxy-refresh-interval: 30000
# Time (in milliseconds) for a dial to timeout.
proxy-dial-timeout: 1000
# Time (in milliseconds) for a write to timeout.
proxy-write-timeout: 5000
# Time (in milliseconds) for a read to timeout.
proxy-read-timeout: 0
# Enable debug-level logging for etcd.
debug: False
logger: zap
# Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
log-outputs: [stderr]
# Force to create a new one member cluster.
force-new-cluster: False
auto-compaction-mode: periodic
auto-compaction-retention: "1"
# Set level of detail for exported metrics, specify 'extensive' to include histogram metrics.
metrics: extensive
# Enable to run an additional Raft election phase.
pre-vote: True
enable-grpc-gateway: True

View File

@ -1,16 +1,16 @@
#
# mds服务端口
#
mds.listen.addr=127.0.0.1:6666 #__CURVEADM_TEMPLATE__ ${service_addr}:${service_port} __CURVEADM_TEMPLATE__
mds.dummy.listen.port=6667 # __CURVEADM_TEMPLATE__ ${service_dummy_port} __CURVEADM_TEMPLATE__
mds.listen.addr=127.0.0.1:6666
mds.dummy.listen.port=6667
global.subnet=127.0.0.0/24
global.port=6666 # __CURVEADM_TEMPLATE__ ${service_port} __CURVEADM_TEMPLATE__
global.port=6666
#
# etcd相关配置
#
# etcd地址
mds.etcd.endpoint=127.0.0.1:2379 # __CURVEADM_TEMPLATE__ ${cluster_etcd_addr} __CURVEADM_TEMPLATE__
mds.etcd.endpoint=127.0.0.1:2379
# client建立连接的超时时间
mds.etcd.dailtimeoutMs=5000
# client进行put/get/txn等操作的超时时间
@ -53,8 +53,6 @@ mds.enable.leader.scheduler=true
mds.enable.recover.scheduler=true
# replicaScheduler开关
mds.enable.replica.scheduler=true
# Scan scheduler switch
mds.enable.scan.scheduler=true
# copysetScheduler 轮次间隔单位是s
mds.copyset.scheduler.intervalSec=5
# replicaScheduler 轮次间隔单位是s
@ -63,8 +61,6 @@ mds.replica.scheduler.intervalSec=5
mds.leader.scheduler.intervalSec=30
# recoverScheduler 轮次间隔单位是s
mds.recover.scheduler.intervalSec=5
# Scan scheduler run interval (seconds)
mds.scan.scheduler.intervalSec=60
# 每块磁盘上operator的并发度
mds.schduler.operator.concurrent=1
# leader变更超时时间, 超时后mds从内存移除该operator
@ -75,8 +71,6 @@ mds.scheduler.remove.limitSec=300
mds.scheduler.add.limitSec=1800
# change一个副本超时时间, 超时后mds从内存移除该operator
mds.scheduler.change.limitSec=1800
# Scan operator timeout (seconds)
mds.scheduler.scan.limitSec=180
# copyset数量极差不能超过均值的百分比
mds.scheduler.copysetNumRangePercent=0.05
# chunkserver上copyset的scatte-rwidth不能超过最小值的百分比
@ -86,16 +80,6 @@ mds.chunkserver.failure.tolerance=3
# chunkserver启动coolingTimeSec_后才可以作为target leader, 单位是s
# TODO(lixiaocui): 续得一定程度上与快照的时间间隔方面做到相关
mds.scheduler.chunkserver.cooling.timeSec=1800
# ScanScheduler: scan start hour in one day ([0-23])
mds.scheduler.scan.startHour=0
# ScanScheduler: scan end hour in one day ([0-23])
mds.scheduler.scan.endHour=6
# ScanScheduler: scan interval for the same copyset (seconds)
mds.scheduler.scan.intervalSec=86400
# ScanScheduler: maximum number of scan copysets at the same time for every logical pool
mds.scheduler.scan.concurrent.per.pool=10
# ScanScheduler: maximum number of scan copysets at the same time for every chunkserver
mds.scheduler.scan.concurrent.per.chunkserver=1
#
# 心跳相关配置,单位为ms
@ -156,10 +140,8 @@ mds.topology.CreateCopysetRpcRetryTimes=20
# 请求chunkserver上创建copyset重试间隔
mds.topology.CreateCopysetRpcRetrySleepTimeMs=1000
# Topology模块刷新metric时间间隔
mds.topology.UpdateMetricIntervalSec=10
#和mds.chunkserver.failure.tolerance设置有关,一个zone 标准配置20台节点如果允许3台节点failover,
#那么剩余17台机器需要承载原先20台机器的空间,17/20=0.85,即使用量超过这个值即不再往这个池分配,
#具体分为来两种情况, 当不使用chunkfilepool,物理池限制使用百分比,当使用 chunkfilepool 进行chunkfilepool分配时需预留failover空间,
mds.topology.UpdateMetricIntervalSec=60
# 物理池使用百分比,即使用量超过这个值即不再往这个池分配
mds.topology.PoolUsagePercentLimit=85
# 多pool选pool策略 0:Random, 1:Weight
mds.topology.choosePoolPolicy=0
@ -197,8 +179,6 @@ mds.curvefs.defaultSegmentSize=1073741824
mds.curvefs.minFileLength=10737418240
# curvefs的默认最大文件大小20TB = 20*1024*1024*1024*1024 = 21990232555520
mds.curvefs.maxFileLength=21990232555520
# smallest read/write unit for volume, support |512| and |4096|
mds.curvefs.blockSize=4096
#
# chunkseverclient config
@ -218,13 +198,13 @@ mds.chunkserverclient.updateLeaderRetryIntervalMs=5000
# snapshotclone config
#
# snapshot clone server 地址
mds.snapshotcloneclient.addr=127.0.0.1:5555 # __CURVEADM_TEMPLATE__ ${cluster_snapshotclone_proxy_addr} __CURVEADM_TEMPLATE__
mds.snapshotcloneclient.addr=127.0.0.1:5555
#
# common options
#
# 日志存放文件夹
mds.common.logDir=./ # __CURVEADM_TEMPLATE__ ${prefix}/logs __CURVEADM_TEMPLATE__
mds.common.logDir=./
# 单元测试情况下
# mds.common.logDir=./runlog/
@ -239,16 +219,3 @@ mds.throttle.iopsPerGB=30
mds.throttle.bpsMinInMB=120
mds.throttle.bpsMaxInMB=260
mds.throttle.bpsPerGBInMB=0.3
#
## poolset rules
#
# for backward compatibility, rules are applied for select poolset when creating file
#
# for example
# mds.poolset.rules=/dir1/:poolset1;/dir2/:poolset2;/dir1/sub/:sub
#
# when creating file reqeust doesn't have poolset, above rules are used to select poolset
# - if filename is /dir1/file, then poolset1 is select
# - if filename is /dir1/sub/file, then sub is select
mds.poolset.rules=

View File

@ -1,50 +0,0 @@
# -*- mode: nginx -*-
# vim: set expandtab tabstop=4 shiftwidth=4:
worker_processes 4;
pid ${prefix}/logs/nginx.pid;
events {
worker_connections 65535;
}
http {
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for", "$http_range", "$request_time" '
'"$upstream_addr" "-" "-" "-" ';
access_log ${prefix}/logs/access.log main;
error_log ${prefix}/logs/error.log;
sendfile on;
keepalive_timeout 65;
send_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_connect_timeout 1;
proxy_max_temp_file_size 0m;
client_header_buffer_size 4k;
large_client_header_buffers 8 16k;
client_body_buffer_size 128k;
client_max_body_size 200m;
port_in_redirect off;
resolver 119.29.29.29 223.5.5.5 valid=1s;
resolver_timeout 5s;
server {
listen ${service_addr}:${service_proxy_port};
location / {
proxy_pass http://curvebs.163.com;
}
}
upstream curvebs.163.com {
${cluster_snapshotclone_nginx_upstream}
}
}

View File

@ -7,20 +7,19 @@ s3.endpoint=
# reserved for backward compatible
s3.snapshot_bucket_name=
s3.bucket_name=
s3.ak=fake
s3.sk=fake
s3.region=us-east-1
s3.ak=
s3.sk=
# http = 0, https = 1
s3.http_scheme=0
s3.verify_SSL=false
s3.user_agent_conf=S3 Browser
s3.maxConnections=32
s3.connectTimeout=60000
s3.requestTimeout=10000
s3.max_connections=32
s3.connect_timeout=60000
s3.request_timeout=10000
# Off = 0,Fatal = 1,Error = 2,Warn = 3,Info = 4,Debug = 5,Trace = 6
s3.logLevel=4
s3.loglevel=4
s3.logPrefix=/data/log/curve/aws_
s3.asyncThreadNum=64
s3.async_thread_num=64
# throttle
s3.throttle.iopsTotalLimit=5000
s3.throttle.iopsReadLimit=5000
@ -28,5 +27,3 @@ s3.throttle.iopsWriteLimit=5000
s3.throttle.bpsTotalMB=1280
s3.throttle.bpsReadMB=1280
s3.throttle.bpsWriteMB=1280
s3.useVirtualAddressing=false

View File

@ -3,7 +3,7 @@
#
# mds的地址信息对于mds集群地址以逗号隔开
mds.listen.addr=127.0.0.1:6666 # __CURVEADM_TEMPLATE__ ${cluster_mds_addr} __CURVEADM_TEMPLATE__
mds.listen.addr=127.0.0.1:6666
# 初始化阶段向mds注册开关默认为开
mds.registerToMDS=false
@ -138,7 +138,7 @@ global.fileIOSplitMaxSizeKB=64
# log等级 INFO=0/WARNING=1/ERROR=2/FATAL=3
global.logLevel=0
# 设置log的路径
global.logPath=/data/log/curve/ # __CURVEADM_TEMPLATE__ ${prefix}/logs __CURVEADM_TEMPLATE__
global.logPath=/data/log/curve/
# 单元测试情况下
# logpath=./runlog/

View File

@ -2,7 +2,7 @@
# curvefs client options
#
# client配置文件位置
client.config_path=conf/cs_client.conf # __CURVEADM_TEMPLATE__ ${prefix}/conf/snap_client.conf __CURVEADM_TEMPLATE__
client.config_path=conf/cs_client.conf
# mds root 用户名
mds.rootUser=root
# mds root 密码
@ -13,19 +13,19 @@ client.methodRetryTimeSec=300
client.methodRetryIntervalMs=5000
# 日志文件位置
log.dir=./ # __CURVEADM_TEMPLATE__ ${prefix}/logs __CURVEADM_TEMPLATE__
log.dir=./
#
# S3 config path
#
s3.config_path=./conf/s3.conf # __CURVEADM_TEMPLATE__ ${prefix}/conf/s3.conf __CURVEADM_TEMPLATE__
s3.config_path=./conf/s3.conf
#
#server options
#
# for snapshot
server.address=127.0.0.1:5556 # __CURVEADM_TEMPLATE__ ${service_addr}:${service_port} __CURVEADM_TEMPLATE__
server.address=127.0.0.1:5556
server.subnet=127.0.0.0/24
server.port=5556 # __CURVEADM_TEMPLATE__ ${service_port} __CURVEADM_TEMPLATE__
server.port=5556
# 调用client异步方法重试总时间
server.clientAsyncMethodRetryTimeSec=300
# 调用client异步方法重试时间间隔
@ -73,7 +73,7 @@ server.backEndReferenceFuncScanIntervalMs=3600000
# etcd相关配置
#
# etcd地址
etcd.endpoint=127.0.0.1:2379 # __CURVEADM_TEMPLATE__ ${cluster_etcd_addr} __CURVEADM_TEMPLATE__
etcd.endpoint=127.0.0.1:2379
# client建立连接的超时时间
etcd.dailtimeoutMs=5000
# client进行put/get/txn等操作的超时时间
@ -102,4 +102,4 @@ leader.election.timeoutms=0
#
# dummyserver相关配置
#
server.dummy.listen.port=8081 # __CURVEADM_TEMPLATE__ ${service_dummy_port} __CURVEADM_TEMPLATE__
server.dummy.listen.port=8081

View File

@ -1,18 +1,14 @@
# mds地址
mdsAddr=127.0.0.1:6666 # __CURVEADM_TEMPLATE__ ${cluster_mds_addr} __CURVEADM_TEMPLATE__
mdsAddr=127.0.0.1:6666
# mds dummy port
mdsDummyPort=6700 # __CURVEADM_TEMPLATE__ ${cluster_mds_dummy_port} __CURVEADM_TEMPLATE__
mdsDummyPort=6667
# 发送rpc的超时时间
rpcTimeout=500
# rpc重试次数
rpcRetryTimes=5
# the rpc concurrency to chunkserver
rpcConcurrentNum=10
# etcd地址
etcdAddr=127.0.0.1:2379 # __CURVEADM_TEMPLATE__ ${cluster_etcd_addr} __CURVEADM_TEMPLATE__
etcdAddr=127.0.0.1:2379
# snapshot clone server 地址
snapshotCloneAddr= # __CURVEADM_TEMPLATE__ ${cluster_snapshotclone_addr} __CURVEADM_TEMPLATE__
snapshotCloneAddr=127.0.0.1:5555
# snapshot clone server dummy port
snapshotCloneDummyPort= # __CURVEADM_TEMPLATE__ ${cluster_snapshotclone_dummy_port} __CURVEADM_TEMPLATE__
rootUserName=root
rootUserPassword=root_password
snapshotCloneDummyPort=8081

View File

@ -120,8 +120,9 @@ CURVE_LLVM_FLAGS = [
"-Wvla",
"-Wwrite-strings",
"-Wno-float-conversion",
"-Wno-float-conversion",
"-Wno-float-overflow-conversion",
"-Wno-implicit-float-conversion",
"-Wno-implicit-int-float-conversion",
"-Wno-implicit-int-conversion",
"-Wno-shorten-64-to-32",
"-Wno-sign-conversion",
"-DNOMINMAX",
@ -145,16 +146,10 @@ CURVE_LLVM_TEST_FLAGS = [
"-Wno-used-but-marked-unused",
"-Wno-zero-as-null-pointer-constant",
"-Wno-gnu-zero-variadic-macro-arguments",
"-Wbraced-scalar-init",
]
# FIXME: temporary disabled because triggered in many places
CURVE_LLVM_DISABLED_FLGAS = [
"-Wno-c++11-narrowing",
]
CURVE_DEFAULT_COPTS = select({
"//:clang_compiler": CURVE_LLVM_FLAGS + CXX_FLAGS + BASE_FLAGS + CURVE_LLVM_DISABLED_FLGAS,
"//:clang_compiler": CURVE_LLVM_FLAGS + CXX_FLAGS + BASE_FLAGS,
"//conditions:default": CURVE_GCC_FLAGS + CXX_FLAGS + BASE_FLAGS + CURVE_GCC_DISABLED_FLGAS,
})

118
coverage/check_coverage.sh Executable file
View File

@ -0,0 +1,118 @@
#!/bin/bash
line_cover_base=75
mds_branch_base=70
snapshot_branch_base=70
client_branch_base=78
other_branch_base=65
line_cover_all=`cat coverage/index.html | grep -A 5 "Lines" | grep % | awk -F "%" '{print $1}' | awk -F '>' '{print $2}' | awk -F '.' '{print $1}'`
if(("$line_cover_all" < "$line_cover_base"))
then
echo "line cover not ok!.";
echo $line_cover_all;
exit -1
else
echo "line cover ok!.";
echo $line_cover_all;
fi
for i in `find coverage -type d | grep mds`;do for j in $i;do find $j -name index.html | xargs cat | grep -A 5 "Branches" | grep % | awk -F '>' '{print $2}' | awk '{print $1}' | awk -F '.' '{print $1}' | grep -v tr;done;done > mds.all
if [ -s mds.all ]; then
mds_branch=`cat mds.all | awk '{sum+=$1} END {print sum/NR}' | awk -F '.' '{print $1}'`
else
mds_branch=0
fi
if(("$mds_branch" < "$mds_branch_base"))
then
echo "mds_branch cover not ok!.";
echo $mds_branch;
exit -1
else
echo "mds_branch cover ok!.";
echo $mds_branch;
fi
for i in `find coverage -type d | grep tools`;do for j in $i;do find $j -name index.html | xargs cat | grep -A 5 "Branches" | grep % | awk -F '>' '{print $2}' | awk '{print $1}' | awk -F '.' '{print $1}' | grep -v tr;done;done > tools.all
if [ -s tools.all ]; then
tools_branch=`cat tools.all | awk '{sum+=$1} END {print sum/NR}' | awk -F '.' '{print $1}'`
else
tools_branch=0
fi
if(("$tools_branch" < "$other_branch_base"))
then
echo "tools_branch cover not ok!.";
echo $tools_branch;
#exit -1
else
echo "tools_branch cover ok!.";
echo $tools_branch;
fi
for i in `find coverage -type d | grep common`;do for j in $i;do find $j -name index.html | xargs cat | grep -A 5 "Branches" | grep % | awk -F '>' '{print $2}' | awk '{print $1}' | awk -F '.' '{print $1}' | grep -v tr;done;done > common.all
if [ -s common.all ]; then
common_branch=`cat common.all | awk '{sum+=$1} END {print sum/NR}' | awk -F '.' '{print $1}'`
else
common_branch=0
fi
if(("$common_branch" < "$other_branch_base"))
then
echo "common_branch cover not ok!.";
echo $common_branch;
exit -1
else
echo "common_branch cover ok!.";
echo $common_branch;
fi
for i in `find coverage -type d | grep chunkserver`;do for j in $i;do find $j -name index.html | xargs cat | grep -A 5 "Branches" | grep % | awk -F '>' '{print $2}' | awk '{print $1}' | awk -F '.' '{print $1}' | grep -v tr;done;done > chunkserver.all
if [ -s chunkserver.all ]; then
chunkserver_branch=`cat chunkserver.all | awk '{sum+=$1} END {print sum/NR}' | awk -F '.' '{print $1}'`
else
chunkserver_branch=0
fi
if(("$chunkserver_branch" < "$other_branch_base"))
then
echo "chunkserver_branch cover not ok!.";
echo $chunkserver_branch;
exit -1
else
echo "chunkserver_branch cover ok!.";
echo $chunkserver_branch;
fi
for i in `find coverage/client -type d | grep client`;do for j in $i;do find $j -name index.html | xargs cat | grep -A 5 "Branches" | grep % | awk -F '>' '{print $2}' | awk '{print $1}' | awk -F '.' '{print $1}' | grep -v tr;done;done > client.all
if [ -s chunkserver.all ]; then
client_branch=`cat client.all | awk '{sum+=$1} END {print sum/NR}' | awk -F '.' '{print $1}'`
else
client_branch=0
fi
if(("$client_branch" < "$client_branch_base"))
then
echo "client_branch cover not ok!.";
echo $client_branch;
exit -1
else
echo "client_branch cover ok!.";
echo $client_branch;
fi
for i in `find coverage -type d | grep fs`;do for j in $i;do find $j -name index.html | xargs cat | grep -A 5 "Branches" | grep % | awk -F '>' '{print $2}' | awk '{print $1}' | awk -F '.' '{print $1}' | grep -v tr;done;done > sfs.all
if [ -s sfs.all ]; then
sfs_branch=`cat sfs.all | awk '{sum+=$1} END {print sum/NR}' | awk -F '.' '{print $1}'`
else
sfs_branch=0
fi
if(("$sfs_branch" < "$other_branch_base"))
then
echo "sfs_branch cover not ok!.";
echo $sfs_branch;
#exit -1
else
echo "sfs_branch cover ok!.";
echo $sfs_branch;
fi

111
coverage/filterbr.py Executable file
View File

@ -0,0 +1,111 @@
#!/usr/bin/env python3
# 2017, Georg Sauthoff <mail@gms.tf>, GPLv3
import sys
def skip_comments(lines):
state = 0
for line in lines:
n = len(line)
l = ''
p = 0
while p < n:
if state == 0:
a = line.find('//', p)
b = line.find('/*', p)
if a > -1 and (a < b or b == -1):
l += line[p:a]
p = n
elif b > -1 and (b < a or a == -1):
l += line[p:b]
p = b+2
state = 1
else:
l += line[p:]
p = n
elif state == 1:
a = line.rfind('*/', p)
if a == -1:
p = n
else:
p = a + 2
state = 0
yield l
def cond_lines(lines):
state = 0
pcnt = 0
for nr, line in enumerate(lines, 1):
if not line:
continue
n = len(line)
p = 0
do_yield = False
while p < n:
if state == 0:
# p = line.strip().startswith('if', p)
p = line.find('if', p)
if p == -1:
p = n
continue
if (p == 0 or not line[p-1].isalpha()) \
and (p+2 == len(line) or not line[p+2].isalpha()):
do_yield = True
state = 1
p += 2
elif state == 1:
do_yield = True
p = line.find('(', p)
if p == -1:
p = n
else:
p += 1
state = 2
pcnt = 1
elif state == 2:
do_yield = True
for p in range(p, n):
if line[p] == '(':
pcnt += 1
elif line[p] == ')':
pcnt -= 1
if not pcnt:
state = 0
break
p += 1
if do_yield:
yield nr
def cond_lines_from_file(filename):
with open(filename) as f:
yield from cond_lines(skip_comments(f))
def filter_lcov_trace(lines):
nrs = set()
for line in lines:
if line.startswith('SF:'):
nrs = set(cond_lines_from_file(line[3:-1]))
elif line.startswith('BRDA:'):
xs = line[5:].split(',')
nr = int(xs[0]) if xs else 0
if nr not in nrs:
continue
yield line
def filter_lcov_trace_file(s_filename, d_file):
with open(s_filename) as f:
for l in filter_lcov_trace(f):
print(l, end='', file=d_file)
if __name__ == '__main__':
#for l in cond_lines_from_file(sys.argv[1]):
# print(l)
filter_lcov_trace_file(sys.argv[1], sys.stdout)
#with open(sys.argv[1]) as f:
# for l in skip_comments(f):
# print(l)

106
coverage/gen-coverage-nebd.py Executable file
View File

@ -0,0 +1,106 @@
#!/usr/bin/env python3
# 2017, Georg Sauthoff <mail@gms.tf>, GPLv3
import argparse
import logging
import os
import subprocess
import shutil
import sys
sys.path.insert(0, os.path.dirname(__file__))
import filterbr
log = logging.getLogger(__name__)
#ex_path = [ '/usr/include/*', 'unittest/*', 'lib*/*', '*@exe/*', 'example/*' ]
ex_path = [ '/usr/include/*', '/usr/local/include/*', '/usr/lib/*', '*/bazel_out/*', '*/k8-dbg/*', 'test/*', '*/test/*', '*/external/*' , '*/include/*' , '*/thirdparties/*' , '*/client_proto/*' ]
brflag = ['--rc', 'lcov_branch_coverage=1']
lcov = 'lcov'
base = os.path.abspath('.')
cov_init_raw = 'coverage_init_raw.info'
cov_post_raw = 'coverage_post_raw.info'
cov_init = 'coverage_init.info'
cov_post = 'coverage_post.info'
cov_br = 'coverage.info'
cov = 'coverage.info'
report_dir = 'coverage'
def setup_logging():
log_format = '{rel_secs:6.1f} {lvl} {message}'
log_date_format = '%Y-%m-%d %H:%M:%S'
class Relative_Formatter(logging.Formatter):
level_dict = { 10 : 'DBG', 20 : 'INF', 30 : 'WRN', 40 : 'ERR',
50 : 'CRI' }
def format(self, rec):
rec.rel_secs = rec.relativeCreated/1000.0
rec.lvl = self.level_dict[rec.levelno]
return super(Relative_Formatter, self).format(rec)
log = logging.getLogger() # root logger
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
ch.setFormatter(Relative_Formatter(log_format, log_date_format, style='{'))
log.addHandler(ch)
def mk_arg_parser():
p = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='Do some stuff',
epilog='...')
p.add_argument('--html', action='store_true', default=True,
help='generate HTML report (default: on)')
p.add_argument('--no-html', dest='html', action='store_false',
help='disable html report generation')
p.add_argument('--filter-br', action='store_true', default=True,
help='filter branch coverage data (default: on)')
p.add_argument('--no-filter-br', dest='filter_br', action='store_false',
help='disable branch filtering')
return p
def parse_args(*a):
arg_parser = mk_arg_parser()
args = arg_parser.parse_args(*a)
global cov_br
if args.filter_br:
cov_br = 'coverage_br.info'
return args
def run(*args, **kw):
log.info('Executing: ' + ' '.join(map(lambda s:"'"+s+"'", args[0])))
return subprocess.run(*args, **kw, check=True)
def main(args):
run([lcov, '--directory', 'src', '--capture', '-o', cov_post_raw] + brflag )
run([lcov, '--directory', 'src', '--capture', '--initial', '-o', cov_init_raw])
for i, o in [ (cov_init_raw, cov_init), (cov_post_raw, cov_post) ]:
run([lcov, '--remove', i] + ex_path + [ '-o', o] + brflag)
run([lcov, '-a', cov_init, '-a', cov_post, '-o', cov_br] + brflag)
if args.filter_br:
log.info('Filtering branch coverage data ({} -> {})'.format(cov_br, cov))
with open(cov, 'w') as f:
filterbr.filter_lcov_trace_file(cov_br, f)
if args.html:
shutil.rmtree(report_dir, ignore_errors=True)
run(['genhtml', cov, '--branch-coverage', '--ignore-errors', 'source', '-o', report_dir])
return 0
if __name__ == '__main__':
setup_logging()
args = parse_args()
sys.exit(main(args))

106
coverage/gen-coverage.py Executable file
View File

@ -0,0 +1,106 @@
#!/usr/bin/env python3
# 2017, Georg Sauthoff <mail@gms.tf>, GPLv3
import argparse
import logging
import os
import subprocess
import shutil
import sys
sys.path.insert(0, os.path.dirname(__file__))
import filterbr
log = logging.getLogger(__name__)
#ex_path = [ '/usr/include/*', 'unittest/*', 'lib*/*', '*@exe/*', 'example/*' ]
ex_path = [ '/usr/include/*', '/usr/local/include/*', '/usr/lib/*', '*/bazel_out/*', '*/k8-dbg/*', 'test/*', '*/test/*', '*/external/*' , '*/include/*' , '*/thirdparties/*' ]
brflag = ['--rc', 'lcov_branch_coverage=1']
lcov = 'lcov'
base = os.path.abspath('.')
cov_init_raw = 'coverage_init_raw.info'
cov_post_raw = 'coverage_post_raw.info'
cov_init = 'coverage_init.info'
cov_post = 'coverage_post.info'
cov_br = 'coverage.info'
cov = 'coverage.info'
report_dir = 'coverage'
def setup_logging():
log_format = '{rel_secs:6.1f} {lvl} {message}'
log_date_format = '%Y-%m-%d %H:%M:%S'
class Relative_Formatter(logging.Formatter):
level_dict = { 10 : 'DBG', 20 : 'INF', 30 : 'WRN', 40 : 'ERR',
50 : 'CRI' }
def format(self, rec):
rec.rel_secs = rec.relativeCreated/1000.0
rec.lvl = self.level_dict[rec.levelno]
return super(Relative_Formatter, self).format(rec)
log = logging.getLogger() # root logger
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
ch.setFormatter(Relative_Formatter(log_format, log_date_format, style='{'))
log.addHandler(ch)
def mk_arg_parser():
p = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='Do some stuff',
epilog='...')
p.add_argument('--html', action='store_true', default=True,
help='generate HTML report (default: on)')
p.add_argument('--no-html', dest='html', action='store_false',
help='disable html report generation')
p.add_argument('--filter-br', action='store_true', default=True,
help='filter branch coverage data (default: on)')
p.add_argument('--no-filter-br', dest='filter_br', action='store_false',
help='disable branch filtering')
return p
def parse_args(*a):
arg_parser = mk_arg_parser()
args = arg_parser.parse_args(*a)
global cov_br
if args.filter_br:
cov_br = 'coverage_br.info'
return args
def run(*args, **kw):
log.info('Executing: ' + ' '.join(map(lambda s:"'"+s+"'", args[0])))
return subprocess.run(*args, **kw, check=True)
def main(args):
run([lcov, '--directory', 'src', '--capture', '-o', cov_post_raw] + brflag )
run([lcov, '--directory', 'src', '--capture', '--initial', '-o', cov_init_raw])
for i, o in [ (cov_init_raw, cov_init), (cov_post_raw, cov_post) ]:
run([lcov, '--remove', i] + ex_path + [ '-o', o] + brflag)
run([lcov, '-a', cov_init, '-a', cov_post, '-o', cov_br] + brflag)
if args.filter_br:
log.info('Filtering branch coverage data ({} -> {})'.format(cov_br, cov))
with open(cov, 'w') as f:
filterbr.filter_lcov_trace_file(cov_br, f)
if args.html:
shutil.rmtree(report_dir, ignore_errors=True)
run(['genhtml', cov, '--branch-coverage', '--ignore-errors', 'source', '-o', report_dir])
return 0
if __name__ == '__main__':
setup_logging()
args = parse_args()
sys.exit(main(args))

106
coverage/gen-coverage2.py Executable file
View File

@ -0,0 +1,106 @@
#!/usr/bin/env python3
# 2017, Georg Sauthoff <mail@gms.tf>, GPLv3
import argparse
import logging
import os
import subprocess
import shutil
import sys
sys.path.insert(0, os.path.dirname(__file__))
import filterbr
log = logging.getLogger(__name__)
#ex_path = [ '/usr/include/*', 'unittest/*', 'lib*/*', '*@exe/*', 'example/*' ]
ex_path = [ '/usr/include/*', '/usr/local/include/*', '/usr/lib/*', '*/bazel_out/*', '*/k8-dbg/*', 'test/*', '*/test/*', '*/external/*' , '*/include/*' , '*/thirdparties/*' , '*/snapshotcloneserver/*' ]
brflag = ['--rc', 'lcov_branch_coverage=1']
lcov = 'lcov'
base = os.path.abspath('.')
cov_init_raw = 'coverage_init_raw.info'
cov_post_raw = 'coverage_post_raw.info'
cov_init = 'coverage_init.info'
cov_post = 'coverage_post.info'
cov_br = 'coverage.info'
cov = 'coverage.info'
report_dir = 'coverage'
def setup_logging():
log_format = '{rel_secs:6.1f} {lvl} {message}'
log_date_format = '%Y-%m-%d %H:%M:%S'
class Relative_Formatter(logging.Formatter):
level_dict = { 10 : 'DBG', 20 : 'INF', 30 : 'WRN', 40 : 'ERR',
50 : 'CRI' }
def format(self, rec):
rec.rel_secs = rec.relativeCreated/1000.0
rec.lvl = self.level_dict[rec.levelno]
return super(Relative_Formatter, self).format(rec)
log = logging.getLogger() # root logger
log.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
ch.setFormatter(Relative_Formatter(log_format, log_date_format, style='{'))
log.addHandler(ch)
def mk_arg_parser():
p = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='Do some stuff',
epilog='...')
p.add_argument('--html', action='store_true', default=True,
help='generate HTML report (default: on)')
p.add_argument('--no-html', dest='html', action='store_false',
help='disable html report generation')
p.add_argument('--filter-br', action='store_true', default=True,
help='filter branch coverage data (default: on)')
p.add_argument('--no-filter-br', dest='filter_br', action='store_false',
help='disable branch filtering')
return p
def parse_args(*a):
arg_parser = mk_arg_parser()
args = arg_parser.parse_args(*a)
global cov_br
if args.filter_br:
cov_br = 'coverage_br.info'
return args
def run(*args, **kw):
log.info('Executing: ' + ' '.join(map(lambda s:"'"+s+"'", args[0])))
return subprocess.run(*args, **kw, check=True)
def main(args):
run([lcov, '--directory', 'src', '--capture', '-o', cov_post_raw] + brflag )
run([lcov, '--directory', 'src', '--capture', '--initial', '-o', cov_init_raw])
for i, o in [ (cov_init_raw, cov_init), (cov_post_raw, cov_post) ]:
run([lcov, '--remove', i] + ex_path + [ '-o', o] + brflag)
run([lcov, '-a', cov_init, '-a', cov_post, '-o', cov_br] + brflag)
if args.filter_br:
log.info('Filtering branch coverage data ({} -> {})'.format(cov_br, cov))
with open(cov, 'w') as f:
filterbr.filter_lcov_trace_file(cov_br, f)
if args.html:
shutil.rmtree(report_dir, ignore_errors=True)
run(['genhtml', cov, '--branch-coverage', '--ignore-errors', 'source', '-o', report_dir])
return 0
if __name__ == '__main__':
setup_logging()
args = parse_args()
sys.exit(main(args))

226
coverage/ut_incremental_check.py Executable file
View File

@ -0,0 +1,226 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
######################################################################
# Purpose: calculate UT coverage of git commits' new code
# Useage: ./ut_incremental_check.py
# Version: Initial Version by wahaha02
######################################################################
__version__ = 'V1.0'
__author__ = 'wahaha02'
__date__ = '2016-7-25'
__doc__ = '''
PURPOSE:
calculate UT coverage of git commits' new code
USAGE:
./ut_incremental_check.py <since>..<until> <monitor_c_files> <lcov_dir> <threshold>
example:
./ut_incremental_check.py "227b032..79196ba" '["source/soda/sp/lssp/i2c-v2/ksource"]' "coverage" 0.6
WORK PROCESS:
get changed file list between <since> and <until> , filter by <monitor_c_files> options;
get changed lines per changed file;
based on <lcov_dir>, search .gcov.html per file, and get uncover lines;
create report file:ut_incremental_check_report.html and check <threshold> (cover lines/new lines).
UT:
./ut_incremental_check.py ut
'''
__todo__ = '''
TODO LIST:
1. support svn
2. refactory html report by django web template
3. add commit info in html report
4. prompt user/commit/date info when mouse point to uncovered line
5. ...
'''
import sys, os, re
import json
import commands
from HTMLParser import HTMLParser
from pprint import *
DEBUG = 0
class GcovHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.uncovers = []
self.covers = []
self.islineNum = False
self.lineNum = 0
def handle_starttag(self, tag, attrs):
if tag == "span":
for a in attrs:
if a == ('class', 'lineNum'):
self.islineNum = True
if a == ('class', 'lineNoCov'):
self.uncovers.append(self.lineNum)
if a == ('class', 'lineCov'):
self.covers.append(self.lineNum)
def handle_data(self, data):
if self.islineNum:
try:
self.lineNum = int(data)
except:
self.lineNum = -1
def handle_endtag(self, tag):
if tag == "span":
self.islineNum = False
class UTCover(object) :
def __init__(self, since_until, monitor, lcov_dir, thresh) :
self.since, self.until = since_until.split('..')
self.monitor = json.loads(monitor)
self.lcov_dir = lcov_dir
self.thresh = float(thresh)
def get_src(self):
# self.since, self.until, self.monitor
satus, output = commands.getstatusoutput("git diff --name-only %s %s" %(self.since, self.until))
src_files = [f for f in output.split('\n')
for m in self.monitor if m in f
if os.path.splitext(f)[1][1:] in ['c', 'cpp']]
if DEBUG: pprint(src_files)
for i in src_files:
if i.find("main") > 0:
src_files.remove(i)
return src_files
def get_change(self, src_files):
# self.since, self.until
changes = {}
for f in src_files:
satus, output = commands.getstatusoutput("git log --oneline %s..%s %s | awk '{print $1}'" %(self.since, self.until, f))
commits = output.split('\n')
cmd = "git blame %s | grep -E '(%s)' | awk -F' *|)' '{print $6}'" %(f, '|'.join(commits))
satus, lines = commands.getstatusoutput(cmd)
changes[f] = [ int(i) for i in lines.split('\n') if i.isdigit() ]
if DEBUG: pprint(changes)
return changes
def get_ghp(self, f):
gcovfile = os.path.join(self.lcov_dir, f + '.gcov.html')
if not os.path.exists(gcovfile):
return None
ghp = GcovHTMLParser()
ghp.feed(open(gcovfile, 'r').read())
return ghp
def get_lcov_data(self, changes):
# self.lcov_dir
uncovers = {}
lcov_changes = {}
for f, lines in changes.items():
#print f
f = f.split('/', 1)[1]
#f = [c.split('/', 1)[1] for c in f]
ghp = self.get_ghp(f)
if not ghp:
uncovers[f] = lines
lcov_changes[f] = lines
continue
if DEBUG: print f, ghp.uncovers, ghp.covers, lines
lcov_changes[f] = sorted(list(set(ghp.uncovers + ghp.covers) & set(lines)))
uncov_lines = list(set(ghp.uncovers) & set(lines))
if len(uncov_lines) != 0:
uncovers[f] = sorted(uncov_lines)
ghp.close()
return lcov_changes, uncovers
def create_uncover_trs(self, uncovers):
tr_format = '''
<tr>
<td class="coverFile"><a href="%(file)s.gcov.html">%(file)s</a></td>
<td class="coverFile">%(uncov_lines)s </td>
</tr>
'''
trs = ''
for f,v in uncovers.items():
gcovfile = os.path.join(self.lcov_dir, f + '.gcov.html')
if os.path.exists(gcovfile):
s = ''
p = re.compile(r'^<span class="lineNum">\s*(?P<num>\d+)\s*</span>')
for line in open(gcovfile, 'r').readlines():
ps = p.search(line)
if ps:
s += '<a name="%s">' %ps.group('num') + line + '</a>'
else:
s += line
open(gcovfile, 'w').write(s)
data = {'file':f, 'uncov_lines':
", ".join(['<a href="%s.gcov.html#%d">%d</a>' %(f, i, i) for i in v])}
trs += tr_format %data
return trs
def create_report(self, changes, uncovers):
change_linenum, uncov_linenum = 0, 0
for k,v in changes.items():
change_linenum += len(v)
for k,v in uncovers.items():
uncov_linenum += len(v)
cov_linenum = change_linenum - uncov_linenum
coverage = round(cov_linenum * 1.0 / change_linenum
if change_linenum > 0 else 1, 4)
template = open('ut_incremental_coverage_report.template', 'r').read()
data = { 'cov_lines':cov_linenum,
'change_linenum':change_linenum,
'coverage': coverage * 100,
'uncover_trs': self.create_uncover_trs(uncovers)}
open(os.path.join(self.lcov_dir, 'ut_incremental_coverage_report.html'),
'w').write(template %data)
return coverage
def check(self):
# main function
src_files = self.get_src()
changes = self.get_change(src_files)
lcov_changes, uncovers = self.get_lcov_data(changes)
return 0 if self.create_report(lcov_changes, uncovers) > self.thresh else -1
if len(sys.argv) == 1:
print __doc__
sys.exit(0)
if sys.argv[1] == 'ut':
monitor, lcov_dir, threshold = ['["src/"]', "/root/.cache/bazel/_bazel_root/6f45ce5b16fddc736efcfa6b0a4c96a2/execroot/curve/bazel-out/k8-dbg/bin/coverage", 0.95]
test1 = ["960fc84f..9a928260", monitor, lcov_dir, threshold]
if DEBUG: print "test1: ", test1
ut = UTCover(*test1)
src_files = ut.get_src()
print src_files
print "====================="
changes = ut.get_change(src_files)
print "====================="
lcov_changes, uncovers = ut.get_lcov_data(changes)
print "====================="
print uncovers
print "====================="
rate = ut.create_report(changes, uncovers)
print rate
print "===================="
sys.exit(0)
ret = UTCover(*sys.argv[1:]).check()
sys.exit(ret)

View File

@ -0,0 +1,252 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
######################################################################
# Purpose: calculate UT coverage of git commits' new code
# Useage: ./ut_incremental_check.py
# Version: Initial Version by wahaha02
######################################################################
__version__ = 'V1.0'
__author__ = 'wahaha02'
__date__ = '2016-7-25'
__doc__ = '''
PURPOSE:
calculate UT coverage of git commits' new code
USAGE:
./ut_incremental_check.py <since>..<until> <monitor_c_files> <lcov_dir> <threshold>
example:
./ut_incremental_check.py "227b032..79196ba" '["source/soda/sp/lssp/i2c-v2/ksource"]' "coverage" 0.6
WORK PROCESS:
get changed file list between <since> and <until> , filter by <monitor_c_files> options;
get changed lines per changed file;
based on <lcov_dir>, search .gcov.html per file, and get uncover lines;
create report file:ut_incremental_check_report.html and check <threshold> (cover lines/new lines).
UT:
./ut_incremental_check.py ut
'''
__todo__ = '''
TODO LIST:
1. support svn
2. refactory html report by django web template
3. add commit info in html report
4. prompt user/commit/date info when mouse point to uncovered line
5. ...
'''
import sys, os, re
import json
import commands
from HTMLParser import HTMLParser
from pprint import *
DEBUG = 0
class GcovHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.uncovers = []
self.covers = []
self.islineNum = False
self.lineNum = 0
def handle_starttag(self, tag, attrs):
if tag == "span":
for a in attrs:
if a == ('class', 'lineNum'):
self.islineNum = True
if a == ('class', 'lineNoCov'):
self.uncovers.append(self.lineNum)
if a == ('class', 'lineCov'):
self.covers.append(self.lineNum)
def handle_data(self, data):
if self.islineNum:
try:
self.lineNum = int(data)
except:
self.lineNum = -1
def handle_endtag(self, tag):
if tag == "span":
self.islineNum = False
class UTCover(object) :
def __init__(self, since_until, monitor, lcov_dir, thresh) :
self.since, self.until = since_until.split('..')
self.monitor = json.loads(monitor)
self.lcov_dir = lcov_dir
self.thresh = float(thresh)
def get_src(self):
# self.since, self.until, self.monitor
satus, output = commands.getstatusoutput("git diff --name-only %s %s" %(self.since, self.until))
src_files = [f for f in output.split('\n')
for m in self.monitor if m in f
if os.path.splitext(f)[1][1:] in ['c', 'cpp', 'cc']]
exclude = ['src/test']
src_files_clean = []
for f in src_files:
need_excluded = False
for e in exclude:
if e in f:
need_excluded = True
break
if not need_excluded:
src_files_clean.append(f)
print src_files_clean
if DEBUG: pprint(src_files)
return src_files_clean
def get_change(self, src_files):
# self.since, self.until
changes = {}
for f in src_files:
satus, output = commands.getstatusoutput("git log --oneline %s..%s %s | awk '{print $1}'" %(self.since, self.until, f))
commits = output.split('\n')
cmd = "git blame %s | grep -E '(%s)' | cut -d\) -f1 | awk '{print $NF}'" %(f, '|'.join(commits))
print cmd
satus, lines = commands.getstatusoutput(cmd)
changes[f.split("src/")[1]] = [ int(i) for i in lines.split('\n') if i.isdigit() ]
if DEBUG: pprint(changes)
print changes
return changes
def get_ghp(self, f):
gcovfile = os.path.join(self.lcov_dir, f + '.gcov.html')
if not os.path.exists(gcovfile):
print "%s does not exist" % gcovfile
return None
ghp = GcovHTMLParser()
ghp.feed(open(gcovfile, 'r').read())
return ghp
def get_lcov_data(self, changes):
# self.lcov_dir
uncovers = {}
lcov_changes = {}
for f, lines in changes.items():
ghp = self.get_ghp(f)
if not ghp:
uncovers[f] = lines
lcov_changes[f] = lines
continue
if DEBUG: print f, ghp.uncovers, ghp.covers, lines
lcov_changes[f] = sorted(list(set(ghp.uncovers + ghp.covers) & set(lines)))
uncov_lines = list(set(ghp.uncovers) & set(lines))
if len(uncov_lines) != 0:
uncovers[f] = sorted(uncov_lines)
ghp.close()
return lcov_changes, uncovers
def create_uncover_trs(self, uncovers):
tr_format = '''
<tr>
<td class="coverFile"><a href="%(file)s.gcov.html">%(file)s</a></td>
<td class="coverFile">%(uncov_lines)s </td>
</tr>
'''
trs = ''
for f,v in uncovers.items():
gcovfile = os.path.join(self.lcov_dir, f + '.gcov.html')
if os.path.exists(gcovfile):
s = ''
p = re.compile(r'^<span class="lineNum">\s*(?P<num>\d+)\s*</span>')
for line in open(gcovfile, 'r').readlines():
ps = p.search(line)
if ps:
s += '<a name="%s">' %ps.group('num') + line + '</a>'
else:
s += line
open(gcovfile, 'w').write(s)
data = {'file':f, 'uncov_lines':
", ".join(['<a href="%s.gcov.html#%d">%d</a>' %(f, i, i) for i in v])}
trs += tr_format %data
return trs
def create_report(self, changes, uncovers):
change_linenum, uncov_linenum = 0, 0
for k,v in changes.items():
change_linenum += len(v)
for k,v in uncovers.items():
uncov_linenum += len(v)
cov_linenum = change_linenum - uncov_linenum
coverage = round(cov_linenum * 1.0 / change_linenum
if change_linenum > 0 else 1, 4)
template = open('ut_incremental_coverage_report.template', 'r').read()
data = { 'cov_lines':cov_linenum,
'change_linenum':change_linenum,
'coverage': coverage * 100,
'uncover_trs': self.create_uncover_trs(uncovers)}
open(os.path.join(self.lcov_dir, 'ut_incremental_coverage_report.html'),
'w').write(template %data)
return coverage
def check(self):
# main function
src_files = self.get_src()
changes = self.get_change(src_files)
lcov_changes, uncovers = self.get_lcov_data(changes)
return 0 if self.create_report(lcov_changes, uncovers) > self.thresh else 1
if len(sys.argv) == 1:
print __doc__
sys.exit(0)
if sys.argv[1] == 'ut':
monitor, lcov_dir, threshold = ['["source/soda/sp/lssp/i2c-v2/ksource"]', "coverage", 0.8]
test1 = ["b2016fdb..11440652", monitor, lcov_dir, threshold]
if DEBUG: print "test1: ", test1
ut = UTCover(*test1)
src_files = ut.get_src()
assert(src_files == [])
changes = ut.get_change(src_files)
assert(changes == {})
lcov_changes, uncovers = ut.get_lcov_data(changes)
assert(uncovers == {})
rate = ut.create_report(changes, uncovers)
assert(rate == 1)
assert(ut.check() == 0)
test2 = [
"227b03259b33360e2309274f3927c38457d84dd3..79196baabed99661bd31a201ead6764f23a2884c",
monitor, lcov_dir, threshold]
if DEBUG: print "test2: ", test2
ut = UTCover(*test2)
src_files = ut.get_src()
assert(src_files == ['source/soda/sp/lssp/i2c-v2/ksource/bsp_i2c_dev.c', 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_cfcuctrl.c', 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_opt.c', 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_pcie.c'])
changes = ut.get_change(src_files)
assert(changes == {'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_pcie.c': [78], 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_cfcuctrl.c': [56, 57, 58, 59, 60, 130, 131, 132], 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_opt.c': [68, 69, 115, 118, 124, 125, 126, 454, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 471, 721], 'source/soda/sp/lssp/i2c-v2/ksource/bsp_i2c_dev.c': [494, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652]})
lcov_changes, uncovers = ut.get_lcov_data(changes)
assert( lcov_changes == {'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_pcie.c': [78], 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_cfcuctrl.c': [56, 57, 58, 59, 60, 130, 131, 132], 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_opt.c': [125, 459, 461, 462, 471], 'source/soda/sp/lssp/i2c-v2/ksource/bsp_i2c_dev.c': [496, 498, 502, 503, 504, 625, 629, 630, 631, 633, 634, 636, 638, 639, 643, 644, 649, 650]})
assert(uncovers == {'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_pcie.c': [78], 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_cfcuctrl.c': [56, 57, 58, 59, 60, 130, 131, 132], 'source/soda/sp/lssp/i2c-v2/ksource/chips/bsp_i2c_opt.c': [125, 471], 'source/soda/sp/lssp/i2c-v2/ksource/bsp_i2c_dev.c': [502, 503, 504, 643, 644]})
rate = ut.create_report(changes, uncovers)
assert(0.8 > rate > 0.6)
assert(ut.check() == 1)
test3 = ['d98b93e705a227389e7cdc4b43252f4194a6cb7a..e8876ff5fe8ee0e61865315a67bd395f5d7f63f7 ',
monitor, lcov_dir, threshold]
if DEBUG: print "test3: ", test3
ut = UTCover(*test3)
assert(ut.check() == 0)
sys.exit(0)
ret = UTCover(*sys.argv[1:]).check()
sys.exit(ret)

View File

@ -1,5 +1,3 @@
**curve-ansile项目当前已经不进行维护请使用最新工具curveadm进行部署https://github.com/opencurve/curveadm**
curve-ansible是用ansible编写的curve高性能存储系统远程部署升级工具可以很方便的在一台主控机上做到部署升级集群所有节点。
## 一、软件依赖

View File

@ -25,7 +25,6 @@
hosts: client
gather_facts: no
any_errors_fatal: true
become: "{{ sudo_or_not | bool }}"
tags:
- prepare
roles:

View File

@ -1,32 +0,0 @@
---
#
# Copyright (c) 2021 NetEase Inc.
#
# Licensed 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.
#
# The deploy playbook of Curve
- name: check_ansible_version
tags:
- always
import_playbook: check_ansible_version.yml
- name: clean nbd
hosts: client
gather_facts: no
any_errors_fatal: true
become: "{{ sudo_or_not | bool }}"
tags:
- prepare
roles:
- { role: clean, module_name: nbd }

View File

@ -28,7 +28,6 @@
hosts: client
gather_facts: no
any_errors_fatal: true
become: "{{ sudo_or_not | bool }}"
tags:
- prepare
roles:

View File

@ -21,8 +21,6 @@ nebd_log_dir=/data/log/nebd
curve_sdk_log_dir=/data/log/curve
py_client_config_path=/etc/curve/py_client.conf
clean_log_when_clean=false
curvetab_path=/etc/curve
curve_service_path=/etc/systemd/system
[mds:vars]
mds_port=6666
@ -38,6 +36,3 @@ wait_service_timeout=20
curve_bin_dir=/usr/bin
start_by_daemon=true
install_with_deb=false
sudo_or_not=True
ansible_become_user=curve
ansible_become_flags=-iu curve

View File

@ -103,13 +103,10 @@
that:
- firmware_version.stdout|version_compare('24.3.0-0050', '>=')
- name: get chunkserver number
include_tasks: "get_chunkserver_number.yml"
- name: check the disk schedule algorithm
shell: cat /sys/block/sd*/queue/scheduler | grep "\[noop\]" | wc -l
register: result
failed_when: result.stdout | int < chunkserver_num | int
failed_when: result.stdout | int != chunkserver_num
- name: check if the disk cache closed
shell: sudo /sbin/hdparm -W /dev/sd* | grep "write-caching"

View File

@ -16,7 +16,7 @@
#
- name: check if nbd exists in kernel
shell: sudo /sbin/modprobe nbd
shell: /sbin/modprobe nbd
ignore_errors: true
register: modprobe_res

View File

@ -1,30 +0,0 @@
---
#
# Copyright (c) 2021 NetEase Inc.
#
# Licensed 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.
#
# Get chunkserver number
- name: get chunkserver number not get disk automatically
set_fact:
chunkserver_num: "{{ disk_list | length }}"
when: not auto_get_disk_list | bool
- name: get chunkserver number get disk automatically
block:
- shell: '{{ get_disk_list_cmd }} | wc -l'
register: result
- set_fact:
chunkserver_num: "{{ result.stdout }}"
when: auto_get_disk_list | bool

View File

@ -40,15 +40,7 @@
register: result
- name: install lib with yum
shell: sudo yum -y install {{ yum_lib_name }}
register: install_result
when: result.rc != 0
- name: install latest repository
shell: sudo yum -y install https://extras.getpagespeed.com/release-latest.rpm
register: repository
when: result.rc != 0 and install_result.rc != 0
- name: retry install
shell: sudo yum -y install {{ yum_lib_name }}
when: result.rc != 0 and install_result.rc != 0 and repository.rc == 0
when:
- "'CentOS' in distro"

View File

@ -49,7 +49,7 @@
- name: wait nebd-server is down
shell: pidof nebd-server
register: pid
failed_when: pid.stdout != ""
failed_when: result.stdout == ""
when: service_port == 0
- name: start service without daemon
shell: >
@ -68,5 +68,5 @@
- name: wait nebd-server is up
shell: pidof nebd-server
register: pid
failed_when: pid.stdout == ""
failed_when: result.stdout == ""
when: service_port == 0

View File

@ -199,20 +199,12 @@
hosts: snapshotclone_nginx
any_errors_fatal: true
gather_facts: no
become: "{{ sudo_or_not | bool }}"
tags:
- snapshotclone_nginx
- never
roles:
- {
role: install_package,
package_name: curve-snapshotcloneserver-nginx,
package_version: "{{ snapshot_nginx_package_version }}",
tags: [
"install_conf_package",
"install_snapshotclone_nginx_conf_package"
]
}
- { role: install_package, package_name: curve-snapshotcloneserver-nginx,
tags: ["install_conf_package", "install_snapshotclone_nginx_conf_package"] }
- { role: generate_config, template_name: nginx.conf, conf_path: "{{ snapshot_nginx_conf_path }}",
tags: ["generate_config", "generate_snap_nginx_conf"] }
- { role: generate_config, template_name: nginx_config.lua, conf_path: "{{ snapshot_nginx_lua_conf_path}}",

View File

@ -25,7 +25,6 @@
hosts: client
any_errors_fatal: true
gather_facts: no
become: "{{ sudo_or_not | bool }}"
tags:
- prepare_software_env
roles:
@ -35,7 +34,6 @@
hosts: client
gather_facts: no
any_errors_fatal: true
become: "{{ sudo_or_not | bool }}"
tags:
- prepare
vars:
@ -46,4 +44,4 @@
- { role: install_package, package_name: curve-sdk, package_version: "{{ sdk_package_version }}",
tags: install_package }
- { role: generate_config, template_name: client.conf, conf_path: "{{ py_client_config_path }}",
tags: generate_config }
tags: generate_config }

View File

@ -25,7 +25,6 @@
hosts: client
any_errors_fatal: true
gather_facts: yes
become: "{{ sudo_or_not | bool }}"
tags:
- check_kernel_version
tasks:
@ -40,7 +39,6 @@
hosts: client
any_errors_fatal: true
gather_facts: no
become: "{{ sudo_or_not | bool }}"
tags:
- prepare_software_env
roles:
@ -50,7 +48,6 @@
hosts: client
gather_facts: no
any_errors_fatal: true
become: "{{ sudo_or_not | bool }}"
tags:
- prepare
roles:

View File

@ -25,7 +25,6 @@
hosts: client
any_errors_fatal: true
gather_facts: no
become: "{{ sudo_or_not | bool }}"
tags:
- prepare_software_env
roles:
@ -35,7 +34,6 @@
hosts: client
gather_facts: no
any_errors_fatal: true
become: "{{ sudo_or_not | bool }}"
tags:
- prepare
roles:
@ -49,7 +47,6 @@
hosts: client
gather_facts: no
any_errors_fatal: true
become: "{{ sudo_or_not | bool }}"
tags:
- start
roles:

View File

@ -19,3 +19,4 @@ disk_list:
- sda
- sdb
- sdc
- sdd

View File

@ -57,7 +57,7 @@ function walpoolinfo() {
return
fi
# walfilepool
maxSegmentId=`ls $walfilepool | grep -oE '^([0-9]+)' | sort -rh | head -n 1`
maxSegmentId=`ls -vr $walfilepool | head -1`
leftSegmentNum=`ls $walfilepool | wc -l`
# segmentnum to be recycled
@ -95,7 +95,7 @@ function recycle_copysets() {
echo chunkserver$1 actual recycle under data chunk=$rchunkSum
# recycle wal segments
maxSegmentId=`ls $walfilepool | grep -oE '^([0-9]+)' | sort -rh | head -n 1`
maxSegmentId=`ls -vr $walfilepool | head -1`
for copyset in `ls $2`
do
copysetPath=${dataDir}/chunkserver$1/copysets/${copyset}

View File

@ -15,9 +15,6 @@
# limitations under the License.
#
- name: get chunkserver number
include_tasks: "common_tasks/get_chunkserver_number.yml"
- name: clean chunkserver dat
vars:
end_seq: "{{ chunkserver_num | int - 1}}"

View File

@ -15,9 +15,6 @@
# limitations under the License.
#
- name: get chunkserver number
include_tasks: "common_tasks/get_chunkserver_number.yml"
- name: clean data under data dir
vars:
end_seq: "{{ chunkserver_num | int - 1}}"

View File

@ -1,23 +0,0 @@
---
#
# Copyright (c) 2021 NetEase Inc.
#
# Licensed 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.
#
- name: clean nbd auto start at boot
block:
- name: disable service
shell: sudo systemctl disable map_curve_disk.service
- name: remove map_curve_disk.service
shell: sudo rm -f {{ curve_service_path }}/map_curve_disk.service && sudo rm -f {{ curvetab_path }}/curvetab

View File

@ -18,11 +18,8 @@
- name: clear data dir
shell: sudo rm -rf {{ chunkserver_data_dir }}/chunkserver*
- name: get chunkserver number
include_tasks: "common_tasks/get_chunkserver_number.yml"
- name: create data dir and log dir for each chunkserver
vars:
end_seq: "{{ chunkserver_num | int - 1}}"
shell: sudo mkdir -p {{ chunkserver_data_dir }}/chunkserver{{ item }} && sudo mkdir -p {{ chunkserver_data_dir }}/log/chunkserver{{ item }}
shell: mkdir -p {{ chunkserver_data_dir }}/chunkserver{{ item }} && mkdir -p {{ chunkserver_data_dir }}/log/chunkserver{{ item }}
with_sequence: start=0 end={{ end_seq }}

View File

@ -18,7 +18,6 @@
# 通用配置
curve_root_username: root
curve_root_password: root_password
curve_file_timeout_s: 30
chunk_size: 16777216
segment_size: 1073741824
min_file_length: 10737418240
@ -40,27 +39,19 @@ mds_enable_copyset_scheduler: true
mds_enable_leader_scheduler: true
mds_enable_recover_scheduler: true
mds_enable_replica_scheduler: true
mds_enable_scan_scheduler: true
mds_copyset_scheduler_interval_sec: 5
mds_replica_scheduler_interval_sec: 5
mds_leader_scheduler_interval_sec: 30
mds_recover_scheduler_interval_sec: 5
mds_scan_scheduler_interval_sec: 60
mds_schduler_operator_concurrent: 1
mds_schduler_transfer_limit_sec: 60
mds_scheduler_remove_limit_sec: 300
mds_scheduler_add_limit_sec: 1800
mds_scheduler_change_limit_sec: 1800
mds_scheduler_scan_limit_sec: 180
mds_scheduler_copyset_mum_range_percent: 0.05
mds_schduler_scatterwidth_range_percent: 0.2
mds_chunkserver_failure_tolerance: 3
mds_scheduler_chunkserver_cooling_time_sec: 1800
mds_scheduler_scan_start_hour: 0
mds_scheduler_scan_end_hour: 6
mds_scheduler_scan_interval_sec: 259200
mds_scheduler_scan_concurrent_per_pool: 10
mds_scheduler_scan_concurrent_per_chunkserver: 1
mds_heartbeat_interval_ms: 10000
mds_heartbeat_misstimeout_ms: 30000
mds_heartbeat_offlinet_imeout_ms: 1800000
@ -105,7 +96,6 @@ chunkserver_heartbeat_timeout: 5000
chunkserver_stor_uri: local://./0/
chunkserver_meta_uri: local://./0/chunkserver.dat
chunkserver_disk_type: nvme
chunkserver_max_inflight_requests: 5000
chunkserver_snapshot_throttle_throughput_bytes: 20971520
chunkserver_snapshot_throttle_check_cycles: 4
chunkserver_test_create_testcopyset: false
@ -119,22 +109,15 @@ chunkserver_copyset_election_timeout_ms: 1000
chunkserver_copyset_snapshot_interval_s: 1800
chunkserver_copyset_catchup_margin: 1000
chunkserver_copyset_chunk_data_uri: local://./0/copysets
chunkserver_copyset_raft_log_uri: curve://./0/copysets
chunkserver_copyset_raft_log_uri: local://./0/copysets
chunkserver_copyset_raft_meta_uri: local://./0/copysets
chunkserver_copyset_raft_snapshot_uri: curve://./0/copysets
chunkserver_copyset_raft_snapshot_uri: local://./0/copysets
chunkserver_copyset_recycler_uri: local://./0/recycler
chunkserver_copyset_max_inflight_requests: 5000
chunkserver_copyset_load_concurrency: 10
chunkserver_copyset_check_retrytimes: 3
chunkserver_copyset_finishload_margin: 2000
chunkserver_copyset_check_loadmargin_interval_ms: 1000
chunkserver_copyset_scan_interval_sec: 5
chunkserver_copyset_scan_size_byte: 4194304
chunkserver_copyset_scan_rpc_timeout_ms: 1000
chunkserver_copyset_scan_rpc_retry_times: 3
chunkserver_copyset_scan_rpc_retry_interval_us: 100000
chunkserver_copyset_enable_odsync_when_open_chunkfile: false
chunkserver_copyset_synctimer_interval_ms: 30000
chunkserver_copyset_check_syncing_interval_ms: 500
chunkserver_clone_slice_size: 1048576
chunkserver_clone_enable_paste: false
chunkserver_clone_thread_num: 10
@ -279,7 +262,6 @@ s3_throttle_bpsWriteLimit: 1280
# 运维工具默认值
tool_rpc_timeout: 500
tool_rpc_retry_times: 5
tool_rpc_concurrent_num: 10
# snapshotclone_nginx配置
nginx_docker_internal_port: 80

View File

@ -47,13 +47,9 @@
- name: set backup true
set_fact:
backup: true
- name: check config file exist
stat:
path: "{{ conf_path }}"
register: file_status
- name: backup config file
shell: sudo cp {{ conf_path }} {{ conf_path }}.bak
when: backup is defined and file_status.stat.exists
when: backup is defined
- name: mv config file
shell: sudo mv /tmp/{{ template_name }} {{ conf_path }}
- name: diff two files

View File

@ -51,7 +51,6 @@ chunkserver.snapshot_throttle_throughput_bytes={{ chunkserver_snapshot_throttle_
# 1/10秒的带宽是10MB但是就过期了在第2个1/10秒依然只能用10MB的带宽
# 不是20MB的带宽
chunkserver.snapshot_throttle_check_cycles={{ chunkserver_snapshot_throttle_check_cycles }}
chunkserver.max_inflight_requests={{ chunkserver_max_inflight_requests }}
#
# Testing purpose settings
@ -89,6 +88,7 @@ copyset.raft_meta_uri={{ chunkserver_copyset_raft_meta_uri }}
copyset.raft_snapshot_uri={{ chunkserver_copyset_raft_snapshot_uri }}
# copyset回收目录
copyset.recycler_uri={{ chunkserver_copyset_recycler_uri }}
copyset.max_inflight_requests={{ chunkserver_copyset_max_inflight_requests }}
# chunkserver启动时copyset并发加载的阈值,为0则表示不做限制
copyset.load_concurrency={{ chunkserver_copyset_load_concurrency }}
# 检查copyset是否加载完成出现异常时的最大重试次数
@ -98,19 +98,6 @@ copyset.check_retrytimes={{ chunkserver_copyset_check_retrytimes }}
copyset.finishload_margin={{ chunkserver_copyset_finishload_margin }}
# 循环判定copyset是否加载完成的内部睡眠时间
copyset.check_loadmargin_interval_ms={{ chunkserver_copyset_check_loadmargin_interval_ms }}
# scan copyset interval
copyset.scan_interval_sec={{ chunkserver_copyset_scan_interval_sec }}
# the size each scan 4MB
copyset.scan_size_byte={{ chunkserver_copyset_scan_size_byte }}
# the follower send scanmap to leader rpc timeout
copyset.scan_rpc_timeout_ms={{ chunkserver_copyset_scan_rpc_timeout_ms }}
# the follower send scanmap to leader rpc retry times
copyset.scan_rpc_retry_times={{ chunkserver_copyset_scan_rpc_retry_times }}
# the follower send scanmap to leader rpc retry interval
copyset.scan_rpc_retry_interval_us={{ chunkserver_copyset_scan_rpc_retry_interval_us }}
copyset.enable_odsync_when_open_chunkfile={{ chunkserver_copyset_enable_odsync_when_open_chunkfile }}
copyset.synctimer_interval_ms={{ chunkserver_copyset_synctimer_interval_ms }}
copyset.check_syncing_interval_ms={{ chunkserver_copyset_check_syncing_interval_ms }}
#
# Clone settings
@ -136,8 +123,6 @@ curve.root_password={{ curve_root_password }}
curve.config_path={{ chunkserver_client_config_path }}
# s3配置文件
s3.config_path={{ chunkserver_s3_config_path }}
# Curve File time to live
curve.curve_file_timeout_s={{ curve_file_timeout_s }}
#
# Local FileSystem settings

View File

@ -1,3 +1,21 @@
#
# Copyright (c) 2020 NetEase Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
##################### Grafana Configuration Example #####################
#
# Everything has defaults so you only need to uncomment things you want to

View File

@ -61,8 +61,6 @@ mds.enable.leader.scheduler={{ mds_enable_leader_scheduler }}
mds.enable.recover.scheduler={{ mds_enable_recover_scheduler }}
# replicaScheduler开关
mds.enable.replica.scheduler={{ mds_enable_replica_scheduler }}
# Scan scheduler switch
mds.enable.scan.scheduler={{ mds_enable_scan_scheduler }}
# copysetScheduler 轮次间隔单位是s
mds.copyset.scheduler.intervalSec={{ mds_copyset_scheduler_interval_sec }}
# replicaScheduler 轮次间隔单位是s
@ -71,8 +69,6 @@ mds.replica.scheduler.intervalSec={{ mds_replica_scheduler_interval_sec }}
mds.leader.scheduler.intervalSec={{ mds_leader_scheduler_interval_sec }}
# recoverScheduler 轮次间隔单位是s
mds.recover.scheduler.intervalSec={{ mds_recover_scheduler_interval_sec }}
# Scan scheduler run interval (seconds)
mds.scan.scheduler.intervalSec={{ mds_scan_scheduler_interval_sec }}
# 每块磁盘上operator的并发度
mds.schduler.operator.concurrent={{ mds_schduler_operator_concurrent }}
# leader变更超时时间, 超时后mds从内存移除该operator
@ -83,8 +79,6 @@ mds.scheduler.remove.limitSec={{ mds_scheduler_remove_limit_sec }}
mds.scheduler.add.limitSec={{ mds_scheduler_add_limit_sec }}
# change一个副本超时时间, 超时后mds从内存移除该operator
mds.scheduler.change.limitSec={{ mds_scheduler_change_limit_sec }}
# Scan operator timeout (seconds)
mds.scheduler.scan.limitSec={{ mds_scheduler_scan_limit_sec }}
# copyset数量极差不能超过均值的百分比
mds.scheduler.copysetNumRangePercent={{ mds_scheduler_copyset_mum_range_percent }}
# chunkserver上copyset的scatte-rwidth不能超过最小值的百分比
@ -94,16 +88,6 @@ mds.chunkserver.failure.tolerance={{ mds_chunkserver_failure_tolerance }}
# chunkserver启动coolingTimeSec_后才可以作为target leader, 单位是s
# TODO(lixiaocui): 续得一定程度上与快照的时间间隔方面做到相关
mds.scheduler.chunkserver.cooling.timeSec={{ mds_scheduler_chunkserver_cooling_time_sec }}
# ScanScheduler: scan start hour in one day ([0-23])
mds.scheduler.scan.startHour={{ mds_scheduler_scan_start_hour }}
# ScanScheduler: scan end hour in one day ([0-23])
mds.scheduler.scan.endHour={{ mds_scheduler_scan_end_hour }}
# ScanScheduler: scan interval for the same copyset (seconds)
mds.scheduler.scan.intervalSec={{ mds_scheduler_scan_interval_sec }}
# ScanScheduler: maximum number of scan copysets at the same time for every logical pool
mds.scheduler.scan.concurrent.per.pool={{ mds_scheduler_scan_concurrent_per_pool }}
# ScanScheduler: maximum number of scan copysets at the same time for every chunkserver
mds.scheduler.scan.concurrent.per.chunkserver={{ mds_scheduler_scan_concurrent_per_chunkserver }}
#
# 心跳相关配置,单位为ms

View File

@ -1,3 +1,21 @@
#
# Copyright (c) 2020 NetEase Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# my global config
global:
scrape_interval: {{ prometheus_scrape_interval }} # Set the scrape interval to every 15 seconds. Default is every 1 minute.

View File

@ -11,13 +11,13 @@ s3.sk={{ s3_sk }}
s3.http_scheme={{ s3_http_scheme }}
s3.verify_SSL={{ s3_verify_ssl }}
s3.user_agent_conf={{ s3_user_agent_conf }}
s3.maxConnections={{ s3_max_connections }}
s3.connectTimeout={{ s3_connect_timeout }}
s3.requestTimeout={{ s3_request_timeout }}
s3.max_connections={{ s3_max_connections }}
s3.connect_timeout={{ s3_connect_timeout }}
s3.request_timeout={{ s3_request_timeout }}
# Off = 0,Fatal = 1,Error = 2,Warn = 3,Info = 4,Debug = 5,Trace = 6
s3.logLevel={{ s3_loglevel }}
s3.loglevel={{ s3_loglevel }}
s3.logPrefix={{ s3_logPrefix }}
s3.asyncThreadNum={{ s3_async_thread_num }}
s3.async_thread_num={{ s3_async_thread_num }}
# throttle
s3.throttle.iopsTotalLimit={{ s3_throttle_iopsTotalLimit }}
s3.throttle.iopsReadLimit={{ s3_throttle_iopsReadLimit }}

View File

@ -12,8 +12,6 @@ mdsDummyPort={{ hostvars[groups.mds[0]].mds_dummy_port }}
rpcTimeout={{ tool_rpc_timeout }}
# rpc重试次数
rpcRetryTimes={{ tool_rpc_retry_times }}
# the rpc concurrency to chunkserver
rpcConcurrentNum={{ tool_rpc_concurrent_num }}
# etcd地址
{% set etcd_address=[] -%}
{% for host in groups.etcd -%}
@ -33,6 +31,4 @@ etcdAddr={{ etcd_address | join(',') }}
snapshotCloneAddr={{ snap_address | join(',') }}
# snapshot clone server dummy port
snapshotCloneDummyPort={{ hostvars[groups.snapshotclone[0]].snapshot_dummy_port }}
rootUserName={{ curve_root_username }}
rootUserPassword={{ curve_root_password }}
{% endif -%}

View File

@ -31,7 +31,6 @@ snapshot_clone_server_log_dir: /data/log/curve/snapshotclone
local_snapshotcloneserver_package_path: ../curve-snapshotcloneserver
local_monitor_package_path: ../../curve-monitor
curvetab_path: /etc/curve
curve_service_path: /etc/systemd/system
local_snapshotcloneserver_nginx_package_path: ../curve-nginx
snapshotcloneserver_nginx_dir: /etc/curve/nginx
@ -45,8 +44,6 @@ etcd_download_dir: /tmp
install_etcd_dir: /usr/bin
download_dir: /tmp
# jemalloc_download_url: https://github.com/jemalloc/jemalloc/releases/download/3.6.0/jemalloc-3.6.0.tar.bz2
jemalloc_download_url: https://curve-build.nos-eastchina1.126.net/jemalloc-3.6.0.tar.bz2
jemalloc_download_url: https://github.com/jemalloc/jemalloc/releases/download/3.6.0/jemalloc-3.6.0.tar.bz2
lib_install_prefix: /usr/local
# daemon_download_url: http://libslack.org/daemon/download/daemon-0.6.4.tar.gz
daemon_download_url: https://curve-build.nos-eastchina1.126.net/daemon-0.6.4.tar.gz
daemon_download_url: http://libslack.org/daemon/download/daemon-0.6.4.tar.gz

View File

@ -15,45 +15,43 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install package via tar
block:
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install bzip2
vars:
apt_lib_name: bzip2
yum_lib_name: bzip2
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install jemalloc
vars:
lib_name: jemalloc
download_url: "{{ jemalloc_download_url }}"
include_tasks: install_jemalloc.yml
- name: install psmisc
vars:
apt_lib_name: psmisc
yum_lib_name: psmisc
include_tasks: common_tasks/install_with_yum_apt.yml
when: chunkserver_format_disk | bool
- name: install chunkserver bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_chunkserver_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
when: not install_with_deb | bool
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install bzip2
vars:
apt_lib_name: bzip2
yum_lib_name: bzip2
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install jemalloc
vars:
lib_name: jemalloc
download_url: "{{ jemalloc_download_url }}"
include_tasks: install_jemalloc.yml
- name: install psmisc
vars:
apt_lib_name: psmisc
yum_lib_name: psmisc
include_tasks: common_tasks/install_with_yum_apt.yml
when: chunkserver_format_disk | bool
- name: install chunkserver bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_chunkserver_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: generate chunkserver_ctl.sh
vars:

View File

@ -15,47 +15,46 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install package via tar
block:
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libuuid
vars:
apt_lib_name: libuuid1
yum_lib_name: libuuid
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libuuid-dev
vars:
apt_lib_name: uuid-dev
yum_lib_name: libuuid-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install daemon
include_tasks: install_daemon.yml
- name: install mds bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_mds_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install mds lib
vars:
remote_dir_name: "{{ curve_lib_dir }}"
local_file_path: "{{ local_mds_package_path }}/lib/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
when: not install_with_deb | bool
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libuuid
vars:
apt_lib_name: libuuid1
yum_lib_name: libuuid
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libuuid-dev
vars:
apt_lib_name: uuid-dev
yum_lib_name: libuuid-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install daemon
include_tasks: install_daemon.yml
- name: install mds bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_mds_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install mds lib
vars:
remote_dir_name: "{{ curve_lib_dir }}"
local_file_path: "{{ local_mds_package_path }}/lib/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: generate mds-daemon.sh
template: src=mds-daemon.sh.j2 dest={{ deploy_dir }}/mds-daemon.sh mode=0755

View File

@ -15,27 +15,27 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: pull prom/prometheus:latest
shell: sudo docker image pull prom/prometheus:latest
- name: install package via tar
block:
- name: pull prom/prometheus:latest
shell: sudo docker image pull prom/prometheus:latest
- name: pull grafana/grafana:latest
shell: sudo docker image pull grafana/grafana:latest
- name: promoon/reporter:latest
shell: sudo docker image pull promoon/reporter:latest
- name: install jq
vars:
apt_lib_name: jq
yum_lib_name: jq
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install monitor work space
vars:
remote_dir_name: "{{ monitor_work_dir }}"
local_file_path: "{{ local_monitor_package_path }}/"
file_mode: 0777
include_tasks: copy_file_to_remote.yml
when: not install_with_deb | bool
- name: pull grafana/grafana:latest
shell: sudo docker image pull grafana/grafana:latest
- name: promoon/reporter:latest
shell: sudo docker image pull promoon/reporter:latest
- name: install jq
vars:
apt_lib_name: jq
yum_lib_name: jq
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install monitor work space
vars:
remote_dir_name: "{{ monitor_work_dir }}"
local_file_path: "{{ local_monitor_package_path }}/"
file_mode: 0777
include_tasks: copy_file_to_remote.yml
- name: generate curve-monitor.sh
template: src=curve-monitor.sh.j2 dest={{ deploy_dir }}/curve-monitor.sh mode=0755

View File

@ -15,63 +15,59 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install package via tar
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libnl
vars:
apt_lib_name: libnl-3-dev
yum_lib_name: libnl3
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libnl-dev
vars:
apt_lib_name: libnl-genl-3-dev
yum_lib_name: libnl3-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install nbd bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_nbd_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install curvetab
vars:
remote_dir_name: "{{ curvetab_path }}"
local_file_path: "{{ local_nbd_package_path }}/etc/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: add nbd auto start at boot
block:
- name: install libunwind
- name: get distro name
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libunwind-dev
distro:
include_tasks: common_tasks/get_distro_name.yml
- name: copy map_curve_disk.sh to init.d
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libnl
vars:
apt_lib_name: libnl-3-dev
yum_lib_name: libnl3
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libnl-dev
vars:
apt_lib_name: libnl-genl-3-dev
yum_lib_name: libnl3-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install nbd bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_nbd_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: check curvetab exist
stat:
path: "{{ curvetab_path }}/curvetab"
register: file_status
- name: install curvetab if not exist
vars:
remote_dir_name: "{{ curvetab_path }}"
local_file_path: "{{ local_nbd_package_path }}/etc/curvetab"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
when: not file_status.stat.exists
- name: install map_curve_disk.sh
vars:
remote_dir_name: "{{ curve_bin_dir }}"
remote_dir_name: "/etc/init.d"
local_file_path: "{{ local_nbd_package_path }}/bin/map_curve_disk.sh"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: add nbd auto start at boot
block:
- name: install map_curve_disk.service
vars:
remote_dir_name: "{{ curve_service_path }}"
local_file_path: "{{ local_nbd_package_path }}/etc/map_curve_disk.service"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: enable service
shell: sudo systemctl daemon-reload && sudo systemctl enable map_curve_disk.service
when: not install_with_deb | bool
- name: enable on debain ubuntu
shell: sudo update-rc.d map_curve_disk.sh defaults
when: "'Ubuntu' in distro or 'Debian' in distro"
- name: enable on centos
shell: sudo chkconfig --add map_curve_disk.sh && sudo chkconfig map_curve_disk.sh on
when: "'CentOS' in distro"

View File

@ -15,48 +15,47 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install package via tar
block:
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install curve-sdk bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_curve_sdk_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install curve-sdk lib
vars:
remote_dir_name: "{{ curve_lib_dir }}"
local_file_path: "{{ local_curve_sdk_package_path }}/lib/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: install curve-sdk include
vars:
remote_dir_name: "{{ curve_include_dir }}"
local_file_path: "{{ local_curve_sdk_package_path }}/include/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: install curve-sdk curvefs
vars:
remote_dir_name: "{{ curvefs_dir }}"
local_file_path: "{{ local_curve_sdk_package_path }}/curvefs/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: create log dir
vars:
dir_name: "{{ curve_sdk_log_dir }}"
include_tasks: common_tasks/create_dir.yml
when: not install_with_deb | bool
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install curve-sdk bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_curve_sdk_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install curve-sdk lib
vars:
remote_dir_name: "{{ curve_lib_dir }}"
local_file_path: "{{ local_curve_sdk_package_path }}/lib/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: install curve-sdk include
vars:
remote_dir_name: "{{ curve_include_dir }}"
local_file_path: "{{ local_curve_sdk_package_path }}/include/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: install curve-sdk curvefs
vars:
remote_dir_name: "{{ curvefs_dir }}"
local_file_path: "{{ local_curve_sdk_package_path }}/curvefs/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: create log dir
vars:
dir_name: "{{ curve_sdk_log_dir }}"
include_tasks: common_tasks/create_dir.yml

View File

@ -15,14 +15,9 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: install snapshotcloneserver_nginx via tar
- name: install snapshotcloneserver_nginx
vars:
remote_dir_name: "{{ snapshotcloneserver_nginx_dir }}"
local_file_path: "{{ local_snapshotcloneserver_nginx_package_path }}/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
when: not install_with_deb | bool
include_tasks: copy_file_to_remote.yml

View File

@ -15,47 +15,46 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install package via tar
block:
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libuuid
vars:
apt_lib_name: libuuid1
yum_lib_name: libuuid
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libuuid-dev
vars:
apt_lib_name: uuid-dev
yum_lib_name: libuuid-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install daemon
include_tasks: install_daemon.yml
- name: install snapshotcloneserver bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_snapshotcloneserver_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install snapshotcloneserver lib
vars:
remote_dir_name: "{{ curve_lib_dir}}"
local_file_path: "{{ local_snapshotcloneserver_package_path }}/lib/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
when: not install_with_deb | bool
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libuuid
vars:
apt_lib_name: libuuid1
yum_lib_name: libuuid
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libuuid-dev
vars:
apt_lib_name: uuid-dev
yum_lib_name: libuuid-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install daemon
include_tasks: install_daemon.yml
- name: install snapshotcloneserver bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_snapshotcloneserver_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install snapshotcloneserver lib
vars:
remote_dir_name: "{{ curve_lib_dir}}"
local_file_path: "{{ local_snapshotcloneserver_package_path }}/lib/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: generate snapshot-daemon.sh
template: src=snapshot-daemon.sh.j2 dest={{ deploy_dir }}/snapshot-daemon.sh mode=0755
template: src=snapshot-daemon.sh.j2 dest={{ deploy_dir }}/snapshot-daemon.sh mode=0755

View File

@ -15,23 +15,18 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: install tool bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_tool_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install package via tar
block:
- name: install tool bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_tool_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: pip install requests
ignore_errors: true
shell: sudo pip install requests
register: pip_requests_res
- name: pip2 install requests
shell: sudo pip2 install requests
when: pip_requests_res.failed
when: not install_with_deb | bool
- name: pip install requests
ignore_errors: true
shell: sudo pip install requests
register: pip_requests_res
- name: pip2 install requests
shell: sudo pip2 install requests
when: pip_requests_res.failed

View File

@ -1,19 +0,0 @@
---
#
# Copyright (c) 2021 NetEase Inc.
#
# Licensed 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.
#
- name: generate etcd-daemon.sh
template: src=etcd-daemon.sh.j2 dest={{ deploy_dir }}/etcd-daemon.sh mode=0755

View File

@ -15,93 +15,92 @@
# limitations under the License.
#
- name: install package via deb
include_tasks: "install_deb_package.yml"
when: install_with_deb | bool
- name: install libunwind
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install package via tar
- name: install libunwind-dev
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install bzip2
vars:
apt_lib_name: bzip2
yum_lib_name: bzip2
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install jemalloc
vars:
lib_name: jemalloc
download_url: "{{ jemalloc_download_url }}"
include_tasks: install_jemalloc.yml
- name: install daemon
include_tasks: install_daemon.yml
- name: prepare date dir
vars:
dir_name: "{{ nebd_data_dir }}"
include_tasks: common_tasks/create_dir.yml
- name: prepare log dir
vars:
dir_name: "{{ nebd_log_dir }}/{{ item }}"
include_tasks: common_tasks/create_dir.yml
with_items:
- client
- server
- name: prepare lock dir
vars:
dir_name: "{{ nebd_data_dir }}/lock"
include_tasks: common_tasks/create_dir.yml
- name: install nebd bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_nebd_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install nebd lib
vars:
remote_dir_name: "{{ curve_lib_dir }}/nebd"
local_file_path: "{{ local_nebd_package_path }}/lib/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: generate nebd-daemon
vars:
jemalloc_path: "{{ lib_install_prefix }}/lib/libjemalloc.so.1"
local_action: template src=nebd-daemon.j2 dest=/tmp/nebd-daemon mode=0755
- name: copy nebd-daemon
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "/tmp/nebd-daemon"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: add nebd auto start at boot
block:
- name: install libunwind
- name: get distro name
vars:
apt_lib_name: libunwind8
yum_lib_name: libunwind
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install libunwind-dev
distro:
include_tasks: common_tasks/get_distro_name.yml
- name: copy nebd-daemon to init.d
vars:
apt_lib_name: libunwind8-dev
yum_lib_name: libunwind-devel
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install bzip2
vars:
apt_lib_name: bzip2
yum_lib_name: bzip2
include_tasks: common_tasks/install_with_yum_apt.yml
- name: install jemalloc
vars:
lib_name: jemalloc
download_url: "{{ jemalloc_download_url }}"
include_tasks: install_jemalloc.yml
- name: install daemon
include_tasks: install_daemon.yml
- name: prepare date dir
vars:
dir_name: "{{ nebd_data_dir }}"
include_tasks: common_tasks/create_dir.yml
- name: prepare log dir
vars:
dir_name: "{{ nebd_log_dir }}/{{ item }}"
include_tasks: common_tasks/create_dir.yml
with_items:
- client
- server
- name: prepare lock dir
vars:
dir_name: "{{ nebd_data_dir }}/lock"
include_tasks: common_tasks/create_dir.yml
- name: install nebd bin
vars:
remote_dir_name: "{{ curve_bin_dir }}"
local_file_path: "{{ local_nebd_package_path }}/bin/"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: install nebd include
vars:
remote_dir_name: "{{ curve_include_dir }}"
local_file_path: "{{ local_nebd_package_path }}/include/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: install nebd lib
vars:
remote_dir_name: "{{ curve_lib_dir }}"
local_file_path: "{{ local_nebd_package_path }}/lib/"
file_mode: 0644
include_tasks: copy_file_to_remote.yml
- name: generate nebd-daemon
vars:
jemalloc_path: "{{ lib_install_prefix }}/lib/libjemalloc.so.1"
local_action: template src=nebd-daemon.j2 dest=/tmp/nebd-daemon mode=0755
- name: copy nebd-daemon
vars:
remote_dir_name: "{{ curve_bin_dir }}"
remote_dir_name: "/etc/init.d"
local_file_path: "/tmp/nebd-daemon"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: add nebd auto start at boot
block:
- name: get distro name
vars:
distro:
include_tasks: common_tasks/get_distro_name.yml
- name: copy nebd-daemon to init.d
vars:
remote_dir_name: "/etc/init.d"
local_file_path: "/tmp/nebd-daemon"
file_mode: 0755
include_tasks: copy_file_to_remote.yml
- name: enable on debain ubuntu
shell: sudo update-rc.d nebd-daemon defaults
when: "'Ubuntu' in distro or 'Debian' in distro"
- name: enable on centos
shell: sudo chkconfig --add nebd-daemon && sudo chkconfig nebd-daemon on
when: "'CentOS' in distro"
when: not install_with_deb | bool
- name: enable on debain ubuntu
shell: sudo update-rc.d nebd-daemon defaults
when: "'Ubuntu' in distro or 'Debian' in distro"
- name: enable on centos
shell: sudo chkconfig --add nebd-daemon && sudo chkconfig nebd-daemon on
when: "'CentOS' in distro"

View File

@ -18,5 +18,10 @@
- name: set curve_lib_dir
include_tasks: "include/set_curve_lib_dir.yml"
- name: install package
- name: install package with deb
include_tasks: "include/install_deb_package.yml"
when: install_with_deb | bool
- name: install package without deb
include_tasks: "include/install_{{ package_name }}.yml"
when: not install_with_deb | bool

View File

@ -3,7 +3,6 @@
# default config path
confPath={{ chunkserver_conf_path }}
dataDir={{ chunkserver_data_dir }}
raftLogProtocol={{ chunkserver_raft_log_procotol }}
source ./chunkserver_deploy.sh
# 使用方式
@ -43,17 +42,10 @@ function help() {
echo " [-nc|--noConfirm] if specified, deploy no need to confirm"
}
function ip_value() {
echo $1 | awk -F '[:/.]' '{
mask = (2 ^ 8)
printf ("%.0f", (($1 * mask + $2) * mask + $3) * mask + $4)
}'
}
# 从subnet获取ip
function get_ip_from_subnet() {
subnet=$1
prefix=$(ip_value $subnet)
prefix=`echo $subnet|awk -F/ '{print $1}'|awk -F. '{printf "%d", ($1*(2^24))+($2*(2^16))+($3*(2^8))+$4}'`
mod=`echo $subnet|awk -F/ '{print $2}'`
mask=$((2**32-2**(32-$mod)))
# 对prefix再取一次模为了支持10.182.26.50/22这种格式
@ -62,7 +54,7 @@ function get_ip_from_subnet() {
for i in `/sbin/ifconfig -a|grep inet|grep -v inet6|awk '{print $2}'|tr -d "addr:"`
do
# 把ip转换成整数
ip_int=$(ip_value $i)
ip_int=`echo $i|awk -F. '{printf "%d\n", ($1*(2^24))+($2*(2^16))+($3*(2^8))+$4}'`
if [ $(($ip_int&$mask)) -eq $prefix ]
then
ip=$i
@ -170,7 +162,7 @@ function start_one() {
-chunkServerStoreUri=local://${dataDir}/chunkserver$1/ \
-copySetUri=local://${dataDir}/chunkserver$1/copysets \
-raftSnapshotUri=curve://${dataDir}/chunkserver$1/copysets \
-raftLogUri=${raftLogProtocol}://${dataDir}/chunkserver$1/copysets \
-raftLogUri=local://${dataDir}/chunkserver$1/copysets \
-recycleUri=local://${dataDir}/chunkserver$1/recycler \
-raft_sync_segments=true \
-graceful_quit_on_sigterm=true \
@ -298,26 +290,19 @@ function deploy() {
return 1
fi
if [[ "$1" = "all" && $# -gt 1 ]]
then
do_confirm_if_need $2
fi
if [ "$1" = "all" ]
then
if [ $# -gt 1 ]
then
do_confirm_if_need $2
else
do_confirm
fi
deploy_all
deploy_all;
return $?
fi
if [ $# -ge 2 ]
then
if [ $# -gt 2 ]
then
do_confirm_if_need $3
else
do_confirm
fi
deploy_one $@;
return $?
fi
@ -341,21 +326,19 @@ function deploy-wal-pool() {
return 1
fi
if [ $# -gt 1 ]
if [[ "$1" = "all" && $# -gt 1 ]]
then
do_confirm_if_need $2
else
do_confirm
fi
if [ "$1" = "all" ]
then
walfile_pool_prep
walfile_pool_prep;
return $?
else
deploy_one_walfile_pool $1
wait
fi
deploy_one_walfile_pool $1
wait
}

View File

@ -14,7 +14,7 @@ function do_confirm {
fi
}
{% if not auto_get_disk_list | bool %}
{% if not auto_get_disk_list %}
{% set dlist=[] -%}
{% for disk in disk_list -%}
{% set _ = dlist.append("%s" % (disk)) -%}
@ -164,10 +164,10 @@ ret=`lsblk|grep chunkserver|wc -l`
for i in `seq 0 $((${ret}-1))`
do
curve-format -allocatePercent={{ chunk_alloc_percent }} \
-filePoolDir=$dataDir/chunkserver$i/chunkfilepool \
-filePoolMetaPath=$dataDir/chunkserver$i/chunkfilepool.meta \
-filePoolDir=/data/chunkserver$i/chunkfilepool \
-filePoolMetaPath=/data/chunkserver$i/chunkfilepool.meta \
-fileSize={{ chunk_size }} \
-fileSystemPath=$dataDir/chunkserver$i/chunkfilepool &
-fileSystemPath=/data/chunkserver$i/chunkfilepool &
done
wait
}
@ -182,10 +182,10 @@ function release_disk_reserved_space {
function deploy_one_walfile_pool {
curve-format -allocatePercent={{ wal_segment_alloc_percent }} \
-filePoolDir=$dataDir/chunkserver$1/walfilepool \
-filePoolMetaPath=$dataDir/chunkserver$1/walfilepool.meta \
-filePoolDir=/data/chunkserver$1/walfilepool \
-filePoolMetaPath=/data/chunkserver$1/walfilepool.meta \
-fileSize={{ chunkserver_walfilepool_segment_size }} \
-fileSystemPath=$dataDir/chunkserver$1/walfilepool &
-fileSystemPath=/data/chunkserver$1/walfilepool &
}

View File

@ -3,7 +3,7 @@
#sh update_dashboard.sh
#echo "update dashboards success!"
WORKDIR=/etc/curvefs/monitor
WORKDIR={{ monitor_work_dir }}
if [ ! -d $WORKDIR ]; then
echo "${WORKDIR} not exists"
@ -19,6 +19,9 @@ start() {
echo "" > monitor.log
stdbuf -oL python target_json.py >> monitor.log 2>&1 &
echo "start prometheus targets service success!"
docker-compose up >> monitor.log 2>&1 &
echo "start metric system success!"
}

Some files were not shown because too many files have changed in this diff Show More