Skip to content

Commit

Permalink
Release 0.5.1
Browse files Browse the repository at this point in the history
### Bug Fixes

* Ignore builders/ when executing pre-commit
* Upgrade to build-system 0.5.0

Bug: NA
Change-Id: I2ab8d740f2ee3942d63b4c9423cf15c587323ca9
GitOrigin-RevId: 131e4d75da35458749b7a0f67eb7465678b9c111
  • Loading branch information
Privacy Sandbox Team authored and lusayaa committed Dec 8, 2022
1 parent a79d0b3 commit 0afc373
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 36 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ exclude: (?x)^(
bazel-(bin|out|testlogs|workspace)/.*|
google_internal/coordinator_environments/.*$|
.bazel_output/.*|
builders/.*|
version.txt
)$

Expand Down
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.5.1](https://github.com/privacysandbox/fledge-key-value-service/compare/release-0.5.0...release-0.5.1) (2022-12-08)


### Bug Fixes

* Ignore builders/ when executing pre-commit
* Upgrade to build-system 0.5.0

## [0.5.0](https://github.com/privacysandbox/fledge-key-value-service/compare/release-0.4.0...release-0.5.0) (2022-11-28)


Expand Down
4 changes: 1 addition & 3 deletions builders/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: (?x)^(
bazel-(bin|out|testlogs|workspace)/.*|
.bazel_output/.*|
version.txt
)$

Expand Down Expand Up @@ -48,7 +46,7 @@ repos:
- id: script-must-have-extension
- id: require-ascii
- id: shellcheck
exclude: '^(production|tools|google_internal|builders/images)/.*$'
exclude: '^(tools|google_internal|images)/.*$'

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
Expand Down
14 changes: 14 additions & 0 deletions builders/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

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.5.0](https://team/kiwi-air-force-eng-team/build-system/compare/release-0.4.4...release-0.5.0) (2022-12-06)


### Features

* Pin versions in presubmit image


### Bug Fixes

* Avoid cache for tar image
* Update version pin for ca-certificates
* Use images subdirs for image list

### [0.4.4](https://team/kiwi-air-force-eng-team/build-system/compare/release-0.4.3...release-0.4.4) (2022-11-18)


Expand Down
2 changes: 1 addition & 1 deletion builders/images/build-debian/install_apps
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function apt_update() {
function install_misc() {
DEBIAN_FRONTEND=noninteractive apt-get --quiet install -y --no-install-recommends \
apt-transport-https="2.0.9" \
ca-certificates="20211016~20.04.1" \
ca-certificates="20211016ubuntu0.20.04.1" \
curl="7.68.0-1ubuntu2.14" \
gettext="0.19.8.1-10build1" \
git="1:2.25.1-1ubuntu3.6" \
Expand Down
18 changes: 9 additions & 9 deletions builders/images/presubmit/install_apps
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ function apt_update() {

function install_packages() {
DEBIAN_FRONTEND=noninteractive apt-get --quiet install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
openjdk-11-jre \
apt-transport-https="2.0.9" \
ca-certificates="20211016ubuntu0.20.04.1" \
curl="7.68.0-1ubuntu2.14" \
gnupg="2.2.19-3ubuntu2.2" \
lsb-release="11.1.0ubuntu2" \
openjdk-11-jre="11.0.17+8-1ubuntu2~20.04" \
python3.9-venv="3.9.5-3ubuntu0~20.04.1" \
shellcheck \
software-properties-common \
wget
shellcheck="0.7.0-2build2" \
software-properties-common="0.99.9.8" \
wget="1.20.3-1ubuntu2"
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 100
}

Expand Down
50 changes: 29 additions & 21 deletions builders/tools/get-builder-image-tagged
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,20 @@ function _cleanup() {
exit ${STATUS}
}

declare -r -A IMAGE_NAMES=(
[build-debian]="privacysandbox/builders/build-debian"
[build-amazonlinux2]="privacysandbox/builders/build-amazonlinux2"
[presubmit]="privacysandbox/builders/presubmit"
[release]="privacysandbox/builders/release"
[utils]="privacysandbox/builders/utils"
)
function get_image_list() {
declare -r _images_dir="$1"
find "${_images_dir}" -maxdepth 1 -mindepth 1 -type d -printf "%P\n" | sort
}

function get_image_fullname() {
declare -r _img="$1"
declare -r _image_name=privacysandbox/builders/${_img}
if [[ -z ${_image_name} ]]; then
printf -- "error: image [%s] not recognized\n" "${_img}" &>/dev/stderr
return 1
fi
printf "%s" "${_image_name}"
}

function usage() {
declare -r -i exitval=${1-1}
Expand All @@ -55,7 +62,7 @@ usage:
--image Image name for the build runtime. Valid names:
USAGE

for elem in "${!IMAGE_NAMES[@]}"
for elem in $(get_image_list "${IMAGES_DIR}")
do
if [[ ${IMAGE} == "${elem}" ]]; then
local EXTRA=" (default)"
Expand All @@ -70,6 +77,15 @@ USAGE
exit ${exitval}
}

TOOLS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
readonly TOOLS_DIR
readonly ETC_DIR="${TOOLS_DIR}"/../etc
readonly IMAGES_DIR="${TOOLS_DIR}"/../images
# shellcheck disable=SC1091
source "${TOOLS_DIR}"/builder.sh
WORKSPACE_MOUNT="$(builder::get_docker_workspace_mount)"
readonly WORKSPACE_MOUNT

while [[ $# -gt 0 ]]; do
case "$1" in
--image)
Expand All @@ -94,25 +110,15 @@ while [[ $# -gt 0 ]]; do
esac
done

TOOLS_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
readonly TOOLS_DIR
readonly ETC_DIR="${TOOLS_DIR}"/../etc
readonly IMAGES_DIR="${TOOLS_DIR}"/../images
# shellcheck disable=SC1091
source "${TOOLS_DIR}"/builder.sh
WORKSPACE_MOUNT="$(builder::get_docker_workspace_mount)"
readonly WORKSPACE_MOUNT

if [[ -z ${IMG} ]]; then
printf -- "error: --image must be specified\n" &>/dev/stderr
usage 1
fi

readonly IMAGE_NAME=${IMAGE_NAMES[${IMG}]}
if [[ -z ${IMAGE_NAME} ]]; then
printf -- "error: image [%s] not recognized\n" "${IMG}" &>/dev/stderr
if ! IMAGE_NAME="$(get_image_fullname "${IMG}")"; then
usage 1
fi
readonly IMAGE_NAME

IMAGE_PATH_FULL="${IMAGES_DIR}/${IMG}"
if ! [[ -s ${IMAGE_PATH_FULL}/Dockerfile ]]; then
Expand All @@ -122,12 +128,13 @@ fi

# install gnu tar into a docker image
readonly TAR_IMAGE="builders/tar-get-builder-image-tagged:pid-$$"
# shellcheck disable=SC2086
{
cat <<Dockerfile
FROM alpine:3.16
RUN apk --no-cache add tar=1.34-r0
Dockerfile
} | docker buildx build ${DOCKER_BUILD_ARGS} --output=type=docker --tag "${TAR_IMAGE}" - >/dev/null
} | docker buildx build ${DOCKER_BUILD_ARGS} --no-cache --output=type=docker --tag "${TAR_IMAGE}" - >/dev/null
if ! docker image inspect "${TAR_IMAGE}" &>/dev/null; then
printf "error creating docker image [%s]\n" "${TAR_IMAGE}" &>/dev/stderr
exit 1
Expand Down Expand Up @@ -194,6 +201,7 @@ if [[ ${BUILD_IMAGE_IF_NEEDED} -eq 1 ]]; then
# build container image and load it into the local docker client
if ! docker image inspect "${IMAGE_TAGGED}" &>/dev/null; then
printf "generating docker image %s\n" "${IMAGE_TAGGED}" &>/dev/stderr
# shellcheck disable=SC2086
docker buildx build ${DOCKER_BUILD_ARGS} --output=type=docker --tag "${IMAGE_TAGGED}" - <"${TEMPTAR}" &>/dev/stderr
fi
fi
2 changes: 1 addition & 1 deletion builders/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.4
0.5.0
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.5.1

0 comments on commit 0afc373

Please sign in to comment.