Skip to content

Commit f4555c4

Browse files
Internal change
PiperOrigin-RevId: 922850859
1 parent 76b61ae commit f4555c4

4 files changed

Lines changed: 43 additions & 4 deletions

File tree

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ build:windows --google_default_credentials=true
3232
build:macos --remote_cache=https://storage.googleapis.com/macos-cel-python-remote-cache
3333
build:macos --google_default_credentials=true
3434

35+
# Silence deprecation warnings from external dependencies (Linux and macOS)
36+
build:linux --cxxopt=-Wno-deprecated-declarations
37+
build:macos --cxxopt=-Wno-deprecated-declarations
38+

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_sibling_containers: true
10+
}

release/kokoro/release_linux.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
#!/bin/bash
22
set -e
33

4+
5+
# Avoid virtualenv/pip trying to download/upgrade tools from PyPI on host
6+
export VIRTUALENV_NO_DOWNLOAD=1
7+
export PIP_DISABLE_PIP_VERSION_CHECK=1
8+
9+
# Pass these environment variables to the cibuildwheel Docker container
10+
export CIBW_ENVIRONMENT="VIRTUALENV_NO_DOWNLOAD=1 PIP_DISABLE_PIP_VERSION_CHECK=1"
11+
export CIBW_DEPENDENCY_VERSIONS="latest"
12+
413
# If running locally (not on Kokoro), authenticate with gcloud.
514
if [ -z "${KOKORO_BUILD_ID}" ]; then
615
if ! gcloud auth application-default print-access-token --quiet > /dev/null; then
716
gcloud auth application-default login
817
fi
918
fi
1019

11-
pip install -U keyring keyrings.google-artifactregistry-auth twine cibuildwheel
20+
# We use --no-cache-dir to force pip to download packages fresh and bypass the local
21+
# cache. In Kokoro/RBE sandboxed environments, writing to the default cache directory
22+
# (~/.cache/pip) can encounter permission/sandbox restrictions or lead to stale
23+
# dependency resolution. Disabling the cache ensures a reliable, reproducible install.
24+
pip install --no-cache-dir -U keyring keyrings.google-artifactregistry-auth twine cibuildwheel
1225

1326
REPO_DIR=$(mktemp -d)
1427
echo "Created temporary directory: ${REPO_DIR}"
@@ -52,16 +65,24 @@ cp -r "${SRC_DIR}"/{*,.*} . 2>/dev/null || true
5265
cp -r "${SRC_DIR}"/release/* . 2>/dev/null || true
5366
rm -rf cel_expr_python/*_test.py
5467

68+
echo "Downloading bazelisk on host..."
69+
curl -LO https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64
70+
chmod +x bazelisk-linux-amd64
71+
5572
# Check if pyproject.toml exists before running sed
5673
if [ -f pyproject.toml ]; then
5774
sed -i "" "s/\$VERSION/${VERSION}/g" pyproject.toml || sed -i "s/\$VERSION/${VERSION}/g" pyproject.toml
5875
fi
5976

77+
export CIBW_CONTAINER_ENGINE_EXTRA_ARGS="--network=host"
78+
6079
echo "Running cibuildwheel: ${CIBWHEEL_BIN}"
6180
# Default CIBWHEEL_BIN if not set
6281
if [ -z "${CIBWHEEL_BIN}" ]; then
6382
CIBWHEEL_BIN="python3 -m cibuildwheel"
6483
fi
84+
85+
# Run cibuildwheel synchronously
6586
${CIBWHEEL_BIN} --platform linux --output-dir dist
6687

6788
if [ "${DRY_RUN}" = "true" ]; then

release/pyproject.toml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,22 @@ where = ["."]
3838
exclude = ["codelab*", "conformance*", "custom_ext*", "release*", "testing*", "wheelhouse*"]
3939

4040
[tool.cibuildwheel]
41-
build = "cp311-* cp312-* cp313-* cp314-*"
42-
skip = "*musllinux* *win32*"
41+
build = "cp311-*"
42+
#build = "cp311-* cp312-* cp313-* cp314-*"
43+
skip = "*musllinux* *win32* *i686*"
4344
test-command = "python {project}/cel_basic_test.py"
4445
build-verbosity = 1
4546

4647
[tool.cibuildwheel.linux]
47-
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"
48+
manylinux-x86_64-image = "manylinux_2_28"
49+
container-engine = "docker; disable_host_mount: True"
50+
test-command = ""
51+
# Google's internal Kokoro/RBE network uses a secure MITM proxy that resigns HTTPS
52+
# traffic with an internal Google CA. Since the public manylinux container does not
53+
# trust this CA, git fetches for external dependencies (like @cel-cpp) will fail
54+
# with SSL certificate errors. We disable http.sslVerify inside the container to
55+
# bypass this and allow Bazel to fetch SCM dependencies through the proxy.
56+
before-all = "git config --global http.sslVerify false && echo 'Installing bazelisk' && cp {project}/bazelisk-linux-amd64 /usr/local/bin/bazel"
4857

4958
[tool.cibuildwheel.macos]
5059
before-all = "echo 'Installing bazelisk'; brew install bazelisk"

0 commit comments

Comments
 (0)