Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge nebd #1

Closed
wants to merge 80 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
2702ef5
Initial empty repository
Aug 23, 2019
daac6ea
basic structure of project
Sep 20, 2019
12244d9
add part1 code
hzchenwei7 Oct 16, 2019
af10aad
create part2
wuhongsong Oct 15, 2019
6f054cc
add test files
aspirer Sep 11, 2019
580aa00
fix part1 aioRpcFailLogInterval not asign bug
hzchenwei7 Oct 22, 2019
0544df6
modify tc coredump
wuhongsong Oct 22, 2019
a2d1497
fix bug
wuhongsong Oct 23, 2019
9287d10
fix part1 part2 connect check logic
hzchenwei7 Oct 24, 2019
63a4645
fix open file lock bug
hzchenwei7 Oct 25, 2019
ce1de7f
add part1 lifecycle test code
hzchenwei7 Oct 25, 2019
6a5e533
add test_reboot_vm_with_exist_vnet
aspirer Oct 30, 2019
418ab10
close parent fd
wuhongsong Oct 30, 2019
e09d22f
fix test_reboot_vm_inside
aspirer Oct 30, 2019
b198a3a
lock file with retry
hzchenwei7 Nov 13, 2019
9a70f22
update coverage statistics
Nov 20, 2019
c34b5a4
添加代码框架
Jan 16, 2020
566f4e0
update arch
Jan 17, 2020
36f4a95
add filterbr to fix coverage branch statistics
Feb 3, 2020
b98b8d9
implement filemanager
Jan 19, 2020
2071000
implement file service
Feb 5, 2020
f25230b
implement heartbeat service
Feb 3, 2020
45c6856
implement metafilemanager
Jan 20, 2020
ba02a8c
[part2] nebdserver开发
Jan 17, 2020
6d1ef19
[part2] ioexcutor开发
Jan 20, 2020
03c31ad
nebd part1
wu-hanqing Jan 21, 2020
41af485
fix compile error
Feb 12, 2020
8acaaa0
support bazel
Feb 11, 2020
ae44c5d
refactor code
Feb 12, 2020
b1538b1
replace '/' with '+'
Feb 19, 2020
a7ed979
fix ut failed
Feb 19, 2020
0d41b70
add nebd-daemon
Feb 19, 2020
d1e3cef
[fix]初始化request executor
Feb 19, 2020
6c17227
fix aiocallback core
Feb 19, 2020
d4b76ef
fix:nebd-server init bug
Feb 19, 2020
02d8166
metafilemanager check crc
Feb 20, 2020
13978b8
fix update timestamp
Feb 20, 2020
52a1994
part1 保存日志
wu-hanqing Feb 20, 2020
dea5f70
fix qemu exit bug
wu-hanqing Feb 20, 2020
511996f
fix write caused core
Feb 21, 2020
bb76aff
fix write failed after open again
Feb 21, 2020
d53c4eb
update curve commit id
wu-hanqing Feb 21, 2020
c37d7d4
optimize nebd
Feb 22, 2020
18b5f81
add request_attachment zero copy
Feb 24, 2020
2cc80fe
update curve commit id
Feb 25, 2020
19ef804
update curve commit id
Feb 25, 2020
8d5800d
support jemalloc
Feb 26, 2020
ffb271e
调整deamon遇到错误重试次数,检测daemon运行是否遇到问题
Feb 26, 2020
f298e4e
chang metadata and log folder
wu-hanqing Feb 27, 2020
8a47f08
move library to nebd path
Feb 28, 2020
e2a71f4
update curve commit id
wu-hanqing Mar 2, 2020
e423eed
fix segv fault
wu-hanqing Mar 2, 2020
88127d8
fix inconsistent file status
Mar 2, 2020
0a25532
nebd-daemon判断root权限
wu-hanqing Mar 3, 2020
022c6db
add rpcMaxDelayHealthCheckIntervalMs
wu-hanqing Mar 3, 2020
2a34475
part2 refactor
Mar 3, 2020
a1d9084
update curve commit id
wu-hanqing Mar 9, 2020
99d11b6
fix update timestamp error
Mar 9, 2020
d170510
add daemon acceptable
Mar 10, 2020
4c4cd54
support auto run after reboot
Mar 10, 2020
45a746c
fix boot order
Mar 10, 2020
6dd1a4f
add curve version check
wu-hanqing Mar 9, 2020
b7322b3
add tcp check script
Mar 18, 2020
abff4b7
配置文件由puppet管理
wu-hanqing Mar 23, 2020
2287639
use bthread mutex
Mar 23, 2020
54a2ac5
add nebd version
Mar 23, 2020
c16099a
fix tcp check
Mar 24, 2020
83d446a
update curve tag
wu-hanqing Mar 26, 2020
ac4277b
fix tcp check script
Mar 30, 2020
4f6eb11
update curve client to v0.0.6.1
wu-hanqing Apr 15, 2020
88d3bd9
add nebd client num to metric
Apr 20, 2020
d559ffb
rm tcp auto restart
Apr 24, 2020
53bd5c0
update curve-brpc commit id
wu-hanqing Apr 30, 2020
4739be7
check nebd pid when restart
wu-hanqing Apr 13, 2020
119f849
fix: Discard & Flush run done
wu-hanqing May 7, 2020
a53f2cd
modify curve filename parser & disable error log to console
wu-hanqing Jun 9, 2020
1ddad04
Moving nebd into its own subdirectory
wu-hanqing Jul 2, 2020
30bc012
Merge remote-tracking branch 'nebd/curve-feature'
wu-hanqing Jul 2, 2020
5fbc69e
split nbd and separate nebd/nbd debian package
wu-hanqing Jul 2, 2020
a1e7624
remove common code from nebd/nbd
wu-hanqing Jul 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions curvefs_python/BUILD_bak
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ cc_library(
],
copts = COPTS,
linkopts = [
"-lbraft",
"-lcbd",
"-lcurve_client",
"-lbrpc",
Expand All @@ -54,7 +53,6 @@ cc_library(
"-lcc_brpc_internal_proto",
"-lcc_brpc_idl_options_proto",
"-lleveldb",
"-lcc_braft_internal_proto",
"-lcurve_common",
"-lcurve_auth",
"-lcurve_concurrent",
Expand All @@ -67,7 +65,6 @@ cc_library(
"-lprotobuf_lite",
"-lssl",
"-lrt",
"-lssl",
"-lcrypto",
"-ldl",
"-lz",
Expand Down
12 changes: 9 additions & 3 deletions curvefs_python/configure.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
echo "********************************************************************"
echo "***********Prepare for curvefs python API build env.****************"
echo "********************************************************************"
Expand All @@ -15,11 +15,17 @@ cp BUILD_bak BUILD -f

echo "copy libs to tmplib directory"

libs=`cat BUILD | tr -d "[:blank:]" | grep "^\"-l" | sed 's/[",]//g' | awk '{ print substr($0, 3) }'`
mkdir tmplib
for i in `find $curve_path/bazel-bin/|grep -w so|grep -v solib|grep -v params`
do
echo $i
cp -f $i ./tmplib/
basename=$(basename $i)
linkname=`echo $basename | awk -F'.' '{ print $1 }' | awk '{ print substr($0, 4) }'`
if [[ $libs =~ $linkname ]]
then
echo $i
cp -f $i ./tmplib/
fi
done

echo "Prepare env done, you can build curvefs now."
Expand Down
39 changes: 29 additions & 10 deletions mk-deb.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
dir=`pwd`
#step1 清除生成的目录和文件
bazel clean
Expand Down Expand Up @@ -43,13 +43,14 @@ if [ "$1" = "debug" ]
then
bazel build ... --copt -DHAVE_ZLIB=1 --compilation_mode=dbg -s --define=with_glog=true \
--define=libunwind=true --copt -DGFLAGS_NS=google --copt \
-Wno-error=format-security --copt -DUSE_BTHREAD_MUTEX --copt -DCURVEVERSION=${tag_version}
-Wno-error=format-security --copt -DUSE_BTHREAD_MUTEX --copt -DCURVEVERSION=${tag_version} \
--linkopt -L${dir}/thirdparties/etcdclient
if [ $? -ne 0 ]
then
echo "build phase1 failed"
exit
fi
sh ./curvefs_python/configure.sh
bash ./curvefs_python/configure.sh
if [ $? -ne 0 ]
then
echo "configure failed"
Expand All @@ -68,13 +69,14 @@ fi
else
bazel build ... --copt -DHAVE_ZLIB=1 --copt -O2 -s --define=with_glog=true \
--define=libunwind=true --copt -DGFLAGS_NS=google --copt \
-Wno-error=format-security --copt -DUSE_BTHREAD_MUTEX --copt -DCURVEVERSION=${tag_version}
-Wno-error=format-security --copt -DUSE_BTHREAD_MUTEX --copt -DCURVEVERSION=${tag_version} \
--linkopt -L${dir}/thirdparties/etcdclient
if [ $? -ne 0 ]
then
echo "build phase1 failed"
exit
fi
sh ./curvefs_python/configure.sh
bash ./curvefs_python/configure.sh
if [ $? -ne 0 ]
then
echo "configure failed"
Expand Down Expand Up @@ -303,11 +305,7 @@ if [ $? -ne 0 ]
then
exit
fi
cp ./bazel-bin/src/tools/nbd/curve-nbd build/curve-sdk/usr/bin/curve-nbd
if [ $? -ne 0 ]
then
exit
fi

#cp ./conf/client.conf build/curve-sdk/etc/curve/client.conf
#if [ $? -ne 0 ]
#then
Expand Down Expand Up @@ -380,6 +378,23 @@ then
exit
fi

# step 3.1 prepare for nebd package
cp -r nebd/nebd-package build/
mkdir -p build/nebd-package/usr/bin
mkdir -p build/nebd-package/usr/lib/nebd

for i in `find bazel-bin/|grep -w so|grep -v solib|grep -v params|grep -v test|grep -v fake`
do
cp -f $i build/nebd-package/usr/lib/nebd
done

cp bazel-bin/nebd/src/part2/nebd-server build/nebd-package/usr/bin

# step 3.2 prepare for curve-nbd package
cp -r nbd/nbd-package build
mkdir -p build/nbd-package/usr/bin
cp bazel-bin/nbd/src/curve-nbd build/nbd-package/usr/bin

#step4 获取git提交版本信息,记录到debian包的配置文件
commit_id=`git show --abbrev-commit HEAD|head -n 1|awk '{print $2}'`
if [ "$1" = "debug" ]
Expand All @@ -396,6 +411,8 @@ echo ${version} >> build/curve-tools/DEBIAN/control
echo ${version} >> build/curve-monitor/DEBIAN/control
echo ${version} >> build/curve-snapshotcloneserver/DEBIAN/control
echo ${version} >> build/curve-nginx/DEBIAN/control
echo ${version} >> build/nebd-package/DEBIAN/control
echo ${version} >> build/nbd-package/DEBIAN/control

#step5 打包debian包
dpkg-deb -b build/curve-mds .
Expand All @@ -405,6 +422,8 @@ dpkg-deb -b build/curve-tools .
dpkg-deb -b build/curve-monitor .
dpkg-deb -b build/curve-snapshotcloneserver .
dpkg-deb -b build/curve-nginx .
dpkg-deb -b build/nebd-package .
dpkg-deb -b build/nbd-package .
#aws-c-common(commit=0302570a3cbabd98293ee03971e0867f28355086)
#aws-checksums(commit=78be31b81a2b0445597e60ecb2412bc44e762a99)
#aws-c-event-stream(commit=ad9a8b2a42d6c6ef07ccf251b5038b89487eacb3)
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions nbd/nbd-package/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Package: curve-nbd
Section:
Priority: optional
Depends: libunwind8
Suggests:
Architecture: amd64
Installed-Size:
Maintainer: curve-dev
Provides:
Description: NBD-based client for curve
34 changes: 2 additions & 32 deletions src/tools/nbd/BUILD → nbd/src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,10 @@ cc_library(
deps = [
"//external:gflags",
"//external:glog",
"//nebd/src/part1:nebdclient",
],
copts = COPTS,
linkopts = [
"-L/usr/lib/nebd",
"-lnebdclient",
"-lclient_proto",
"-lnebd_common",
"-lbrpc",
"-lcc_brpc_idl_options_proto",
"-lcc_brpc_internal_proto",
"-lbthread",
"-lbvar",
"-ljson2pb",
"-lmcpack2pb",
"-lbutil",
"-lprotoc_lib",
"-lleveldb",
"-lprotobuf",
"-lprotobuf_lite",
"-lssl",
"-lrt",
"-lssl",
"-lcrypto",
"-ldl",
"-lz",
"-lpthread",
"-lunwind",
"-lstdc++",
"-lm",
"-lnl-3",
"-lnl-genl-3",
],
Expand All @@ -70,12 +45,7 @@ cc_binary(
]
),
deps = [
"//src/tools/nbd:curvenbd"
"//nbd/src:curvenbd"
],
copts = COPTS,
linkopts = [
"-Wl,-rpath=/usr/lib/nebd"
],
)


Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) 2020 Netease
*/

#include "src/tools/nbd/ImageInstance.h"
#include "nbd/src/ImageInstance.h"
#include <glog/logging.h>

namespace curve {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/nbd/ImageInstance.h → nbd/src/ImageInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <string>
#include <memory>
#include "src/tools/nbd/libnebd.h"
#include "nebd/src/part1/libnebd.h"

namespace curve {
namespace nbd {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) 2020 netease
*/

#include "src/tools/nbd/NBDController.h"
#include "nbd/src/NBDController.h"

namespace curve {
namespace nbd {
Expand Down
6 changes: 3 additions & 3 deletions src/tools/nbd/NBDController.h → nbd/src/NBDController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#include <string>
#include <memory>

#include "src/tools/nbd/nbd-netlink.h"
#include "src/tools/nbd/define.h"
#include "src/tools/nbd/util.h"
#include "nbd/src/nbd-netlink.h"
#include "nbd/src/define.h"
#include "nbd/src/util.h"

namespace curve {
namespace nbd {
Expand Down
4 changes: 2 additions & 2 deletions src/tools/nbd/NBDServer.cpp → nbd/src/NBDServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* Copyright (c) 2020 Netease
*/

#include "src/tools/nbd/NBDServer.h"
#include "nbd/src/NBDServer.h"

#include <signal.h>
#include <glog/logging.h>
#include <inttypes.h>
#include <netinet/in.h>

#include "src/tools/nbd/util.h"
#include "nbd/src/util.h"

namespace curve {
namespace nbd {
Expand Down
8 changes: 4 additions & 4 deletions src/tools/nbd/NBDServer.h → nbd/src/NBDServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include <string>
#include <thread> // NOLINT

#include "src/tools/nbd/ImageInstance.h"
#include "src/tools/nbd/NBDController.h"
#include "src/tools/nbd/SafeIO.h"
#include "src/tools/nbd/libnebd.h"
#include "nbd/src/ImageInstance.h"
#include "nbd/src/NBDController.h"
#include "nbd/src/SafeIO.h"
#include "nebd/src/part1/libnebd.h"

namespace curve {
namespace nbd {
Expand Down
6 changes: 3 additions & 3 deletions src/tools/nbd/NBDTool.cpp → nbd/src/NBDTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <limits.h>
#include <memory>
#include <string>
#include "src/tools/nbd/NBDTool.h"
#include "src/tools/nbd/argparse.h"
#include "src/tools/nbd/texttable.h"
#include "nbd/src/NBDTool.h"
#include "nbd/src/argparse.h"
#include "nbd/src/texttable.h"

namespace curve {
namespace nbd {
Expand Down
10 changes: 5 additions & 5 deletions src/tools/nbd/NBDTool.h → nbd/src/NBDTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#include <vector>
#include <string>
#include <memory>
#include "src/tools/nbd/define.h"
#include "src/tools/nbd/NBDController.h"
#include "src/tools/nbd/NBDServer.h"
#include "src/tools/nbd/ImageInstance.h"
#include "src/tools/nbd/NBDWatchContext.h"
#include "nbd/src/define.h"
#include "nbd/src/NBDController.h"
#include "nbd/src/NBDServer.h"
#include "nbd/src/ImageInstance.h"
#include "nbd/src/NBDWatchContext.h"

namespace curve {
namespace nbd {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) 2020 NetEase
*/

#include "src/tools/nbd/NBDWatchContext.h"
#include "nbd/src/NBDWatchContext.h"
#include <glog/logging.h>

namespace curve {
Expand Down
8 changes: 4 additions & 4 deletions src/tools/nbd/NBDWatchContext.h → nbd/src/NBDWatchContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <atomic>
#include <thread> // NOLINT
#include <memory>
#include "src/tools/nbd/ImageInstance.h"
#include "src/tools/nbd/NBDController.h"
#include "src/tools/nbd/interruptible_sleeper.h"
#include "nbd/src/ImageInstance.h"
#include "nbd/src/NBDController.h"
#include "src/common/interruptible_sleeper.h"

namespace curve {
namespace nbd {
Expand Down Expand Up @@ -62,7 +62,7 @@ class NBDWatchContext {
// 任务线程
std::thread watchThread_;

InterruptibleSleeper sleeper_;
curve::common::InterruptibleSleeper sleeper_;
};

} // namespace nbd
Expand Down
4 changes: 2 additions & 2 deletions src/tools/nbd/SafeIO.cpp → nbd/src/SafeIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* Copyright (c) 2020 Netease
*/

#include "src/tools/nbd/SafeIO.h"
#include "nbd/src/SafeIO.h"
#include <cerrno>

#include "src/tools/nbd/util.h"
#include "nbd/src/util.h"

namespace curve {
namespace nbd {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/tools/nbd/argparse.cpp → nbd/src/argparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <sstream>
#include <iostream>

#include "src/tools/nbd/argparse.h"
#include "nbd/src/argparse.h"

namespace curve {
namespace nbd {
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions src/tools/nbd/main.cpp → nbd/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#include <iostream>
#include <string>

#include "src/tools/nbd/ImageInstance.h"
#include "src/tools/nbd/NBDController.h"
#include "src/tools/nbd/NBDServer.h"
#include "src/tools/nbd/NBDTool.h"
#include "src/tools/nbd/NBDWatchContext.h"
#include "src/tools/nbd/argparse.h"
#include "src/tools/nbd/define.h"
#include "src/tools/nbd/util.h"
#include "nbd/src/ImageInstance.h"
#include "nbd/src/NBDController.h"
#include "nbd/src/NBDServer.h"
#include "nbd/src/NBDTool.h"
#include "nbd/src/NBDWatchContext.h"
#include "nbd/src/argparse.h"
#include "nbd/src/define.h"
#include "nbd/src/util.h"

namespace curve {
namespace nbd {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/tools/nbd/texttable.cpp → nbd/src/texttable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Foundation. See file COPYING.
*
*/
#include "src/tools/nbd/texttable.h"
#include "nbd/src/texttable.h"

namespace curve {
namespace nbd {
Expand Down
File renamed without changes.
Loading