Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

fix: docker image caching #141

Merged
merged 7 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/kokoro/docker/Dockerfile.ubuntu-install
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

ARG DISTRO_VERSION=18.04
ARG NCPU=4
FROM ubuntu:${DISTRO_VERSION}
ARG NCPU=4

RUN apt update && \
apt install -y \
Expand Down
17 changes: 13 additions & 4 deletions ci/kokoro/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,28 @@ fi
echo "================================================================"
echo "Creating Docker image with all the development tools $(date)."
echo "Logging to ${BUILD_OUTPUT}/create-build-docker-image.log"
echo " docker build " "${docker_build_flags[@]}" ci
# We do not want to print the log unless there is an error, so disable the -e
# flag. Later, we will want to print out the emulator(s) logs *only* if there
# is an error, so disabling from this point on is the right choice.
set +e
mkdir -p "${BUILD_OUTPUT}"
if timeout 3600s docker build "${docker_build_flags[@]}" ci \
>"${BUILD_OUTPUT}/create-build-docker-image.log" 2>&1 </dev/null; then
update_cache="true"
fi
if [[ "$?" != 0 ]]; then
>"${BUILD_OUTPUT}/create-build-docker-image.log" 2>&1 </dev/null; then
update_cache="true"
echo "Docker image successfully rebuilt"
else
echo "Error updating Docker image, using cached image for this build"
dump_log "${BUILD_OUTPUT}/create-build-docker-image.log"
fi

echo "================================================================"
echo "Capture Docker state after build to troubleshoot $(date)."
sudo docker version
echo "================================================================"
docker image ls
echo "================================================================"

if "${update_cache}" && [[ "${RUNNING_CI:-}" == "yes" ]] &&
[[ -z "${KOKORO_GITHUB_PULL_REQUEST_NUMBER:-}" ]]; then
echo "================================================================"
Expand Down
Binary file modified ci/test-api/google_cloud_cpp_common.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/test-api/google_cloud_cpp_grpc_utils.expected.abi.dump.gz
Binary file not shown.