-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[DONOT MERGE]Cache thirdparty pacakge on CI system, TEST CI #9150
Conversation
Thanks for the amazing PR! TeamCity CI is very special in the sense that For example, currently Maybe this PR can be documented in the wiki, and configured in the TeamCity PR build script settings? |
paddle/scripts/teamcity/pr_build.sh
Outdated
-e "WITH_COVERAGE=ON" \ | ||
-e "COVERALLS_UPLOAD=ON" \ | ||
-e "GIT_PR_ID=${PR_ID}" \ | ||
-e "JSON_REPO_TOKEN=JSUOs6TF6fD2i30OJ5o2S55V8XWv6euen" \ |
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.
Is this token sensitive data :) ?
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.
Sure...my mistake and removed it.
Thanks for @helinwang! It's a very important reminder. And maybe we can review this PR and then close && move the script to a wiki page after approved. |
paddle/scripts/teamcity/pr_build.sh
Outdated
|
||
# Do not build dev image for now | ||
|
||
if [[ "%WITH_UBUNTU_MIRROR%" == "ON" ]]; then |
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 test if Dockerfile
is not changed, then we can skip building the image.
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.
May not, a PR job may run on any node of the CI cluster, for one PR changes the Dockerfile
and merged, the next PR run another node without changing of Dockerfile
, and it would use the older dev Docker image, we do not want this. For another side,docker build
would use the cached image Layer if Dockerfile
has no changs, would not cost too much time.
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.
Does it make sense to tag the docker image with the hash of the Dockerfile? (and remove all other tags when a PR builds)
E.g.,
docker image:
paddlepaddle/paddle:dev-000000
paddlepaddle/paddle:dev-000001
If the hash is 000001, then use paddlepaddle/paddle:dev-000001
and remove paddlepaddle/paddle:dev-000000
to free up space.
Done, it's a very good way!
paddle/scripts/teamcity/pr_build.sh
Outdated
# Use the cached thirdparty package if the MD5 is mathes. | ||
md5_content=$(cat \ | ||
${PWD}/cmake/external/*.cmake \ | ||
${PWD}/paddle/scripts/teamcity/pr_build.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.
Maybe don't need this line anymore it we don't check-in pre-build.sh
to our repo.
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.
Done.
paddle/scripts/teamcity/pr_build.sh
Outdated
|
||
# Use the cached thirdparty package if the MD5 is mathes. | ||
md5_content=$(cat \ | ||
${PWD}/cmake/external/*.cmake \ |
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.
Smart!
paddle/scripts/teamcity/pr_build.sh
Outdated
|
||
# Do not build dev image for now | ||
|
||
if [[ "%WITH_UBUNTU_MIRROR%" == "ON" ]]; then |
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.
Does it make sense to tag the docker image with the hash of the Dockerfile? (and remove all other tags when a PR builds)
E.g.,
docker image:
paddlepaddle/paddle:dev-000000
paddlepaddle/paddle:dev-000001
If the hash is 000001, then use paddlepaddle/paddle:dev-000001
and remove paddlepaddle/paddle:dev-000000
to free up space.
Done, it's a very good way!
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!!!
@@ -156,7 +156,8 @@ if(WITH_DISTRIBUTE) | |||
set_source_files_properties(recv_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) | |||
op_library(listen_and_serv_op DEPS ${DISTRIBUTE_DEPS}) | |||
set_source_files_properties(listen_and_serv_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) | |||
cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS send_op listen_and_serv_op sum_op executor) | |||
# FIXME(Yancey1989): fix unit test | |||
# cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS send_op listen_and_serv_op sum_op executor) |
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's better to separate this to another PR next time :)
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.
Okay, and I add some comments at #9046 (comment), there are still some bugs while building with WITH_DISTRIBUTE=ON.
@@ -21,6 +21,8 @@ | |||
import os, sys | |||
import time | |||
|
|||
sys.exit(0) |
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.
Maybe add a TODO here, otherwise it's possible to forget.
paddle/scripts/teamcity/pr_build.sh
Outdated
|
||
dev_image_id=$(docker images paddlepaddle/paddle-dev:${md5_dev_dockerfile} -q) | ||
if [[ ${dev_image_id} == "" ]]; then | ||
docker rmi $(docker images paddlepaddle/paddle-dev -q) || true |
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.
Smart of using paddlepaddle/paddle-dev
!
Thanks for @helinwang and @typhoonzero 's reviewing, I moved the build script to the wiki page: https://github.com/PaddlePaddle/Paddle/wiki/PaddlePaddle-CI-Build-Scripts. |
Thank you!!! |
Fixed #9046
Test task on CI: https://paddleci.ngrok.io/viewType.html?buildTypeId=Paddle_DistributedUnitTestNightly&branch_Paddle=9150&tab=buildTypeStatusDiv