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

[skipci]Merge block storage and file storage compilation scripts #2089

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

linshiyx
Copy link
Contributor

@linshiyx linshiyx commented Nov 19, 2022

What problem does this PR solve?

Issue Number: #2026

Problem Summary:

What is changed and how it works?

What's Changed:
Compile curvebs: cd curve && make build stor=bs dep=1
Compile curvefs: cd curve && make build stor=fs dep=1

How it Works:
Combine compilation scripts of curvebs with curvefs

Side effects(Breaking backward compatibility? Performance regression?):
None

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@linshiyx linshiyx changed the title Merge compilation scripts [skipci]Merge block storage and file storage compilation scripts Nov 19, 2022
@ilixiaocui
Copy link
Contributor

Please synthesize a commit for submission.

util/build.sh Outdated
get_version

if [[ "$g_stor" != "bs" && "$g_stor" != "fs" ]]; then
die "--stor must be either bs or fs\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stor=bs or stor=fs must be specify. --stor will fail.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message instructs how to use build.sh, as the usage message does. Maybe I can update the script to print usage message when stor is not properly specified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I can update the script to print usage message when stor is not properly specified.

good idea.

# 2) copy binary to project directory
# 3) generate servicectl script into project directory.
create_project_dir $project_prefix
copy_file "$binary" "$project_prefix/sbin"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If copying the file fails, for example the file does not exist, it is recomend to print an error and exit directly without continuing to execute.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is already included in create_project_dir.

Copy link
Contributor

@ilixiaocui ilixiaocui Nov 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be that I did not express clearly, here is the copy may also fail.

For example, if the user compiles and specifies only, some packages may not be compiled, and $dst/XX in copy_file may not exist.

image

@@ -226,6 +286,11 @@ install_etcd() {
create_project_dir $project_prefix
copy_file "$dst/etcd" "$project_prefix/sbin"
copy_file "$dst/etcdctl" "$project_prefix/sbin"
gen_servicectl \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. Each install_xx judges whether the execution is successful, and terminates the script if it fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is already included in gen_servicectl.

@ilixiaocui
Copy link
Contributor

Thank for you contribute @linshiyx . I played around with the new build script and it's pretty good overall. And some small improvements can make this feature become better :)

@@ -1,6 +1,7 @@
#!/usr/bin/env bash

# tmpl.sh = /usr/local/metaserver.conf /tmp/metaserver.conf
# $1: bs/fs $2: tag $3: os
function tmpl() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add set -e to terminate any command execution error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's an easier way. But I missed it and have done it referring to utils/build.sh 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok :)

Signed-off-by: linshiyx <linshiyx5@163.com>
@ilixiaocui
Copy link
Contributor

LGTM

@Cyber-SiKu Cyber-SiKu merged commit 137b54e into opencurve:master Nov 28, 2022
@SeanHai SeanHai mentioned this pull request Dec 1, 2022
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants