Skip to content

Commit 3467939

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

3 files changed

Lines changed: 41 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/full:current"
9+
docker_sibling_containers: true
10+
}

release/kokoro/release_linux.sh

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
#!/bin/bash
22
set -e
3+
set -x
4+
5+
# Debug: Print host proxy settings
6+
echo "=== Host Proxy Settings ==="
7+
echo "http_proxy: ${http_proxy}"
8+
echo "https_proxy: ${https_proxy}"
9+
echo "no_proxy: ${no_proxy}"
10+
echo "HTTP_PROXY: ${HTTP_PROXY}"
11+
echo "HTTPS_PROXY: ${HTTPS_PROXY}"
12+
echo "NO_PROXY: ${NO_PROXY}"
13+
14+
# Avoid virtualenv/pip trying to download/upgrade tools from PyPI on host
15+
export VIRTUALENV_NO_DOWNLOAD=1
16+
export PIP_DISABLE_PIP_VERSION_CHECK=1
17+
18+
# Detect proxy settings on host and pass them to cibuildwheel container
19+
PROXY_ENV=""
20+
if [ -n "${http_proxy}" ]; then PROXY_ENV="${PROXY_ENV} http_proxy=${http_proxy}"; fi
21+
if [ -n "${https_proxy}" ]; then PROXY_ENV="${PROXY_ENV} https_proxy=${https_proxy}"; fi
22+
if [ -n "${no_proxy}" ]; then PROXY_ENV="${PROXY_ENV} no_proxy=${no_proxy}"; fi
23+
if [ -n "${HTTP_PROXY}" ]; then PROXY_ENV="${PROXY_ENV} HTTP_PROXY=${HTTP_PROXY}"; fi
24+
if [ -n "${HTTPS_PROXY}" ]; then PROXY_ENV="${PROXY_ENV} HTTPS_PROXY=${HTTPS_PROXY}"; fi
25+
if [ -n "${NO_PROXY}" ]; then PROXY_ENV="${PROXY_ENV} NO_PROXY=${NO_PROXY}"; fi
26+
27+
# Pass these environment variables to the cibuildwheel Docker container
28+
export CIBW_ENVIRONMENT="VIRTUALENV_NO_DOWNLOAD=1 PIP_DISABLE_PIP_VERSION_CHECK=1${PROXY_ENV}"
329

430
# If running locally (not on Kokoro), authenticate with gcloud.
531
if [ -z "${KOKORO_BUILD_ID}" ]; then
@@ -8,7 +34,7 @@ if [ -z "${KOKORO_BUILD_ID}" ]; then
834
fi
935
fi
1036

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

1339
REPO_DIR=$(mktemp -d)
1440
echo "Created temporary directory: ${REPO_DIR}"
@@ -52,11 +78,17 @@ cp -r "${SRC_DIR}"/{*,.*} . 2>/dev/null || true
5278
cp -r "${SRC_DIR}"/release/* . 2>/dev/null || true
5379
rm -rf cel_expr_python/*_test.py
5480

81+
echo "Downloading bazelisk on host..."
82+
curl -LO https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64
83+
chmod +x bazelisk-linux-amd64
84+
5585
# Check if pyproject.toml exists before running sed
5686
if [ -f pyproject.toml ]; then
5787
sed -i "" "s/\$VERSION/${VERSION}/g" pyproject.toml || sed -i "s/\$VERSION/${VERSION}/g" pyproject.toml
5888
fi
5989

90+
export CIBW_CONTAINER_ENGINE_EXTRA_ARGS="--network=host"
91+
6092
echo "Running cibuildwheel: ${CIBWHEEL_BIN}"
6193
# Default CIBWHEEL_BIN if not set
6294
if [ -z "${CIBWHEEL_BIN}" ]; then

release/pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ 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]
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"
47+
before-all = "echo 'Testing network...'; curl --max-time 10 -I https://pypi.org && echo 'Network OK' || echo 'Network FAILED'; echo 'Installing bazelisk'; if [ -f {project}/bazelisk-linux-amd64 ]; then cp {project}/bazelisk-linux-amd64 /usr/local/bin/bazel; else 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; fi"
48+
#container-engine = { name = "podman", create-args = ["--net", "host"] }
4849

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

0 commit comments

Comments
 (0)