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

[compile] Merge block storage and file storage compilation scripts #2026

Closed
ilixiaocui opened this issue Nov 3, 2022 · 3 comments
Closed
Assignees
Labels
good first issue Good for newcomers

Comments

@ilixiaocui
Copy link
Contributor

ilixiaocui commented Nov 3, 2022

Describe the feature you'd like:

The compilation of curvebs is composed of scripts in Makefile and util directories, and the compilation of curvefs is also composed of scripts in Makefile and util directories. Two Makefiles and util directories have a lot of duplicate code.

We hope to combine these two parts,compile curvebs or curvefs through parameters, such as make bsand make fs.

Teachability, Documentation, Adoption, Migration Strategy:

Use of compiled scripts:https://github.com/opencurve/curve/blob/master/curvefs/README.md

Build compilation environment:https://github.com/opencurve/curve/blob/master/docs/cn/build_and_run.md.

@linshiyx
Copy link
Contributor

I want to solve this issue

@linshiyx
Copy link
Contributor

linshiyx commented Nov 14, 2022

准备按以下内容修改,请问是否可行或有什么建议。

预期结果:在makefile增加参数stor并传参到build.sh、install.sh和image.sh。执行时make build stor=bs dep=1make build stor=fs dep=1

修改点(基于util修改,基本是将curvefs/util中的内容补充到util中,删除curvefs/util):

build.sh

  • 新增g_stor=“bs”或"fs"
  • 新增 get_version,并在build_target中去掉get_version相关脚本
  • get_options 新增build_rocksdb
  • list_target 根据g_stor打印bs或fs的结果
  • print_title(来自YunhuiChen) 和 marker(curvefs,来自lixiaocui)选择一个
  • build_requirements 若g_stor为"fs",则根据kernel_version在g_build_opts增加IO_URING_SUPPORT并编译rocksdb
  • build_target build_mode写入"BUILD_MODE" 文件(来自YunhuiChen) 或".BUILD_MODE" 文件(来自wu-hanqing) ,选择一个
  • get_target 根据g_stor执行不同的查询。另外一个额外的修改是在bs的语句末尾加上 grep -v "^\/\/curvefs",因为编译curvebs不需要编译curvefs的目录(否则会由于curvefs依赖rocksdb而bs的build_requirements未编译rocksdb报错)
  • usage 做相应更改,提示--stor参数

install.sh

  • 新增g_stor=“bs”或"fs"
  • GLOBAL VARIABLES,增加g_curvefs_dir
  • BASIC FUNCTIONS,增加program_must_exist
  • usage,提示--g_stor参数
  • get_targets 根据g_stor执行不同逻辑
    todo servicectrl.sh
  • install_curvebs和install_curvefs共存?
  • install_etcd 增加gen_servicectl
  • main 增加get_build_mode;根据g_stor选择install_curvebs或install_curvefs

image.sh

  • 新增第一个参数,$1为"bs"或"fs"
  • 根据$1修改tmpl相关逻辑

其他

  • curvefs/util/systemctl.sh移到util/systemctl.sh
  • 删除curvefs/util/deploy.sh

@ilixiaocui
Copy link
Contributor Author

ilixiaocui commented Nov 14, 2022

准备按以下内容修改,请问是否可行或有什么建议。

预期结果:在makefile增加参数stor并传参到build.sh、install.sh和image.sh。执行时make build stor=bs dep=1make build stor=fs dep=1

修改点(基于util修改,基本是将curvefs/util中的内容补充到util中,删除curvefs/util):

build.sh

  • 新增g_stor=“bs”或"fs"
  • 新增 get_version,并在build_target中去掉get_version相关脚本
  • get_options 新增build_rocksdb
  • list_target 根据g_stor打印bs或fs的结果
  • print_title(来自YunhuiChen) 和 marker(curvefs,来自lixiaocui)选择一个
  • build_requirements 若g_stor为"fs",则根据kernel_version在g_build_opts增加IO_URING_SUPPORT并编译rocksdb
  • build_target build_mode写入"BUILD_MODE" 文件(来自YunhuiChen) 或".BUILD_MODE" 文件(来自wu-hanqing) ,选择一个
  • get_target 根据g_stor执行不同的查询。另外一个额外的修改是在bs的语句末尾加上 grep -v "^\/\/curvefs",因为编译curvebs不需要编译curvefs的目录(否则会由于curvefs依赖rocksdb而bs的build_requirements未编译rocksdb报错)
  • usage 做相应更改,提示--stor参数

install.sh

  • 新增g_stor=“bs”或"fs"
  • GLOBAL VARIABLES,增加g_curvefs_dir
  • BASIC FUNCTIONS,增加program_must_exist
  • usage,提示--g_stor参数
  • get_targets 根据g_stor执行不同逻辑
    todo servicectrl.sh
  • install_curvebs和install_curvefs共存?
  • install_etcd 增加gen_servicectl
  • main 增加get_build_mode;根据g_stor选择install_curvebs或install_curvefs

image.sh

  • 新增第一个参数,$1为"bs"或"fs"
  • 根据$1修改tmpl相关逻辑

其他

  • curvefs/util/systemctl.sh移到util/systemctl.sh
  • 删除curvefs/util/deploy.sh

整体命令

make build stor=bs dep=1 编译curvebs的源文件二进制和测试二进制
make build stor=bs dep=1 only=//*src 编译curvebs的源文件二进制(包括//src, //nbd/src, //nebd/src)
make build stor=bs dep=1 only=//*test 编译curvebs的测试二进制(包括//test, //nbd/test, //nebd/test)

make build stor=fs dep=1 编译curvefs的源文件二进制和测试二进制
make build stor=fs dep=1 only=//*src 编译curvefs的源文件二进制(包括//curvefs/src)
make build stor=fs dep=1 only=//*test 编译curvefs的源文件二进制(包括//curvefs/test)

make build stor=** dep=1 only=//**/* 编译指定target

build.sh

LGTM!

install.sh

install_curvebs和install_curvefs共存?
可以的,这样看起来也比较清晰

image.sh

LGTM!

其他

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants