From c1444429ba91539d22ba7ed0775717a1677c4493 Mon Sep 17 00:00:00 2001 From: Privacy Sandbox Team Date: Thu, 9 May 2024 21:46:44 -0400 Subject: [PATCH] Release 0.61.1 (2024-05-10) ### Bug Fixes * Add docker flags to container name * Set 8h ttl for long-running build container Bug: b/339407401 Change-Id: I38982ffa8b52b80dc7345943c55d8baf4e38fa76 GitOrigin-RevId: 6a2302b87cd3a4b747d4de1beefb6a777cf82ec2 --- CHANGELOG.md | 8 ++++++++ tools/cbuild | 30 +++++++++++++++++++----------- version.txt | 2 +- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8e7fa6..ae4074d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## 0.61.1 (2024-05-10) + + +### Bug Fixes + +* Add docker flags to container name +* Set 8h ttl for long-running build container + ## 0.61.0 (2024-05-08) diff --git a/tools/cbuild b/tools/cbuild index 20bec2f..17da133 100755 --- a/tools/cbuild +++ b/tools/cbuild @@ -78,6 +78,7 @@ declare -i WITH_CMD_PROFILER=0 DOCKER_NETWORK="${DOCKER_NETWORK:-bridge}" declare -i DOCKER_SECCOMP_UNCONFINED=0 declare -i KEEP_CONTAINER_RUNNING=0 +declare LONG_RUNNING_CONTAINER_TIMEOUT=8h while [[ $# -gt 0 ]]; do case "$1" in @@ -138,12 +139,6 @@ if ! [[ " ${IMAGE_LIST[*]} " =~ " ${IMAGE} " ]]; then usage 1 fi -function get_container_name() { - local -r mount="$(echo "${WORKSPACE_MOUNT}" | sha256sum)" - local -r image_sha="${IMAGE_TAGGED##*-}" - printf "cbuild-%s-%s" "${mount:0:7}" "${image_sha:0:7}" -} - TOOLS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" readonly TOOLS_DIR # shellcheck disable=SC1090 @@ -181,9 +176,6 @@ if [[ ${PWD_WORKSPACE_REL_PATH:0:1} != / ]]; then fi readonly WORKDIR -DOCKER_CONTAINER_NAME="$(get_container_name)" -readonly DOCKER_CONTAINER_NAME - # DOCKER_EXEC_RUN_ARGS applies to both `docker run` and `docker exec` declare -a DOCKER_EXEC_RUN_ARGS=( "--workdir=${WORKDIR}" @@ -191,7 +183,6 @@ declare -a DOCKER_EXEC_RUN_ARGS=( declare -a DOCKER_RUN_ARGS=( "--rm" "--entrypoint=/bin/bash" - "--name=${DOCKER_CONTAINER_NAME}" "--volume=${WORKSPACE_MOUNT}:/src/workspace" "--network=${DOCKER_NETWORK}" "$(echo "${EXTRA_DOCKER_RUN_ARGS}" | envsubst)" @@ -236,6 +227,23 @@ if [[ -t 0 ]] && [[ -t 1 ]]; then ) fi +function get_container_name() { + local -r mount="$(echo "${WORKSPACE_MOUNT}" | sha256sum)" + local -r image_sha="${IMAGE_TAGGED##*-}" + local -r docker_args_sha="$({ +cat </dev/null) # wait for pid, even if it's not a child process of this shell -tail --pid=\${pid} -f /dev/null +timeout ${LONG_RUNNING_CONTAINER_TIMEOUT} tail --pid=\${pid} -f /dev/null " &>/dev/null fi fi diff --git a/version.txt b/version.txt index 821e2d6..317b248 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.61.0 \ No newline at end of file +0.61.1 \ No newline at end of file