Skip to content

Commit

Permalink
Merge pull request #107 from privacysandbox/release-0.74.0
Browse files Browse the repository at this point in the history
Release 0.74.0
  • Loading branch information
pmeric authored Nov 21, 2024
2 parents 00e5172 + 4dde593 commit e5e3aa2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.74.0 (2024-11-21)


### Features

* Add cbuild flag --one-time to create a new container
* Print message when reusing a cbuild container

## 0.73.0 (2024-10-31)


Expand Down
16 changes: 11 additions & 5 deletions tools/cbuild
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ USAGE

cat &>/dev/stderr << USAGE
--env <key>[=<value>] Name (or name=value) of exported environment variable, propagated into container
--one-time Create a new container, avoid container reuse
--without-shared-cache Containers will not mount ${HOME}/.cache/bazel
--without-embedded-docker Disable docker client within container
--docker-network <value> Specify docker network type or name, value passed to docker run --network. Default: ${DOCKER_NETWORK}
Expand Down Expand Up @@ -81,6 +82,7 @@ declare -i WITH_DOCKER_SOCK=1
declare -i WITH_CMD_PROFILER=0
DOCKER_NETWORK="${DOCKER_NETWORK:-bridge}"
declare -i DOCKER_SECCOMP_UNCONFINED=0
declare -i ONE_TIME_CONTAINER=0
declare -i KEEP_CONTAINER_RUNNING=0
declare LONG_RUNNING_CONTAINER_TIMEOUT=8h
declare CPU_PROFILER_FILENAME=benchmark.prof
Expand All @@ -92,6 +94,10 @@ while [[ $# -gt 0 ]]; do
CMD="$2"
shift 2 || usage
;;
--one-time)
ONE_TIME_CONTAINER=1
shift
;;
--cmd-profiler)
WITH_CMD_PROFILER=1
shift
Expand All @@ -110,9 +116,6 @@ while [[ $# -gt 0 ]]; do
;;
--image)
IMAGE="$2"
if [[ ${IMAGE} =~ ^build-* ]]; then
KEEP_CONTAINER_RUNNING=1
fi
shift 2 || usage
;;
--without-shared-cache)
Expand Down Expand Up @@ -147,6 +150,9 @@ if [[ -z ${IMAGE} ]]; then
printf -- "error: --image must be specified\n" &>/dev/stderr
usage 1
fi
if [[ ${ONE_TIME_CONTAINER} -eq 0 ]] && [[ ${IMAGE} =~ ^build-* ]]; then
KEEP_CONTAINER_RUNNING=1
fi
# shellcheck disable=SC2076
if ! [[ " ${IMAGE_LIST[*]} " =~ " ${IMAGE} " ]]; then
printf -- "error: image [%s] not recognized\n" "${IMAGE}" &>/dev/stderr
Expand Down Expand Up @@ -257,8 +263,6 @@ EOF
DOCKER_CONTAINER_NAME="$(get_container_name)"
readonly DOCKER_CONTAINER_NAME

DOCKER_RUN_ARGS+=("--name=${DOCKER_CONTAINER_NAME}")

if [[ ${VERBOSE} -eq 1 ]]; then
set -o xtrace
fi
Expand Down Expand Up @@ -302,6 +306,7 @@ timeout ${LONG_RUNNING_CONTAINER_TIMEOUT} tail --pid=\${pid} -f /dev/null
}

if [[ ${KEEP_CONTAINER_RUNNING} -eq 1 ]]; then
DOCKER_RUN_ARGS+=("--name=${DOCKER_CONTAINER_NAME}")
if [[ -z ${CMD} ]]; then
# shellcheck disable=SC2068
docker run \
Expand All @@ -310,6 +315,7 @@ if [[ ${KEEP_CONTAINER_RUNNING} -eq 1 ]]; then
"${IMAGE_TAGGED}"
else
DOCKER_RUNNING_CONTAINER="$(long_running_container "${DOCKER_CONTAINER_NAME}")"
printf "reusing container [%s]\n" "${DOCKER_RUNNING_CONTAINER}" &>/dev/stderr
if [[ ${WITH_CMD_PROFILER} -eq 1 ]]; then
docker exec \
"${DOCKER_EXEC_RUN_ARGS[@]}" \
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.73.0
0.74.0

0 comments on commit e5e3aa2

Please sign in to comment.