-
Notifications
You must be signed in to change notification settings - Fork 487
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
build: deprecate mk-deb.sh mk-tar.sh and use make targets instead #2644
Conversation
cicheck |
1 similar comment
cicheck |
There is a problem with mk-tar now, you can fix it: Line 227 in 4a0372b
The cause is this: In a certain change, the code for compiling the entire project was changed to the following: Line 175 in 4a0372b
But compiling curvefs_python is directly using bazel. Lines 108 to 119 in 4a0372b
The inconsistency of the compilation parameters caused bazel-bin to establish a new soft link. There is no corresponding binary file under the new soft link. |
@charlie0129 continue? |
Yes, I am going to fix that. The build script changed to use docker builder instead before I was able to make changes so I am adapting my script to use the new method. |
Hi @Cyber-SiKu How can I build |
@charlie0129 You can see how the script does it. |
@Cyber-SiKu Most build procedure is now done. But one problem, I was only able to compile PS: The old build command (using bazel directly) is not working in the new docker build container. The error is:
|
This is related to the gcc version, please add --config=gcc7-later when compiling bazel |
cicheck |
Hi, @Cyber-SiKu the script now works fine for me. What do you think? Is there any problems? |
good job! |
Please add some output, how to compile, and screenshots of successful compilation. |
cicheck |
How to compile:
Screenshots: |
@@ -27,7 +38,7 @@ intall-go: | |||
|
|||
install-etcdclient: | |||
mkdir -p $(pwd)/tmp/gosrc/src/go.etcd.io | |||
cd $(pwd)/tmp/gosrc/src/go.etcd.io && git clone --branch v3.4.0 https://gitee.com/mirrors/etcd | |||
cd $(pwd)/tmp/gosrc/src/go.etcd.io && git clone --branch v3.4.0 --depth=1 https://gitee.com/mirrors/etcd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does --depth=1
do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will only clone the most recent commit, rather than the entire history. Since we will certainly not use the commit history when we are building etcd, ignoring the commit history will make it faster to clone.
util/build.sh
Outdated
-w /curve \ | ||
--user $(id -u ${USER}):$(id -g ${USER}) \ | ||
-v $(pwd):/curve \ | ||
-v ${HOME}:${HOME} \ | ||
-v /etc/passwd:/etc/passwd:ro \ | ||
-v /etc/group:/etc/group:ro \ | ||
-v /etc/shadow:/etc/shadow:ro \ | ||
-e BUILD_OPTS="${BUILD_OPTS}" \ | ||
--privileged \ | ||
opencurvedocker/curve-base:build-$g_os \ | ||
bash util/build_in_image.sh "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the docker related stuff be organized and put in util/docker.sh? for reference only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course. I will add to docker.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean we just add the docker-related stuff to util/docker.sh
without calling them? Or we add and call it from other scripts?
I have assumed the latter one. After some investigation, I think I will need to edit docker.sh
to an extent that I think is too much to make it flexible enough to call in other scripts. Provided it already have some useful contents, maybe I will leave docker.sh
as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean we just add the docker-related stuff to
util/docker.sh
without calling them? Or we add and call it from other scripts?I have assumed the latter one. After some investigation, I think I will need to edit
docker.sh
to an extent that I think is too much to make it flexible enough to call in other scripts. Provided it already have some useful contents, maybe I will leavedocker.sh
as is.
the latter one.What you write now can also be used, but the latter one is more general and better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi I organized common docker-related arguments into a separate file called docker_opts.sh
. It should be easier to manage all docker things from one place now.
I only extracted common docker-related arguments, so other scripts can source them and make modifications freely. The reason why I did not use util/docker.sh
is that if I edit it to be flexible engough to be used in other scripts, I am afraid to break other things that are already using this script.
57d4810
to
e2df731
Compare
@Cyber-SiKu hi, are there any further issues on this pr? |
LGTM! |
cicheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cicheck |
1 similar comment
cicheck |
@Cyber-SiKu Is there something in my code that is causing the CI to fail? a bit confused |
cicheck |
1 similar comment
cicheck |
2d189c4
to
89959c0
Compare
2d189c4
to
fb8cd73
Compare
cicheck |
7 similar comments
cicheck |
cicheck |
cicheck |
cicheck |
cicheck |
cicheck |
cicheck |
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
fb8cd73
to
6cc3803
Compare
cicheck |
What problem does this PR solve?
Closes #2024
What is changed and how it works?
Major changes:
mk-deb.sh
andmk-tar.sh
.make
targets instead:make <deb|tar> [options]
make tar dep=1
make deb release=0 dep=0
The original version builds on the host. I have to make heavy changes to the script to adapt to the new containerized build system. Now all build process should fit in the new containerized manner, i.e., using docker build conatiner, just like
make build
.Minor changes:
etcdclient
has been improved to avoid unnecessary rebuilds and clones. It should be faster when building depencencies after the first time.only
likemake xxx only=src/*,tools/*
, instead of just one.util/build_in_image.sh
docker_opts.sh
util/*
executable.Side effects(Breaking backward compatibility? Performance regression?):
The build result should be the same, to the best of my knowledge. I have tested it on a bare machine.
Documents that are affected by this change has been updated.
Check List