-
Notifications
You must be signed in to change notification settings - Fork 433
Separate Docker image creation vs. build. #138
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
Separate Docker image creation vs. build. #138
Conversation
This is mostly to measure how long each phase takes, to guide any future optimization of the builds, such as caching. It fixes googleapis#49.
CONTRIBUTING.md
Outdated
| * `DISTRO_VERSION`: the version of the distribution, e.g. `17.04`. | ||
| * `CHECK_STYLE`: if set to `yes` the build fails if the code is different | ||
| than the output from `clang-format(1)`. | ||
| than the output from `clang-format(1)`. Notice that this reformats your |
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.
s/Notice/Note/
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.
CONTRIBUTING.md
Outdated
| * `CXX=g++ CC=gcc` to use GCC. | ||
| * `DISTRO`: the Linux distribution, use `ubuntu`, `fedora`, or `centos`. | ||
| * `DISTRO_VERSION`: the version of the distribution, e.g. `17.04`. | ||
| * `CHECK_STYLE`: if set to `yes` the build fails if the code is different |
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.
s/ the build/, the build/
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.
ci/build-docker.sh
Outdated
| mkdir -p gccpp/build-output | ||
| cd gccpp/build-output | ||
| readonly IMAGE="cached-${DISTRO}-${DISTRO_VERSION}" | ||
| mkdir -p build-output/${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.
"build-output/${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.
Done.
ci/build-docker.sh
Outdated
| cd gccpp/build-output | ||
| readonly IMAGE="cached-${DISTRO}-${DISTRO_VERSION}" | ||
| mkdir -p build-output/${IMAGE} | ||
| cd build-output/${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.
"build-output/${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.
Done.
| ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ${CMAKE_FLAGS:-} .. | ||
|
|
||
| # If scan-build is enabled we, need to manually compile the dependencies; | ||
| echo "travis_fold:start:configure-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.
Does Travis actually understand that as a directive and this is how it adds those collapsible sections?
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.
Yes, for example see:
It is sort of documented or officially not documented in travis-ci/travis-ci#2285
ci/build-docker.sh
Outdated
| # needed; otherwise, we pick errors from things we do not care about. With | ||
| # scan-build disabled we compile everything, to test the build as most | ||
| # developers will experience it. | ||
| echo ${COLOR_YELLOW}"Started build at: " $(date) ${COLOR_RESET} |
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.
And here.
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.
ci/build-docker.sh
Outdated
| else | ||
| make -j ${NCPU} all | ||
| fi | ||
| echo ${COLOR_YELLOW}"Finished build at: " $(date) ${COLOR_RESET} |
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.
And here as well.
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.
ci/build-docker.sh
Outdated
| _EOF_ | ||
| exit 1 | ||
| else | ||
| echo ${COLOR_GREEN}"scan-build completed without errors."${COLOR_RESET} |
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.
Include the vars inside the string.
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.
ci/build-docker.sh
Outdated
| run scan-build locally and examine the HTML output install and configure Docker, | ||
| then run:" | ||
| DISTRO=ubuntu DISTRO_VERSION=17.04 SCAN_BUILD=yes NCPU=8 TRAVIS_OS_NAME=linux CXX=clang++ CC=clang ./ci/build-linux.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.
Why the quote at EOL, if you are outputting all text until _EOF_?
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.
That was just a cut&paste / editing mistake.
ci/build-docker.sh
Outdated
| DISTRO=ubuntu DISTRO_VERSION=17.04 SCAN_BUILD=yes NCPU=8 TRAVIS_OS_NAME=linux CXX=clang++ CC=clang ./ci/build-linux.sh" | ||
| The HTML output will be copied into the scan-build-output subdirectory." |
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.
Why the quote at EOL, if you are outputting all text until _EOF_?
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.
Fixed.
|
PTAL. |
mbrukman
left a comment
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
The documents are generated inside a docker image, in a previous change (googleapis#138), the path for the generated docs was changed. This script should have been changed at the same time. While testing I found out that there was another tiny problem, the documents were never uploaded because the change detection was broken. Fix that too <blush>.
The documents are generated inside a docker image, in a previous change (#138), the path for the generated docs was changed. This script should have been changed at the same time. While testing I found out that there was another tiny problem, the documents were never uploaded because the change detection was broken. Fix that too <blush>.
This is mostly to measure how long each phase takes, to guide any
future optimization of the builds, such as caching. It fixes #49.