Skip to content

Commit 4d5fee1

Browse files
Internal change
PiperOrigin-RevId: 922850859
1 parent 9c09634 commit 4d5fee1

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

release/kokoro/release_linux.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33

44
build_file: "cel-python/release/kokoro/release_linux.sh"
55
timeout_mins: 120
6+
7+
container_properties {
8+
docker_image: "us-central1-docker.pkg.dev/kokoro-container-bakery/kokoro/ubuntu/ubuntu2204/ktcb:current"
9+
docker_privileged: true
10+
}

release/kokoro/release_linux.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ -z "${KOKORO_BUILD_ID}" ]; then
88
fi
99
fi
1010

11-
pip install -U keyring keyrings.google-artifactregistry-auth twine cibuildwheel
11+
pip install --no-cache-dir -U keyring keyrings.google-artifactregistry-auth twine cibuildwheel
1212

1313
REPO_DIR=$(mktemp -d)
1414
echo "Created temporary directory: ${REPO_DIR}"
@@ -23,7 +23,7 @@ if [ "${DRY_RUN}" = "true" ]; then
2323
# Get the latest tag or fallback
2424
VERSION=$(git tag --sort=-v:refname 2>/dev/null | head -n 1 || true)
2525
if [ -z "${VERSION}" ]; then
26-
VERSION="0.1.2"
26+
VERSION="v0.1.2"
2727
fi
2828
popd
2929
else
@@ -43,6 +43,26 @@ echo "Building release for version: ${VERSION}"
4343
TMP_DIR=$(mktemp -d)
4444
echo "Build directory: ${TMP_DIR}"
4545

46+
# Configure pip inside cibuildwheel to use Google's internal Airlock PyPI mirror,
47+
# since public PyPI (pypi.org) is blocked by the RBE VM's network firewall.
48+
# We dynamically fetch the GCE Service Account token from the GCE Metadata Server
49+
# to authenticate the request to the Artifact Registry repository.
50+
GCE_TOKEN=$(python3 -c 'import urllib.request, json; req = urllib.request.Request("http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token", headers={"Metadata-Flavor": "Google"}); print(json.loads(urllib.request.urlopen(req).read().decode())["access_token"])')
51+
export PIP_INDEX_URL="https://oauth2accesstoken:${GCE_TOKEN}@us-python.pkg.dev/artifact-foundry-prod/ah-3p-staging-python/simple/"
52+
53+
# Explicitly disable keyring searches and interactive prompts in pip inside the container
54+
# to prevent hangs on DBus or credential-helper lookups.
55+
export PIP_KEYRING_PROVIDER="disabled"
56+
export PIP_NO_INPUT="true"
57+
58+
# Use podman as the self-contained container engine inside the RBE container,
59+
# allowing us to run completely within /tmp and avoid shared RBE volume-mount hangs.
60+
export CIBW_CONTAINER_ENGINE="podman"
61+
export CIBW_ENVIRONMENT="PIP_INDEX_URL=$PIP_INDEX_URL PIP_KEYRING_PROVIDER=$PIP_KEYRING_PROVIDER PIP_NO_INPUT=$PIP_NO_INPUT"
62+
63+
# Enable extremely verbose logs for cibuildwheel.
64+
export CIBW_BUILD_VERBOSITY=3
65+
4666
# Add trap cleanup for TMP_DIR as well
4767
trap 'echo "Cleaning up temporary directories: ${REPO_DIR} ${TMP_DIR}"; rm -rf "${REPO_DIR}" "${TMP_DIR}"' EXIT
4868

release/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ exclude = ["codelab*", "conformance*", "custom_ext*", "release*", "testing*", "w
4141
build = "cp311-* cp312-* cp313-* cp314-*"
4242
skip = "*musllinux* *win32*"
4343
test-command = "python {project}/cel_basic_test.py"
44-
build-verbosity = 1
44+
build-verbosity = 3
4545

4646
[tool.cibuildwheel.linux]
4747
before-all = "echo 'Installing bazelisk'; curl -LO https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 && chmod +x bazelisk-linux-amd64 && mv bazelisk-linux-amd64 /usr/local/bin/bazel"

0 commit comments

Comments
 (0)